Added limit to dashboard list panel and search

This commit is contained in:
Torkel Ödegaard
2015-02-05 11:10:56 +01:00
parent b6d5f49c0f
commit 8e1b753664
6 changed files with 34 additions and 5 deletions

View File

@@ -33,6 +33,11 @@ func setIsStarredFlagOnSearchResults(c *middleware.Context, hits []*m.DashboardS
func Search(c *middleware.Context) {
queryText := c.Query("q")
starred := c.Query("starred")
limit := c.QueryInt("limit")
if limit == 0 {
limit = 200
}
result := m.SearchResult{
Dashboards: []*m.DashboardSearchHit{},
@@ -58,6 +63,7 @@ func Search(c *middleware.Context) {
Title: matches[3],
Tag: matches[2],
UserId: c.UserId,
Limit: limit,
IsStarred: starred == "1",
AccountId: c.AccountId,
}