mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
22 lines
578 B
Go
22 lines
578 B
Go
package api
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/api/response"
|
|
"github.com/grafana/grafana/pkg/bus"
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
func (hs *HTTPServer) AdminGetSettings(_ *models.ReqContext) response.Response {
|
|
return response.JSON(200, hs.SettingsProvider.Current())
|
|
}
|
|
|
|
func AdminGetStats(c *models.ReqContext) response.Response {
|
|
statsQuery := models.GetAdminStatsQuery{}
|
|
|
|
if err := bus.Dispatch(&statsQuery); err != nil {
|
|
return response.Error(500, "Failed to get admin stats from database", err)
|
|
}
|
|
|
|
return response.JSON(200, statsQuery.Result)
|
|
}
|