Merge pull request #15368 from grafana/15217-panels-without-queries

POC: Panels without queries can skip DataPanel
This commit is contained in:
Torkel Ödegaard
2019-02-13 08:06:25 +01:00
committed by GitHub
21 changed files with 146 additions and 55 deletions
+1
View File
@@ -145,6 +145,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf
"info": panel.Info,
"hideFromList": panel.HideFromList,
"sort": getPanelSort(panel.Id),
"dataFormats": panel.DataFormats,
}
}
+5
View File
@@ -4,6 +4,7 @@ import "encoding/json"
type PanelPlugin struct {
FrontendPluginBase
DataFormats []string `json:"dataFormats"`
}
func (p *PanelPlugin) Load(decoder *json.Decoder, pluginDir string) error {
@@ -15,6 +16,10 @@ func (p *PanelPlugin) Load(decoder *json.Decoder, pluginDir string) error {
return err
}
if p.DataFormats == nil {
p.DataFormats = []string{"time_series", "table"}
}
Panels[p.Id] = p
return nil
}