Commit 473c47cd by Alexander Zobnin Committed by Torkel Ödegaard

snapshots: improve snapshot listing performance, #9314 (#9477)

exclude dashboard field from snapshot list search
parent 002b4d34
......@@ -73,11 +73,12 @@ type GetDashboardSnapshotQuery struct {
}
type DashboardSnapshots []*DashboardSnapshot
type DashboardSnapshotsList []*DashboardSnapshotDTO
type GetDashboardSnapshotsQuery struct {
Name string
Limit int
OrgId int64
Result DashboardSnapshots
Result DashboardSnapshotsList
}
......@@ -86,9 +86,10 @@ func GetDashboardSnapshot(query *m.GetDashboardSnapshotQuery) error {
}
func SearchDashboardSnapshots(query *m.GetDashboardSnapshotsQuery) error {
var snapshots = make(m.DashboardSnapshots, 0)
var snapshots = make(m.DashboardSnapshotsList, 0)
sess := x.Limit(query.Limit)
sess.Table("dashboard_snapshot")
if query.Name != "" {
sess.Where("name LIKE ?", query.Name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment