Changed noQueries to a dataFormats array that will allow a panel to define supported formats and prefered (first in array)

This commit is contained in:
Torkel Ödegaard
2019-02-12 16:05:29 +01:00
parent c3965e332d
commit a1453607a9
11 changed files with 32 additions and 20 deletions
-1
View File
@@ -47,7 +47,6 @@ type PluginBase struct {
BaseUrl string `json:"baseUrl"`
HideFromList bool `json:"hideFromList,omitempty"`
State PluginState `json:"state,omitempty"`
NoQueries bool `json:"noQueries"`
IncludedInAppId string `json:"-"`
PluginDir string `json:"-"`
+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
}