Worked on search filter flag IsStarred, and updated frontend with new dashboard list panel

This commit is contained in:
Torkel Ödegaard
2015-02-04 11:35:59 +01:00
parent f0b13153ac
commit 60541a455f
11 changed files with 99 additions and 33 deletions
+9
View File
@@ -7,10 +7,13 @@ import (
"github.com/torkelo/grafana-pro/pkg/bus"
"github.com/torkelo/grafana-pro/pkg/middleware"
m "github.com/torkelo/grafana-pro/pkg/models"
"github.com/torkelo/grafana-pro/pkg/setting"
)
func Search(c *middleware.Context) {
queryText := c.Query("q")
starred := c.Query("starred")
result := m.SearchResult{
Dashboards: []*m.DashboardSearchHit{},
Tags: []*m.DashboardTagCloudItem{},
@@ -31,6 +34,8 @@ func Search(c *middleware.Context) {
query := m.SearchDashboardsQuery{
Title: matches[3],
Tag: matches[2],
UserId: c.UserId,
IsStarred: starred == "1",
AccountId: c.AccountId,
}
err := bus.Dispatch(&query)
@@ -38,7 +43,11 @@ func Search(c *middleware.Context) {
c.JsonApiErr(500, "Search failed", err)
return
}
result.Dashboards = query.Result
for _, dash := range result.Dashboards {
dash.Url = setting.AbsUrlTo("dashboard/db/" + dash.Slug)
}
}
c.JSON(200, result)