Plugins: Support changing plugin IDs (hardcoded) (#67867)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user