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
8aef297e
Commit
8aef297e
authored
May 05, 2015
by
Anthony Woods
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show sidemenu when admin user logs in the first time. #54
parent
7a8851c5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
public/app/controllers/loginCtrl.js
+1
-1
public/app/routes/dashLoadControllers.js
+3
-1
public/app/services/contextSrv.js
+13
-1
No files found.
public/app/controllers/loginCtrl.js
View file @
8aef297e
...
@@ -14,7 +14,7 @@ function (angular, config) {
...
@@ -14,7 +14,7 @@ function (angular, config) {
password
:
''
,
password
:
''
,
};
};
contextSrv
.
s
etSideMenuState
(
false
)
;
contextSrv
.
s
idemenu
=
false
;
$scope
.
googleAuthEnabled
=
config
.
googleAuthEnabled
;
$scope
.
googleAuthEnabled
=
config
.
googleAuthEnabled
;
$scope
.
githubAuthEnabled
=
config
.
githubAuthEnabled
;
$scope
.
githubAuthEnabled
=
config
.
githubAuthEnabled
;
...
...
public/app/routes/dashLoadControllers.js
View file @
8aef297e
...
@@ -36,7 +36,9 @@ function (angular, _, kbn, moment, $) {
...
@@ -36,7 +36,9 @@ function (angular, _, kbn, moment, $) {
});
});
module
.
controller
(
'DashFromSnapshotCtrl'
,
function
(
$scope
,
$routeParams
,
backendSrv
)
{
module
.
controller
(
'DashFromSnapshotCtrl'
,
function
(
$scope
,
$routeParams
,
backendSrv
,
contextSrv
)
{
//don't show the sidemenu in snapshots.
contextSrv
.
sidemenu
=
false
;
backendSrv
.
get
(
'/api/snapshots/'
+
$routeParams
.
key
).
then
(
function
(
result
)
{
backendSrv
.
get
(
'/api/snapshots/'
+
$routeParams
.
key
).
then
(
function
(
result
)
{
$scope
.
initDashboard
(
result
,
$scope
);
$scope
.
initDashboard
(
result
,
$scope
);
},
function
()
{
},
function
()
{
...
...
public/app/services/contextSrv.js
View file @
8aef297e
...
@@ -45,7 +45,19 @@ function (angular, _, store, config) {
...
@@ -45,7 +45,19 @@ function (angular, _, store, config) {
this
.
user
=
new
User
();
this
.
user
=
new
User
();
this
.
isSignedIn
=
this
.
user
.
isSignedIn
;
this
.
isSignedIn
=
this
.
user
.
isSignedIn
;
this
.
isGrafanaAdmin
=
this
.
user
.
isGrafanaAdmin
;
this
.
isGrafanaAdmin
=
this
.
user
.
isGrafanaAdmin
;
this
.
sidemenu
=
store
.
getBool
(
'grafana.sidemenu'
,
true
);
var
sidemenuDefault
=
false
;
if
(
this
.
hasRole
(
'Admin'
))
{
sidemenuDefault
=
true
;
}
this
.
sidemenu
=
store
.
getBool
(
'grafana.sidemenu'
,
sidemenuDefault
);
if
(
this
.
isSignedIn
&&
!
store
.
exists
(
'grafana.sidemenu'
))
{
// If the sidemnu has never been set before, set it to false.
// This will result in this.sidemenu and the localStorage grafana.sidemenu
// to be out of sync if the user has an admin role. But this is
// intentional and results in the user seeing the sidemenu only on
// their first login.
store
.
set
(
'grafana.sidemenu'
,
false
);
}
this
.
isEditor
=
this
.
hasRole
(
'Editor'
)
||
this
.
hasRole
(
'Admin'
);
this
.
isEditor
=
this
.
hasRole
(
'Editor'
)
||
this
.
hasRole
(
'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