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
2190392e
Commit
2190392e
authored
Jan 25, 2016
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added grafana_admins count
parent
a621c0d2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
4 deletions
+17
-4
docs/sources/reference/http_api.md
+2
-1
pkg/models/stats.go
+1
-0
pkg/services/sqlstore/stats.go
+5
-1
public/app/features/admin/partials/stats.html
+9
-2
No files found.
docs/sources/reference/http_api.md
View file @
2190392e
...
...
@@ -1446,7 +1446,8 @@ Keys:
"db_tag_count":6,
"data_source_count":1,
"playlist_count":1,
"starred_db_count":2
"starred_db_count":2,
"grafana_admin_count":2
}
### Global Users
...
...
pkg/models/stats.go
View file @
2190392e
...
...
@@ -28,6 +28,7 @@ type AdminStats struct {
DataSourceCount
int
`json:"data_source_count"`
PlaylistCount
int
`json:"playlist_count"`
StarredDbCount
int
`json:"starred_db_count"`
GrafanaAdminCount
int
`json:"grafana_admin_count"`
}
type
GetAdminStatsQuery
struct
{
...
...
pkg/services/sqlstore/stats.go
View file @
2190392e
...
...
@@ -81,7 +81,11 @@ func GetAdminStats(query *m.GetAdminStatsQuery) error {
(
SELECT COUNT (DISTINCT `
+
dialect
.
Quote
(
"dashboard_id"
)
+
` )
FROM `
+
dialect
.
Quote
(
"star"
)
+
`
) AS starred_db_count
) AS starred_db_count,
(
SELECT SUM ( `
+
dialect
.
Quote
(
"is_admin"
)
+
` )
FROM `
+
dialect
.
Quote
(
"user"
)
+
`
) AS grafana_admin_count
`
var
stats
m
.
AdminStats
...
...
public/app/features/admin/partials/stats.html
View file @
2190392e
<topnav
icon=
"fa fa-fw fa-bar-chart"
title=
"Grafana stats"
>
<topnav
icon=
"fa fa-fw fa-bar-chart"
title=
"Grafana stats"
subnav=
"true"
>
<ul
class=
"nav"
>
<li
class=
"active"
><a
href=
"admin/stats"
>
Overview
</a></li>
</ul>
</topnav>
<div
class=
"page-container"
>
<div
class=
"page-wide"
>
<h1>
Stats
Overview
</h1>
<table
class=
"filter-table form-inline"
>
...
...
@@ -24,6 +27,10 @@
<td>
{{stats.user_count}}
</td>
</tr>
<tr>
<td>
Total grafana admins
</td>
<td>
{{stats.grafana_admin_count}}
</td>
</tr>
<tr>
<td>
Total organizations
</td>
<td>
{{stats.org_count}}
</td>
</tr>
...
...
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