2016-01-09 16:34:20 -06:00
|
|
|
package plugins
|
|
|
|
|
2020-01-13 13:18:45 -06:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/plugins/backendplugin"
|
|
|
|
)
|
2016-01-09 16:34:20 -06:00
|
|
|
|
|
|
|
type PanelPlugin struct {
|
|
|
|
FrontendPluginBase
|
2019-05-10 00:46:14 -05:00
|
|
|
SkipDataQuery bool `json:"skipDataQuery"`
|
2016-01-09 16:34:20 -06:00
|
|
|
}
|
|
|
|
|
2021-03-08 00:02:49 -06:00
|
|
|
func (p *PanelPlugin) Load(decoder *json.Decoder, base *PluginBase, backendPluginManager backendplugin.Manager) (
|
|
|
|
interface{}, error) {
|
2020-01-13 10:13:17 -06:00
|
|
|
if err := decoder.Decode(p); err != nil {
|
2021-03-08 00:02:49 -06:00
|
|
|
return nil, err
|
2016-01-09 16:34:20 -06:00
|
|
|
}
|
|
|
|
|
2021-05-03 09:49:09 -05:00
|
|
|
if p.Id == "grafana-piechart-panel" {
|
|
|
|
p.Name = "Pie Chart (old)"
|
|
|
|
}
|
|
|
|
|
2021-03-08 00:02:49 -06:00
|
|
|
return p, nil
|
2016-01-09 16:34:20 -06:00
|
|
|
}
|