mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'master' into dashlinks
This commit is contained in:
commit
ece9e8dcea
@ -14,7 +14,7 @@ function (angular, config) {
|
|||||||
password: '',
|
password: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
contextSrv.setSideMenuState(false);
|
contextSrv.sidemenu = false;
|
||||||
|
|
||||||
$scope.googleAuthEnabled = config.googleAuthEnabled;
|
$scope.googleAuthEnabled = config.googleAuthEnabled;
|
||||||
$scope.githubAuthEnabled = config.githubAuthEnabled;
|
$scope.githubAuthEnabled = config.githubAuthEnabled;
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<strong>User</strong>
|
<strong>User</strong>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<input type="text" name="username" class="tight-form-input last" required ng-model='formModel.user' placeholder="email or username" style="width: 255px">
|
<input type="text" name="username" class="tight-form-input last" required ng-model='formModel.user' placeholder="email or username" style="width: 253px">
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
<strong>Password</strong>
|
<strong>Password</strong>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<input type="password" name="password" class="tight-form-input last" required ng-model="formModel.password" id="inputPassword" style="width: 255px" placeholder="password">
|
<input type="password" name="password" class="tight-form-input last" required ng-model="formModel.password" id="inputPassword" style="width: 253px" placeholder="password">
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
@ -46,7 +46,7 @@
|
|||||||
<strong>Email</strong>
|
<strong>Email</strong>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<input type="email" class="tight-form-input last" required ng-model='formModel.email' placeholder="email" style="width: 255px">
|
<input type="email" class="tight-form-input last" required ng-model='formModel.email' placeholder="email" style="width: 253px">
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
@ -58,7 +58,7 @@
|
|||||||
<strong>Password</strong>
|
<strong>Password</strong>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<input type="password" class="tight-form-input last" watch-change="passwordChanged(inputValue)" ng-minlength="4" required ng-model='formModel.password' placeholder="password" style="width: 255px">
|
<input type="password" class="tight-form-input last" watch-change="passwordChanged(inputValue)" ng-minlength="4" required ng-model='formModel.password' placeholder="password" style="width: 253px">
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
@ -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() {
|
||||||
|
@ -40,12 +40,26 @@ function (angular, _, store, config) {
|
|||||||
}, 50);
|
}, 50);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.getSidemenuDefault = function() {
|
||||||
|
return this.hasRole('Admin');
|
||||||
|
};
|
||||||
|
|
||||||
this.version = config.buildInfo.version;
|
this.version = config.buildInfo.version;
|
||||||
this.lightTheme = false;
|
this.lightTheme = false;
|
||||||
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');
|
this.sidemenu = store.getBool('grafana.sidemenu', this.getSidemenuDefault());
|
||||||
|
|
||||||
|
if (this.isSignedIn && !store.exists('grafana.sidemenu')) {
|
||||||
|
// If the sidemenu 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');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user