mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
AppPlugins: Options to disable showing config page in nav (#31354)
* AppPlugins: Options to disable showing config page in nav * rename * Added autoEnabled * updated * Things are working sort of * Simplify
This commit is contained in:
@@ -128,6 +128,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *models.ReqContext) (map[string]i
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pluginsToPreload := []string{}
|
||||
for _, app := range enabledPlugins.Apps {
|
||||
if app.Preload {
|
||||
|
||||
@@ -117,13 +117,6 @@ func getAppLinks(c *models.ReqContext) ([]*dtos.NavLink, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if len(appLink.Children) > 0 && c.OrgRole == models.ROLE_ADMIN {
|
||||
appLink.Children = append(appLink.Children, &dtos.NavLink{Divider: true})
|
||||
appLink.Children = append(appLink.Children, &dtos.NavLink{
|
||||
Text: "Plugin Config", Icon: "cog", Url: setting.AppSubUrl + "/plugins/" + plugin.Id + "/",
|
||||
})
|
||||
}
|
||||
|
||||
if len(appLink.Children) > 0 {
|
||||
appLinks = append(appLinks, appLink)
|
||||
}
|
||||
|
||||
@@ -169,6 +169,11 @@ func GetPluginSettingByID(c *models.ReqContext) response.Response {
|
||||
SignatureOrg: def.SignatureOrg,
|
||||
}
|
||||
|
||||
if app, ok := plugins.Apps[def.Id]; ok {
|
||||
dto.Enabled = app.AutoEnabled
|
||||
dto.Pinned = app.AutoEnabled
|
||||
}
|
||||
|
||||
query := models.GetPluginSettingByIdQuery{PluginId: pluginID, OrgId: c.OrgId}
|
||||
if err := bus.Dispatch(&query); err != nil {
|
||||
if !errors.Is(err, models.ErrPluginSettingNotFound) {
|
||||
|
||||
Reference in New Issue
Block a user