Plugins: Support changing plugin IDs (hardcoded) (#67867)

This commit is contained in:
Ryan McKinley
2023-06-02 10:46:12 -07:00
committed by GitHub
parent 4fdccef7b3
commit 422684d8b0
9 changed files with 104 additions and 12 deletions

View File

@ -57,6 +57,9 @@ type Plugin struct {
SecretsManager secretsmanagerplugin.SecretsManagerPlugin
client backendplugin.Plugin
log log.Logger
// This will be moved to plugin.json when we have general support in gcom
Alias string `json:"alias,omitempty"`
}
type PluginDTO struct {
@ -84,6 +87,9 @@ type PluginDTO struct {
BaseURL string
AngularDetected bool
// This will be moved to plugin.json when we have general support in gcom
Alias string `json:"alias,omitempty"`
}
func (p PluginDTO) SupportsStreaming() bool {
@ -155,7 +161,9 @@ func ReadPluginJSON(reader io.Reader) (JSONData, error) {
return JSONData{}, err
}
if plugin.ID == "grafana-piechart-panel" {
// Hardcoded changes
switch plugin.ID {
case "grafana-piechart-panel":
plugin.Name = "Pie Chart (old)"
}