Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
07fee0a8
Commit
07fee0a8
authored
Jan 25, 2016
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted adminStatsCtrl to typescript
parent
442db7fe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
34 deletions
+29
-34
public/app/core/routes/all.js
+1
-0
public/app/features/admin/adminStatsCtrl.js
+0
-24
public/app/features/admin/adminStatsCtrl.ts
+18
-0
public/app/features/admin/partials/stats.html
+10
-10
No files found.
public/app/core/routes/all.js
View file @
07fee0a8
...
...
@@ -115,6 +115,7 @@ define([
.
when
(
'/admin/stats'
,
{
templateUrl
:
'app/features/admin/partials/stats.html'
,
controller
:
'AdminStatsCtrl'
,
controllerAs
:
'ctrl'
,
})
.
when
(
'/login'
,
{
templateUrl
:
'app/partials/login.html'
,
...
...
public/app/features/admin/adminStatsCtrl.js
deleted
100644 → 0
View file @
442db7fe
define
([
'angular'
,
],
function
(
angular
)
{
'use strict'
;
var
module
=
angular
.
module
(
'grafana.controllers'
);
module
.
controller
(
'AdminStatsCtrl'
,
function
(
$scope
,
backendSrv
)
{
$scope
.
init
=
function
()
{
$scope
.
getStats
();
};
$scope
.
getStats
=
function
()
{
backendSrv
.
get
(
'/api/admin/stats'
).
then
(
function
(
stats
)
{
$scope
.
stats
=
stats
;
});
};
$scope
.
init
();
});
});
public/app/features/admin/adminStatsCtrl.ts
0 → 100644
View file @
07fee0a8
//<reference path="../../headers/common.d.ts" />
import
angular
from
'angular'
;
export
class
AdminStatsCtrl
{
stats
:
any
;
/** @ngInject */
constructor
(
private
backendSrv
:
any
)
{}
init
()
{
this
.
backendSrv
.
get
(
'/api/admin/stats'
).
then
(
stats
=>
{
this
.
stats
=
stats
;
});
}
}
angular
.
module
(
'grafana.controllers'
).
controller
(
'AdminStatsCtrl'
,
AdminStatsCtrl
);
public/app/features/admin/partials/stats.html
View file @
07fee0a8
...
...
@@ -5,7 +5,7 @@
</topnav>
<div
class=
"page-container"
>
<div
class=
"page-wide"
>
<div
class=
"page-wide"
ng-init=
"ctrl.init()"
>
<h1>
Overview
</h1>
...
...
@@ -20,39 +20,39 @@
<tbody>
<tr>
<td>
Total dashboards
</td>
<td>
{{stats.dashboard_count}}
</td>
<td>
{{
ctrl.
stats.dashboard_count}}
</td>
</tr>
<tr>
<td>
Total users
</td>
<td>
{{stats.user_count}}
</td>
<td>
{{
ctrl.
stats.user_count}}
</td>
</tr>
<tr>
<td>
Total grafana admins
</td>
<td>
{{stats.grafana_admin_count}}
</td>
<td>
{{
ctrl.
stats.grafana_admin_count}}
</td>
</tr>
<tr>
<td>
Total organizations
</td>
<td>
{{stats.org_count}}
</td>
<td>
{{
ctrl.
stats.org_count}}
</td>
</tr>
<tr>
<td>
Total datasources
</td>
<td>
{{stats.data_source_count}}
</td>
<td>
{{
ctrl.
stats.data_source_count}}
</td>
</tr>
<tr>
<td>
Total playlists
</td>
<td>
{{stats.playlist_count}}
</td>
<td>
{{
ctrl.
stats.playlist_count}}
</td>
</tr>
<tr>
<td>
Total snapshots
</td>
<td>
{{stats.db_snapshot_count}}
</td>
<td>
{{
ctrl.
stats.db_snapshot_count}}
</td>
</tr>
<tr>
<td>
Total dashboard tags
</td>
<td>
{{stats.db_tag_count}}
</td>
<td>
{{
ctrl.
stats.db_tag_count}}
</td>
</tr>
<tr>
<td>
Total starred dashboards
</td>
<td>
{{stats.starred_db_count}}
</td>
<td>
{{
ctrl.
stats.starred_db_count}}
</td>
</tr>
</tbody>
</table>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment