Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
c09d5062
Commit
c09d5062
authored
Mar 10, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(navigation): hide new and import for viewers
closes #4326
parent
18c5e900
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
pkg/api/index.go
+16
-11
No files found.
pkg/api/index.go
View file @
c09d5062
...
...
@@ -48,18 +48,23 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
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
{
Text
:
"Dashboards"
,
Icon
:
"icon-gf icon-gf-dashboard"
,
Url
:
setting
.
AppSubUrl
+
"/"
,
Children
:
[]
*
dtos
.
NavLink
{
{
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"
},
},
Text
:
"Dashboards"
,
Icon
:
"icon-gf icon-gf-dashboard"
,
Url
:
setting
.
AppSubUrl
+
"/"
,
Children
:
dashboardChildNavs
,
})
if
c
.
OrgRole
==
m
.
ROLE_ADMIN
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment