mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
parent
18c5e90076
commit
c09d506245
@ -48,18 +48,23 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
|
|||||||
data.User.LightTheme = true
|
data.User.LightTheme = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dashboardChildNavs := []*dtos.NavLink{
|
||||||
|
{Text: "Home", Url: setting.AppSubUrl + "/"},
|
||||||
|
{Text: "Playlists", Url: setting.AppSubUrl + "/playlists"},
|
||||||
|
{Text: "Snapshots", Url: setting.AppSubUrl + "/dashboard/snapshots"},
|
||||||
|
}
|
||||||
|
|
||||||
|
if c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR {
|
||||||
|
dashboardChildNavs = append(dashboardChildNavs, &dtos.NavLink{Divider: true})
|
||||||
|
dashboardChildNavs = append(dashboardChildNavs, &dtos.NavLink{Text: "New", Url: setting.AppSubUrl + "/dashboard/new"})
|
||||||
|
dashboardChildNavs = append(dashboardChildNavs, &dtos.NavLink{Text: "Import", Url: setting.AppSubUrl + "/import/dashboard"})
|
||||||
|
}
|
||||||
|
|
||||||
data.MainNavLinks = append(data.MainNavLinks, &dtos.NavLink{
|
data.MainNavLinks = append(data.MainNavLinks, &dtos.NavLink{
|
||||||
Text: "Dashboards",
|
Text: "Dashboards",
|
||||||
Icon: "icon-gf icon-gf-dashboard",
|
Icon: "icon-gf icon-gf-dashboard",
|
||||||
Url: setting.AppSubUrl + "/",
|
Url: setting.AppSubUrl + "/",
|
||||||
Children: []*dtos.NavLink{
|
Children: dashboardChildNavs,
|
||||||
{Text: "Home", Url: setting.AppSubUrl + "/"},
|
|
||||||
{Text: "Playlists", Url: setting.AppSubUrl + "/playlists"},
|
|
||||||
{Text: "Snapshots", Url: setting.AppSubUrl + "/dashboard/snapshots"},
|
|
||||||
{Divider: true},
|
|
||||||
{Text: "New", Url: setting.AppSubUrl + "/dashboard/new"},
|
|
||||||
{Text: "Import", Url: setting.AppSubUrl + "/import/dashboard"},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if c.OrgRole == m.ROLE_ADMIN {
|
if c.OrgRole == m.ROLE_ADMIN {
|
||||||
|
Loading…
Reference in New Issue
Block a user