admin: adds paging to global user list

Currently there is a limit of 1000 users in the global
user list. This change introduces paging so that an
admin can see all users and not just the first 1000.

Adds a new route to the api - /api/users/search that
returns a list of users and a total count. It takes
two parameters perpage and page that enable paging.

Fixes #7469
This commit is contained in:
Daniel Lee
2017-02-13 12:59:36 +01:00
committed by bergquist
parent e80f673264
commit 193d468ed3
15 changed files with 360 additions and 100 deletions
+4 -4
View File
@@ -11,12 +11,11 @@ import (
"github.com/grafana/grafana/pkg/util"
)
func GetDataSources(c *middleware.Context) {
func GetDataSources(c *middleware.Context) Response {
query := m.GetDataSourcesQuery{OrgId: c.OrgId}
if err := bus.Dispatch(&query); err != nil {
c.JsonApiErr(500, "Failed to query datasources", err)
return
return ApiError(500, "Failed to query datasources", err)
}
result := make(dtos.DataSourceList, 0)
@@ -46,7 +45,8 @@ func GetDataSources(c *middleware.Context) {
}
sort.Sort(result)
c.JSON(200, result)
return Json(200, &result)
}
func GetDataSourceById(c *middleware.Context) Response {