mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 12:14:08 -06:00
26 lines
454 B
Go
26 lines
454 B
Go
package plugins
|
|
|
|
import "encoding/json"
|
|
|
|
type PanelPlugin struct {
|
|
FrontendPluginBase
|
|
DataFormats []string `json:"dataFormats"`
|
|
}
|
|
|
|
func (p *PanelPlugin) Load(decoder *json.Decoder, pluginDir string) error {
|
|
if err := decoder.Decode(&p); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := p.registerPlugin(pluginDir); err != nil {
|
|
return err
|
|
}
|
|
|
|
if p.DataFormats == nil {
|
|
p.DataFormats = []string{"time_series", "table"}
|
|
}
|
|
|
|
Panels[p.Id] = p
|
|
return nil
|
|
}
|