Started Grafana stats poc

This commit is contained in:
utkarshcmu
2016-01-21 01:48:29 -08:00
parent f2ce8f266b
commit c260c319ee
5 changed files with 89 additions and 0 deletions

View File

@@ -107,6 +107,12 @@ export class SideMenuCtrl {
url: this.getUrl("/admin/settings"),
});
this.mainLinks.push({
text: "Grafana stats",
icon: "fa fa-fw fa-bar-chart",
url: this.getUrl("/admin/stats"),
});
this.mainLinks.push({
text: "Global Users",
icon: "fa fa-fw fa-user",
@@ -118,6 +124,7 @@ export class SideMenuCtrl {
icon: "fa fa-fw fa-users",
url: this.getUrl("/admin/orgs"),
});
}
updateMenu() {

View File

@@ -112,6 +112,10 @@ define([
templateUrl: 'app/features/admin/partials/edit_org.html',
controller : 'AdminEditOrgCtrl',
})
.when('/admin/stats', {
templateUrl: 'app/features/admin/partials/stats.html',
controller : 'AdminStatsCtrl',
})
.when('/login', {
templateUrl: 'app/partials/login.html',
controller : 'LoginCtrl',

View File

@@ -0,0 +1,24 @@
define([
'angular',
],
function (angular) {
'use strict';
var module = angular.module('grafana.controllers');
module.controller('AdminStatsCtrl', function($scope) {
$scope.init = function() {
$scope.getStats();
};
$scope.getStats = function() {
// backendSrv.get('/api/admin/stats').then(function(stats) {
// $scope.stats = stats;
// });
};
$scope.init();
});
});

View File

@@ -4,4 +4,5 @@ define([
'./adminEditOrgCtrl',
'./adminEditUserCtrl',
'./adminSettingsCtrl',
'./adminStatsCtrl',
], function () {});

View File

@@ -0,0 +1,53 @@
<topnav icon="fa fa-fw fa-bar-chart" title="Grafana stats">
</topnav>
<div class="page-container">
<div class="page-wide">
<h1>
Stats
</h1>
<table class="filter-table form-inline">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Total dashboards</td>
<td>213</td>
</tr>
<tr>
<td>Total users</td>
<td>97</td>
</tr>
<tr>
<td>Total organizations</td>
<td>4</td>
</tr>
<tr>
<td>Total playlists</td>
<td>12</td>
</tr>
<tr>
<td>Total snapshots</td>
<td>64</td>
</tr>
<tr>
<td>Total dashboard tags</td>
<td>15</td>
</tr>
<tr>
<td>Total starred dashboards</td>
<td>131</td>
</tr>
<tr>
<td>Total panels</td>
<td>2739</td>
</tr>
</tbody>
</table>
</div>
</div>