ux(): added specific fallback logos for plugin depending on type, polished layout selector style
This commit is contained in:
@@ -40,7 +40,7 @@ func GetDataSources(c *middleware.Context) {
|
||||
if plugin, exists := plugins.DataSources[ds.Type]; exists {
|
||||
dsItem.TypeLogoUrl = plugin.Info.Logos.Small
|
||||
} else {
|
||||
dsItem.TypeLogoUrl = "public/img/plugin-default-logo_dark.svg"
|
||||
dsItem.TypeLogoUrl = "public/img/icn-datasources.svg"
|
||||
}
|
||||
|
||||
result = append(result, dsItem)
|
||||
|
||||
@@ -23,17 +23,17 @@ func (fp *FrontendPluginBase) initFrontendPlugin() {
|
||||
|
||||
fp.handleModuleDefaults()
|
||||
|
||||
fp.Info.Logos.Small = getPluginLogoUrl(fp.Info.Logos.Small, fp.BaseUrl)
|
||||
fp.Info.Logos.Large = getPluginLogoUrl(fp.Info.Logos.Large, fp.BaseUrl)
|
||||
fp.Info.Logos.Small = getPluginLogoUrl(fp.Type, fp.Info.Logos.Small, fp.BaseUrl)
|
||||
fp.Info.Logos.Large = getPluginLogoUrl(fp.Type, fp.Info.Logos.Large, fp.BaseUrl)
|
||||
|
||||
for i := 0; i < len(fp.Info.Screenshots); i++ {
|
||||
fp.Info.Screenshots[i].Path = evalRelativePluginUrlPath(fp.Info.Screenshots[i].Path, fp.BaseUrl)
|
||||
}
|
||||
}
|
||||
|
||||
func getPluginLogoUrl(path, baseUrl string) string {
|
||||
func getPluginLogoUrl(pluginType, path, baseUrl string) string {
|
||||
if path == "" {
|
||||
return "public/img/plugin-default-logo_dark.svg"
|
||||
return "public/img/icn-" + pluginType + ".svg"
|
||||
}
|
||||
|
||||
return evalRelativePluginUrlPath(path, baseUrl)
|
||||
|
||||
Reference in New Issue
Block a user