Commit 34427f34 by Torkel Ödegaard

side menu visible by default after login

parent 344812f1
......@@ -8,9 +8,15 @@ define([], function() {
set: function(key, value) {
window.localStorage[key] = value;
},
getBool: function(key) {
getBool: function(key, def) {
if (def !== void 0 && !this.exists(key)) {
return def;
}
return window.localStorage[key] === 'true' ? true : false;
},
exists: function(key) {
return window.localStorage[key] !== void 0;
},
delete: function(key) {
window.localStorage.removeItem(key);
}
......
......@@ -42,13 +42,14 @@ function (angular, config, _, $, store) {
}
$scope.onAppEvent('logged-out', function() {
$scope.showProSideMenu = false;
$scope.grafana.sidemenu = false;
$scope.grafana.user = {};
});
$scope.onAppEvent('logged-in', function(evt, user) {
$scope.grafana.sidemenu = store.getBool('grafana.sidemenu');
$scope.grafana.sidemenu = store.getBool('grafana.sidemenu', true);
$scope.grafana.user = user;
store.set('grafana.sidemenu', $scope.grafana.sidemenu);
});
};
......@@ -56,7 +57,7 @@ function (angular, config, _, $, store) {
$controller('DashboardCtrl', { $scope: viewScope }).init(dashboardData);
};
$scope.toggleProSideMenu = function() {
$scope.toggleSideMenu = function() {
$scope.grafana.sidemenu = !$scope.grafana.sidemenu;
store.set('grafana.sidemenu', $scope.grafana.sidemenu);
};
......
......@@ -2,7 +2,7 @@
<div class="navbar-inner">
<div class="container-fluid">
<span class="brand">
<a ng-click="toggleProSideMenu()">
<a ng-click="toggleSideMenu()">
<img class="logo-icon" src="img/fav32.png" bs-tooltip="'Grafana'" data-placement="bottom"></img>
</a>
<span class="page-title">{{dashboard.title}}</span>
......
......@@ -2,7 +2,7 @@
<div class="navbar-inner">
<div class="container-fluid">
<span class="brand">
<a ng-click="toggleProSideMenu()">
<a ng-click="toggleSideMenu()">
<img class="logo-icon" src="img/fav32.png" bs-tooltip="'Grafana'" data-placement="bottom"></img>
</a>
<span class="page-title">{{pageTitle}}</span>
......
......@@ -4,7 +4,7 @@
<div class="login-box">
<div class="login-box-logo">
<img src="/img/logo_transparent_200x75.png">
<img src="img/logo_transparent_200x75.png">
</div>
<div class="text-center" style="margin-bottom: 50px">
......
......@@ -8,7 +8,7 @@
<li><a href="/login?logout">Logout</a></li>
</ul>
</div>
<a class="pro-sidemenu-link" ng-href="{{appSubUrl}}">
<a class="pro-sidemenu-link" ng-href="{{appSubUrl}}/">
<i class="icon-th-large"></i>
Dashboards
</a>
......
......@@ -39,7 +39,6 @@ function (angular, store) {
var db = datasourceSrv.getGrafanaDB();
var isTemp = window.location.href.indexOf('dashboard/temp') !== -1;
console.log('default route');
if (!$routeParams.id) {
var savedRoute = store.get('grafanaDashboardDefault');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment