2016-01-09 23:34:20 +01:00
|
|
|
package plugins
|
|
|
|
|
|
|
|
|
|
import "encoding/json"
|
|
|
|
|
|
|
|
|
|
type PanelPlugin struct {
|
|
|
|
|
FrontendPluginBase
|
2019-05-09 22:46:14 -07:00
|
|
|
SkipDataQuery bool `json:"skipDataQuery"`
|
2016-01-09 23:34:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *PanelPlugin) Load(decoder *json.Decoder, pluginDir string) error {
|
|
|
|
|
if err := decoder.Decode(&p); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-10 11:03:12 +01:00
|
|
|
if err := p.registerPlugin(pluginDir); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
2016-01-09 23:34:20 +01:00
|
|
|
|
2016-02-10 11:03:12 +01:00
|
|
|
Panels[p.Id] = p
|
2016-01-09 23:34:20 +01:00
|
|
|
return nil
|
|
|
|
|
}
|