mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 04:22:13 +08:00
feat(pluginlist): link in plugin list now goes to app/plugin default nav unless enabled
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/middleware"
|
||||
m "github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
func GetPluginList(c *middleware.Context) Response {
|
||||
@ -46,6 +47,7 @@ func GetPluginList(c *middleware.Context) Response {
|
||||
Info: &pluginDef.Info,
|
||||
LatestVersion: pluginDef.GrafanaNetVersion,
|
||||
HasUpdate: pluginDef.GrafanaNetHasUpdate,
|
||||
DefaultNavUrl: pluginDef.DefaultNavUrl,
|
||||
}
|
||||
|
||||
if pluginSetting, exists := pluginSettingsMap[pluginDef.Id]; exists {
|
||||
@ -53,6 +55,10 @@ func GetPluginList(c *middleware.Context) Response {
|
||||
listItem.Pinned = pluginSetting.Pinned
|
||||
}
|
||||
|
||||
if listItem.DefaultNavUrl == "" || !listItem.Enabled {
|
||||
listItem.DefaultNavUrl = setting.AppSubUrl + "/plugins/" + listItem.Id + "/edit"
|
||||
}
|
||||
|
||||
// filter out disabled
|
||||
if enabledFilter == "1" && !listItem.Enabled {
|
||||
continue
|
||||
|
Reference in New Issue
Block a user