From 9c14b9672f9c5ac72dade64d80a8af296b04bb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 11 Apr 2016 18:16:35 -0400 Subject: [PATCH 1/2] fix(): admin stats and postgres --- packaging/publish/publish.sh | 6 +++--- pkg/models/stats.go | 17 ++++++++--------- pkg/services/sqlstore/stats.go | 7 +------ public/app/features/admin/partials/stats.html | 4 ---- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/packaging/publish/publish.sh b/packaging/publish/publish.sh index 89a59ea5be1..09ded4c2ddc 100755 --- a/packaging/publish/publish.sh +++ b/packaging/publish/publish.sh @@ -1,7 +1,7 @@ #! /usr/bin/env bash -deb_ver=3.0.0-beta21459801392 -rpm_ver=3.0.0-beta21459801392 +deb_ver=3.0.0-beta31460381868 +rpm_ver=3.0.0-beta31460381868 #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 -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/stable/el/7 grafana-${version}-1.x86_64.rpm diff --git a/pkg/models/stats.go b/pkg/models/stats.go index 63f946b956b..fa9cfdab6e8 100644 --- a/pkg/models/stats.go +++ b/pkg/models/stats.go @@ -21,15 +21,14 @@ type GetDataSourceStatsQuery struct { } type AdminStats struct { - UserCount int `json:"user_count"` - OrgCount int `json:"org_count"` - DashboardCount int `json:"dashboard_count"` - DbSnapshotCount int `json:"db_snapshot_count"` - DbTagCount int `json:"db_tag_count"` - DataSourceCount int `json:"data_source_count"` - PlaylistCount int `json:"playlist_count"` - StarredDbCount int `json:"starred_db_count"` - GrafanaAdminCount int `json:"grafana_admin_count"` + UserCount int `json:"user_count"` + OrgCount int `json:"org_count"` + DashboardCount int `json:"dashboard_count"` + DbSnapshotCount int `json:"db_snapshot_count"` + DbTagCount int `json:"db_tag_count"` + DataSourceCount int `json:"data_source_count"` + PlaylistCount int `json:"playlist_count"` + StarredDbCount int `json:"starred_db_count"` } type GetAdminStatsQuery struct { diff --git a/pkg/services/sqlstore/stats.go b/pkg/services/sqlstore/stats.go index 92efab2015d..7580996ad57 100644 --- a/pkg/services/sqlstore/stats.go +++ b/pkg/services/sqlstore/stats.go @@ -85,12 +85,7 @@ func GetAdminStats(query *m.GetAdminStatsQuery) error { ( SELECT COUNT(DISTINCT ` + dialect.Quote("dashboard_id") + ` ) FROM ` + dialect.Quote("star") + ` - ) AS starred_db_count, - ( - SELECT COUNT(*) - FROM ` + dialect.Quote("user") + ` - WHERE ` + dialect.Quote("is_admin") + ` = 1 - ) AS grafana_admin_count + ) AS starred_db_count ` var stats m.AdminStats diff --git a/public/app/features/admin/partials/stats.html b/public/app/features/admin/partials/stats.html index 1ad114f50e2..bcc246b9e82 100644 --- a/public/app/features/admin/partials/stats.html +++ b/public/app/features/admin/partials/stats.html @@ -22,10 +22,6 @@ Total users {{ctrl.stats.user_count}} - - Total grafana admins - {{ctrl.stats.grafana_admin_count}} - Total organizations {{ctrl.stats.org_count}} From 94729745dcba058845cdd3152599bdfefd671e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 11 Apr 2016 18:54:00 -0400 Subject: [PATCH 2/2] change(apps): config tab is now default for app plugins, fixes #4573 --- public/app/features/plugins/plugin_edit_ctrl.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/public/app/features/plugins/plugin_edit_ctrl.ts b/public/app/features/plugins/plugin_edit_ctrl.ts index 7f3f6bff08f..5b3c552db6a 100644 --- a/public/app/features/plugins/plugin_edit_ctrl.ts +++ b/public/app/features/plugins/plugin_edit_ctrl.ts @@ -47,6 +47,7 @@ export class PluginEditCtrl { }); if (this.model.type === 'app') { + this.tabIndex = 1; this.tabs.push('Config'); this.hasDashboards = _.findWhere(result.includes, {type: 'dashboard'});