mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
add supressNav property to plugin pages.
This allows pages to be registered that dont show up in the Navigation menu when the App is pinned.
This commit is contained in:
parent
fa99a6745d
commit
74949d306f
@ -90,11 +90,13 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, page := range plugin.Pages {
|
for _, page := range plugin.Pages {
|
||||||
|
if !page.SuppressNav {
|
||||||
pageLink.Children = append(pageLink.Children, &dtos.NavLink{
|
pageLink.Children = append(pageLink.Children, &dtos.NavLink{
|
||||||
Url: setting.AppSubUrl + "/plugins/" + plugin.Id + "/page/" + page.Slug,
|
Url: setting.AppSubUrl + "/plugins/" + plugin.Id + "/page/" + page.Slug,
|
||||||
Text: page.Name,
|
Text: page.Name,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data.MainNavLinks = append(data.MainNavLinks, pageLink)
|
data.MainNavLinks = append(data.MainNavLinks, pageLink)
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ type AppPluginPage struct {
|
|||||||
Slug string `json:"slug"`
|
Slug string `json:"slug"`
|
||||||
Component string `json:"component"`
|
Component string `json:"component"`
|
||||||
Role models.RoleType `json:"role"`
|
Role models.RoleType `json:"role"`
|
||||||
|
SuppressNav bool `json:"suppress_nav"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppPluginCss struct {
|
type AppPluginCss struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user