diff --git a/public/app/features/dashboard/dashboardCtrl.js b/public/app/features/dashboard/dashboardCtrl.js index ea0d91019b8..cc305e4aed4 100644 --- a/public/app/features/dashboard/dashboardCtrl.js +++ b/public/app/features/dashboard/dashboardCtrl.js @@ -57,6 +57,7 @@ function (angular, $, config, moment) { dashboardKeybindings.shortcuts($scope); + $scope.evaluateTotalStats(); $scope.updateSubmenuVisibility(); $scope.setWindowTitleAndTheme(); @@ -67,6 +68,25 @@ function (angular, $, config, moment) { }); }; + $scope.evaluateTotalStats = function() { + $scope.dashboard.totalRows = 0; + $scope.dashboard.totalPanels = 0; + $scope.dashboard.totalQueries = 0; + if ($scope.dashboard.rows) { + $scope.dashboard.totalRows = $scope.dashboard.rows.length; + for (var i=0; i<$scope.dashboard.rows.length; i++) { + if ($scope.dashboard.rows[i].panels) { + $scope.dashboard.totalPanels += $scope.dashboard.rows[i].panels.length; + for (var j=0; j<$scope.dashboard.rows[i].panels.length; j++) { + if ($scope.dashboard.rows[i].panels[j].targets) { + $scope.dashboard.totalQueries += $scope.dashboard.rows[i].panels[j].targets.length; + } + } + } + } + } + }; + $scope.updateSubmenuVisibility = function() { $scope.submenuEnabled = $scope.dashboard.isSubmenuFeaturesEnabled(); }; diff --git a/public/app/features/dashboard/partials/settings.html b/public/app/features/dashboard/partials/settings.html index 939a23a2d1e..d27d3322692 100644 --- a/public/app/features/dashboard/partials/settings.html +++ b/public/app/features/dashboard/partials/settings.html @@ -164,6 +164,39 @@
+
+ +
+
+
+ +
+
+
+ +
+