mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(): admin stats and postgres
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
deb_ver=3.0.0-beta21459801392
|
deb_ver=3.0.0-beta31460381868
|
||||||
rpm_ver=3.0.0-beta21459801392
|
rpm_ver=3.0.0-beta31460381868
|
||||||
|
|
||||||
#rpm_ver=3.0.0-1
|
#rpm_ver=3.0.0-1
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ rpm_ver=3.0.0-beta21459801392
|
|||||||
|
|
||||||
#wget https://grafanarel.s3.amazonaws.com/builds/grafana-${rpm_ver}.x86_64.rpm
|
#wget https://grafanarel.s3.amazonaws.com/builds/grafana-${rpm_ver}.x86_64.rpm
|
||||||
|
|
||||||
package_cloud push grafana/testing/el/6 grafana-${rpm_ver}.x86_64.rpm
|
#package_cloud push grafana/testing/el/6 grafana-${rpm_ver}.x86_64.rpm
|
||||||
#package_cloud push grafana/testing/el/7 grafana-${rpm_ver}.x86_64.rpm
|
#package_cloud push grafana/testing/el/7 grafana-${rpm_ver}.x86_64.rpm
|
||||||
|
|
||||||
# package_cloud push grafana/stable/el/7 grafana-${version}-1.x86_64.rpm
|
# package_cloud push grafana/stable/el/7 grafana-${version}-1.x86_64.rpm
|
||||||
|
|||||||
@@ -21,15 +21,14 @@ type GetDataSourceStatsQuery struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type AdminStats struct {
|
type AdminStats struct {
|
||||||
UserCount int `json:"user_count"`
|
UserCount int `json:"user_count"`
|
||||||
OrgCount int `json:"org_count"`
|
OrgCount int `json:"org_count"`
|
||||||
DashboardCount int `json:"dashboard_count"`
|
DashboardCount int `json:"dashboard_count"`
|
||||||
DbSnapshotCount int `json:"db_snapshot_count"`
|
DbSnapshotCount int `json:"db_snapshot_count"`
|
||||||
DbTagCount int `json:"db_tag_count"`
|
DbTagCount int `json:"db_tag_count"`
|
||||||
DataSourceCount int `json:"data_source_count"`
|
DataSourceCount int `json:"data_source_count"`
|
||||||
PlaylistCount int `json:"playlist_count"`
|
PlaylistCount int `json:"playlist_count"`
|
||||||
StarredDbCount int `json:"starred_db_count"`
|
StarredDbCount int `json:"starred_db_count"`
|
||||||
GrafanaAdminCount int `json:"grafana_admin_count"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetAdminStatsQuery struct {
|
type GetAdminStatsQuery struct {
|
||||||
|
|||||||
@@ -85,12 +85,7 @@ func GetAdminStats(query *m.GetAdminStatsQuery) error {
|
|||||||
(
|
(
|
||||||
SELECT COUNT(DISTINCT ` + dialect.Quote("dashboard_id") + ` )
|
SELECT COUNT(DISTINCT ` + dialect.Quote("dashboard_id") + ` )
|
||||||
FROM ` + dialect.Quote("star") + `
|
FROM ` + dialect.Quote("star") + `
|
||||||
) AS starred_db_count,
|
) AS starred_db_count
|
||||||
(
|
|
||||||
SELECT COUNT(*)
|
|
||||||
FROM ` + dialect.Quote("user") + `
|
|
||||||
WHERE ` + dialect.Quote("is_admin") + ` = 1
|
|
||||||
) AS grafana_admin_count
|
|
||||||
`
|
`
|
||||||
|
|
||||||
var stats m.AdminStats
|
var stats m.AdminStats
|
||||||
|
|||||||
@@ -22,10 +22,6 @@
|
|||||||
<td>Total users</td>
|
<td>Total users</td>
|
||||||
<td>{{ctrl.stats.user_count}}</td>
|
<td>{{ctrl.stats.user_count}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>Total grafana admins</td>
|
|
||||||
<td>{{ctrl.stats.grafana_admin_count}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Total organizations</td>
|
<td>Total organizations</td>
|
||||||
<td>{{ctrl.stats.org_count}}</td>
|
<td>{{ctrl.stats.org_count}}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user