mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'v3.1.x'
This commit is contained in:
commit
60abe75615
@ -45,7 +45,7 @@
|
||||
</li>
|
||||
|
||||
<li ng-show="::!ctrl.isSignedIn">
|
||||
<a href="login" class="sidemenu-item" target="_self">
|
||||
<a href="{{ctrl.loginUrl}}" class="sidemenu-item">
|
||||
<span class="icon-circle sidemenu-icon"><i class="fa fa-fw fa-sign-in"></i></span>
|
||||
<span class="sidemenu-item-text">Sign in</span>
|
||||
</a>
|
||||
|
@ -12,6 +12,7 @@ export class SideMenuCtrl {
|
||||
mainLinks: any;
|
||||
orgMenu: any;
|
||||
appSubUrl: string;
|
||||
loginUrl: string;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private $scope, private $location, private contextSrv, private backendSrv, private $element) {
|
||||
@ -22,13 +23,14 @@ export class SideMenuCtrl {
|
||||
|
||||
this.mainLinks = config.bootData.mainNavLinks;
|
||||
this.openUserDropdown();
|
||||
this.loginUrl = '/login?redirect=' + encodeURIComponent(this.$location.path());
|
||||
|
||||
this.$scope.$on('$routeChangeSuccess', () => {
|
||||
if (!this.contextSrv.pinned) {
|
||||
this.contextSrv.sidemenu = false;
|
||||
}
|
||||
this.loginUrl = '/login?redirect=' + encodeURIComponent(this.$location.path());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
getUrl(url) {
|
||||
|
@ -70,7 +70,12 @@ function (angular, coreModule, config) {
|
||||
}
|
||||
|
||||
backendSrv.post('/login', $scope.formModel).then(function(result) {
|
||||
if (result.redirectUrl) {
|
||||
var params = $location.search();
|
||||
|
||||
if (params.redirect && params.redirect[0] === '/') {
|
||||
window.location.href = config.appSubUrl + params.redirect;
|
||||
}
|
||||
else if (result.redirectUrl) {
|
||||
window.location.href = result.redirectUrl;
|
||||
} else {
|
||||
window.location.href = config.appSubUrl + '/';
|
||||
|
Loading…
Reference in New Issue
Block a user