mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 11:12:30 +08:00
feat(plugins): progress on plugin details page, # 4275
This commit is contained in:
@ -28,8 +28,8 @@ func (fp *FrontendPluginBase) initFrontendPlugin() {
|
||||
|
||||
fp.handleModuleDefaults()
|
||||
|
||||
fp.Info.Logos.Small = evalRelativePluginUrlPath(fp.Info.Logos.Small, fp.Id)
|
||||
fp.Info.Logos.Large = evalRelativePluginUrlPath(fp.Info.Logos.Large, fp.Id)
|
||||
fp.Info.Logos.Small = evalRelativePluginUrlPath(fp.Info.Logos.Small, fp.BaseUrl)
|
||||
fp.Info.Logos.Large = evalRelativePluginUrlPath(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.Id)
|
||||
@ -55,7 +55,7 @@ func (fp *FrontendPluginBase) handleModuleDefaults() {
|
||||
fp.BaseUrl = path.Join("public/app/plugins", fp.Type, fp.Id)
|
||||
}
|
||||
|
||||
func evalRelativePluginUrlPath(pathStr string, pluginId string) string {
|
||||
func evalRelativePluginUrlPath(pathStr string, baseUrl string) string {
|
||||
if pathStr == "" {
|
||||
return ""
|
||||
}
|
||||
@ -64,5 +64,5 @@ func evalRelativePluginUrlPath(pathStr string, pluginId string) string {
|
||||
if u.IsAbs() {
|
||||
return pathStr
|
||||
}
|
||||
return path.Join("public/plugins", pluginId, pathStr)
|
||||
return path.Join(baseUrl, pathStr)
|
||||
}
|
||||
|
Reference in New Issue
Block a user