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