ux(): added specific fallback logos for plugin depending on type, polished layout selector style

This commit is contained in:
Torkel Ödegaard
2016-03-17 10:15:16 +01:00
parent 6bf05a8154
commit b2fe7e518f
7 changed files with 141 additions and 5 deletions
+1 -1
View File
@@ -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)
+4 -4
View File
@@ -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)