mirror of
https://github.com/grafana/grafana.git
synced 2025-09-23 18:52:33 +08: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:
@ -90,10 +90,12 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, page := range plugin.Pages {
|
for _, page := range plugin.Pages {
|
||||||
pageLink.Children = append(pageLink.Children, &dtos.NavLink{
|
if !page.SuppressNav {
|
||||||
Url: setting.AppSubUrl + "/plugins/" + plugin.Id + "/page/" + page.Slug,
|
pageLink.Children = append(pageLink.Children, &dtos.NavLink{
|
||||||
Text: page.Name,
|
Url: setting.AppSubUrl + "/plugins/" + plugin.Id + "/page/" + page.Slug,
|
||||||
})
|
Text: page.Name,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data.MainNavLinks = append(data.MainNavLinks, pageLink)
|
data.MainNavLinks = append(data.MainNavLinks, pageLink)
|
||||||
|
@ -9,10 +9,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type AppPluginPage struct {
|
type AppPluginPage struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
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 {
|
||||||
|
Reference in New Issue
Block a user