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
+10
View File
@@ -77,6 +77,7 @@ func (hs *HTTPServer) GetDataSources(c *contextmodel.ReqContext) response.Respon
if plugin, exists := hs.pluginStore.Plugin(c.Req.Context(), ds.Type); exists {
dsItem.TypeLogoUrl = plugin.Info.Logos.Small
dsItem.TypeName = plugin.Name
dsItem.Type = plugin.ID // may be from an alias
} else {
dsItem.TypeLogoUrl = "public/img/icn-datasource.svg"
}
@@ -730,6 +731,15 @@ func (hs *HTTPServer) convertModelToDtos(ctx context.Context, ds *datasources.Da
ReadOnly: ds.ReadOnly,
}
if hs.pluginStore != nil {
if plugin, exists := hs.pluginStore.Plugin(ctx, ds.Type); exists {
dto.TypeLogoUrl = plugin.Info.Logos.Small
dto.Type = plugin.ID // may be from an alias
} else {
dto.TypeLogoUrl = "public/img/icn-datasource.svg"
}
}
secrets, err := hs.DataSourcesService.DecryptedValues(ctx, ds)
if err == nil {
for k, v := range secrets {