Plugin admin: Add a page to show where panel plugins are used in dashboards (#50909)

This commit is contained in:
Ryan McKinley
2022-06-27 20:23:43 -04:00
committed by GitHub
parent fd6c7d518d
commit b6a9b9804d
13 changed files with 179 additions and 44 deletions
+6
View File
@@ -394,6 +394,12 @@ func doSearchQuery(
hasConstraints = true
}
// Panel type
if q.PanelType != "" {
fullQuery.AddMust(bluge.NewTermQuery(q.PanelType).SetField(documentFieldPanelType))
hasConstraints = true
}
// Datasource
if q.Datasource != "" {
fullQuery.AddMust(bluge.NewTermQuery(q.Datasource).SetField(documentFieldDSUID))
+1
View File
@@ -20,6 +20,7 @@ type DashboardQuery struct {
Datasource string `json:"ds_uid,omitempty"` // "datasource" collides with the JSON value at the same leel :()
Tags []string `json:"tags,omitempty"`
Kind []string `json:"kind,omitempty"`
PanelType string `json:"panel_type,omitempty"`
UIDs []string `json:"uid,omitempty"`
Explain bool `json:"explain,omitempty"` // adds details on why document matched
Facet []FacetField `json:"facet,omitempty"`