Merge remote-tracking branch 'origin/master' into panelbase
This commit is contained in:
@@ -3,7 +3,9 @@ package api
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
"github.com/grafana/grafana/pkg/middleware"
|
||||
m "github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
@@ -27,3 +29,15 @@ func AdminGetSettings(c *middleware.Context) {
|
||||
|
||||
c.JSON(200, settings)
|
||||
}
|
||||
|
||||
func AdminGetStats(c *middleware.Context) {
|
||||
|
||||
statsQuery := m.GetAdminStatsQuery{}
|
||||
|
||||
if err := bus.Dispatch(&statsQuery); err != nil {
|
||||
c.JsonApiErr(500, "Failed to get admin stats from database", err)
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(200, statsQuery.Result)
|
||||
}
|
||||
@@ -40,6 +40,7 @@ func Register(r *macaron.Macaron) {
|
||||
r.Get("/admin/users/edit/:id", reqGrafanaAdmin, Index)
|
||||
r.Get("/admin/orgs", reqGrafanaAdmin, Index)
|
||||
r.Get("/admin/orgs/edit/:id", reqGrafanaAdmin, Index)
|
||||
r.Get("/admin/stats", reqGrafanaAdmin, Index)
|
||||
|
||||
r.Get("/apps", reqSignedIn, Index)
|
||||
r.Get("/apps/edit/*", reqSignedIn, Index)
|
||||
@@ -210,6 +211,7 @@ func Register(r *macaron.Macaron) {
|
||||
r.Delete("/users/:id", AdminDeleteUser)
|
||||
r.Get("/users/:id/quotas", wrap(GetUserQuotas))
|
||||
r.Put("/users/:id/quotas/:target", bind(m.UpdateUserQuotaCmd{}), wrap(UpdateUserQuota))
|
||||
r.Get("/stats", AdminGetStats)
|
||||
}, reqGrafanaAdmin)
|
||||
|
||||
// rendering
|
||||
|
||||
Reference in New Issue
Block a user