mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 23:12:23 +08:00
feat(plugins): major improvement in plugins golang code
This commit is contained in:
19
pkg/plugins/panel_plugin.go
Normal file
19
pkg/plugins/panel_plugin.go
Normal file
@ -0,0 +1,19 @@
|
||||
package plugins
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
type PanelPlugin struct {
|
||||
FrontendPluginBase
|
||||
}
|
||||
|
||||
func (p *PanelPlugin) Load(decoder *json.Decoder, pluginDir string) error {
|
||||
if err := decoder.Decode(&p); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
p.PluginDir = pluginDir
|
||||
p.initFrontendPlugin()
|
||||
Panels[p.Id] = p
|
||||
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user