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
f3fb178e
Commit
f3fb178e
authored
Aug 02, 2019
by
Torkel Ödegaard
Committed by
Leonard Gram
Aug 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Navigation: Fixed double settings menus (#18349)
parent
89a4f30e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
103 deletions
+58
-103
pkg/api/index.go
+58
-103
No files found.
pkg/api/index.go
View file @
f3fb178e
...
...
@@ -242,93 +242,69 @@ func (hs *HTTPServer) setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, er
}
}
if
c
.
IsGrafanaAdmin
||
c
.
OrgRole
==
m
.
ROLE_ADMIN
{
cfgNode
:=
&
dtos
.
NavLink
{
Id
:
"cfg"
,
Text
:
"Configuration"
,
SubTitle
:
"Organization: "
+
c
.
OrgName
,
Icon
:
"gicon gicon-cog"
,
Url
:
setting
.
AppSubUrl
+
"/datasources"
,
Children
:
[]
*
dtos
.
NavLink
{
{
Text
:
"Data Sources"
,
Icon
:
"gicon gicon-datasources"
,
Description
:
"Add and configure data sources"
,
Id
:
"datasources"
,
Url
:
setting
.
AppSubUrl
+
"/datasources"
,
},
{
Text
:
"Users"
,
Id
:
"users"
,
Description
:
"Manage org members"
,
Icon
:
"gicon gicon-user"
,
Url
:
setting
.
AppSubUrl
+
"/org/users"
,
},
{
Text
:
"Teams"
,
Id
:
"teams"
,
Description
:
"Manage org groups"
,
Icon
:
"gicon gicon-team"
,
Url
:
setting
.
AppSubUrl
+
"/org/teams"
,
},
{
Text
:
"Plugins"
,
Id
:
"plugins"
,
Description
:
"View and configure plugins"
,
Icon
:
"gicon gicon-plugins"
,
Url
:
setting
.
AppSubUrl
+
"/plugins"
,
},
{
Text
:
"Preferences"
,
Id
:
"org-settings"
,
Description
:
"Organization preferences"
,
Icon
:
"gicon gicon-preferences"
,
Url
:
setting
.
AppSubUrl
+
"/org"
,
},
{
Text
:
"API Keys"
,
Id
:
"apikeys"
,
Description
:
"Create & manage API keys"
,
Icon
:
"gicon gicon-apikeys"
,
Url
:
setting
.
AppSubUrl
+
"/org/apikeys"
,
},
},
}
configNodes
:=
[]
*
dtos
.
NavLink
{}
if
c
.
OrgRole
==
m
.
ROLE_ADMIN
{
configNodes
=
append
(
configNodes
,
&
dtos
.
NavLink
{
Text
:
"Data Sources"
,
Icon
:
"gicon gicon-datasources"
,
Description
:
"Add and configure data sources"
,
Id
:
"datasources"
,
Url
:
setting
.
AppSubUrl
+
"/datasources"
,
})
configNodes
=
append
(
configNodes
,
&
dtos
.
NavLink
{
Text
:
"Users"
,
Id
:
"users"
,
Description
:
"Manage org members"
,
Icon
:
"gicon gicon-user"
,
Url
:
setting
.
AppSubUrl
+
"/org/users"
,
})
}
if
c
.
OrgRole
!=
m
.
ROLE_ADMIN
{
cfgNode
=
&
dtos
.
NavLink
{
Id
:
"cfg"
,
Text
:
"Configuration"
,
SubTitle
:
"Organization: "
+
c
.
OrgName
,
Icon
:
"gicon gicon-cog"
,
Url
:
setting
.
AppSubUrl
+
"/admin/users"
,
Children
:
make
([]
*
dtos
.
NavLink
,
0
),
}
}
if
c
.
OrgRole
==
m
.
ROLE_ADMIN
||
hs
.
Cfg
.
EditorsCanAdmin
{
configNodes
=
append
(
configNodes
,
&
dtos
.
NavLink
{
Text
:
"Teams"
,
Id
:
"teams"
,
Description
:
"Manage org groups"
,
Icon
:
"gicon gicon-team"
,
Url
:
setting
.
AppSubUrl
+
"/org/teams"
,
})
}
data
.
NavTree
=
append
(
data
.
NavTree
,
cfgNode
)
}
else
{
cfgNode
:=
&
dtos
.
NavLink
{
Id
:
"cfg"
,
Text
:
"Configuration"
,
SubTitle
:
"Organization: "
+
c
.
OrgName
,
Icon
:
"gicon gicon-cog"
,
Url
:
setting
.
AppSubUrl
+
"/plugins"
,
Children
:
[]
*
dtos
.
NavLink
{
{
Text
:
"Plugins"
,
Id
:
"plugins"
,
Description
:
"View and configure plugins"
,
Icon
:
"gicon gicon-plugins"
,
Url
:
setting
.
AppSubUrl
+
"/plugins"
,
},
},
}
configNodes
=
append
(
configNodes
,
&
dtos
.
NavLink
{
Text
:
"Plugins"
,
Id
:
"plugins"
,
Description
:
"View and configure plugins"
,
Icon
:
"gicon gicon-plugins"
,
Url
:
setting
.
AppSubUrl
+
"/plugins"
,
})
data
.
NavTree
=
append
(
data
.
NavTree
,
cfgNode
)
if
c
.
OrgRole
==
m
.
ROLE_ADMIN
{
configNodes
=
append
(
configNodes
,
&
dtos
.
NavLink
{
Text
:
"Preferences"
,
Id
:
"org-settings"
,
Description
:
"Organization preferences"
,
Icon
:
"gicon gicon-preferences"
,
Url
:
setting
.
AppSubUrl
+
"/org"
,
})
configNodes
=
append
(
configNodes
,
&
dtos
.
NavLink
{
Text
:
"API Keys"
,
Id
:
"apikeys"
,
Description
:
"Create & manage API keys"
,
Icon
:
"gicon gicon-apikeys"
,
Url
:
setting
.
AppSubUrl
+
"/org/apikeys"
,
})
}
data
.
NavTree
=
append
(
data
.
NavTree
,
&
dtos
.
NavLink
{
Id
:
"cfg"
,
Text
:
"Configuration"
,
SubTitle
:
"Organization: "
+
c
.
OrgName
,
Icon
:
"gicon gicon-cog"
,
Url
:
configNodes
[
0
]
.
Url
,
Children
:
configNodes
,
})
if
c
.
IsGrafanaAdmin
{
data
.
NavTree
=
append
(
data
.
NavTree
,
&
dtos
.
NavLink
{
Text
:
"Server Admin"
,
...
...
@@ -346,27 +322,6 @@ func (hs *HTTPServer) setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, er
})
}
if
(
c
.
OrgRole
==
m
.
ROLE_EDITOR
||
c
.
OrgRole
==
m
.
ROLE_VIEWER
)
&&
hs
.
Cfg
.
EditorsCanAdmin
{
cfgNode
:=
&
dtos
.
NavLink
{
Id
:
"cfg"
,
Text
:
"Configuration"
,
SubTitle
:
"Organization: "
+
c
.
OrgName
,
Icon
:
"gicon gicon-cog"
,
Url
:
setting
.
AppSubUrl
+
"/org/teams"
,
Children
:
[]
*
dtos
.
NavLink
{
{
Text
:
"Teams"
,
Id
:
"teams"
,
Description
:
"Manage org groups"
,
Icon
:
"gicon gicon-team"
,
Url
:
setting
.
AppSubUrl
+
"/org/teams"
,
},
},
}
data
.
NavTree
=
append
(
data
.
NavTree
,
cfgNode
)
}
data
.
NavTree
=
append
(
data
.
NavTree
,
&
dtos
.
NavLink
{
Text
:
"Help"
,
SubTitle
:
fmt
.
Sprintf
(
`%s v%s (%s)`
,
setting
.
ApplicationName
,
setting
.
BuildVersion
,
setting
.
BuildCommit
),
...
...
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