2016-01-09 16:34:20 -06:00
|
|
|
package plugins
|
|
|
|
|
|
|
|
import "encoding/json"
|
|
|
|
|
|
|
|
type PanelPlugin struct {
|
|
|
|
FrontendPluginBase
|
2019-02-12 09:05:29 -06:00
|
|
|
DataFormats []string `json:"dataFormats"`
|
2016-01-09 16:34:20 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PanelPlugin) Load(decoder *json.Decoder, pluginDir string) error {
|
|
|
|
if err := decoder.Decode(&p); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2016-02-10 04:03:12 -06:00
|
|
|
if err := p.registerPlugin(pluginDir); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2016-01-09 16:34:20 -06:00
|
|
|
|
2019-02-12 09:05:29 -06:00
|
|
|
if p.DataFormats == nil {
|
|
|
|
p.DataFormats = []string{"time_series", "table"}
|
|
|
|
}
|
|
|
|
|
2016-02-10 04:03:12 -06:00
|
|
|
Panels[p.Id] = p
|
2016-01-09 16:34:20 -06:00
|
|
|
return nil
|
|
|
|
}
|