Correct bugs
This commit is contained in:
parent
b6d7d2c30e
commit
fa5a48bc3a
4 changed files with 17 additions and 24 deletions
|
@ -16,10 +16,11 @@ mainApp.controller('loginCtrl', ['$scope','$sce','Identity', function ($scope,$s
|
||||||
|
|
||||||
// Manager logout event
|
// Manager logout event
|
||||||
$scope.$on('logoutEvent', function(){
|
$scope.$on('logoutEvent', function(){
|
||||||
Identity.logout();
|
|
||||||
$('#loginModal').modal({backdrop: 'static', keyboard: false});
|
$('#loginModal').modal({backdrop: 'static', keyboard: false});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Hide loading button and message alert
|
// Hide loading button and message alert
|
||||||
$('#loadingLoginButton').hide();
|
$('#loadingLoginButton').hide();
|
||||||
$('#failedToLoginAlert').hide();
|
$('#failedToLoginAlert').hide();
|
||||||
|
|
|
@ -11,10 +11,10 @@ mainApp.controller('statusCtrl', ['$scope','Identity', '$rootScope', function ($
|
||||||
|
|
||||||
// Give profile to model
|
// Give profile to model
|
||||||
$scope.profile=Identity.getProfile();
|
$scope.profile=Identity.getProfile();
|
||||||
|
|
||||||
// Function to logout
|
// Function to logout
|
||||||
$scope.raiseLogoutEvent=function(){
|
$scope.logout=function(){
|
||||||
$rootScope.$broadcast('logoutEvent');
|
Identity.logout();
|
||||||
};
|
};
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){
|
mainApp.factory('Identity',[ '$http', '$cookies', '$rootScope', function($http, $cookies, $rootScope){
|
||||||
|
|
||||||
/* Create profile structure to store informations
|
/* Create profile structure to store informations
|
||||||
* about current session
|
* about current session
|
||||||
|
@ -51,6 +51,9 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){
|
||||||
token=null;
|
token=null;
|
||||||
profile.username=null;
|
profile.username=null;
|
||||||
profile.projectname=null;
|
profile.projectname=null;
|
||||||
|
|
||||||
|
// Reload Page
|
||||||
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,6 +98,7 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){
|
||||||
else{
|
else{
|
||||||
requestParserResult.failReason="Please check your username, password and project name !";
|
requestParserResult.failReason="Please check your username, password and project name !";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return requestParserResult;
|
return requestParserResult;
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="#"><b>Status</b></a>
|
<a class="navbar-brand"><b>Status</b></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="navbar-"></div>
|
<div class="navbar-"></div>
|
||||||
|
@ -18,24 +18,12 @@
|
||||||
|
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="nav-divider"></li>
|
<li class="nav-divider"></li>
|
||||||
<li><a href="#">User : {{ profile.username }}</a></li>
|
<li><a>User : {{ profile.username }}</a></li>
|
||||||
<li><a href="#">Project Name : {{ profile.projectname }}</a></li>
|
<li><a>Project Name : {{ profile.projectname }}</a></li>
|
||||||
|
</ul>
|
||||||
<!--<li><a href="#" >Connection : <span ng-bind-html="connection"></span></a></li>-->
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
<li class="dropdown">
|
<li><a ng-click="logout()">Logout</a></li>
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Account<span class="caret"></span></a>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<li><a href="#">Informations</a></li>
|
|
||||||
<li><a href="#">Settings</a></li>
|
|
||||||
<li role="separator" class="divider"></li>
|
|
||||||
<li><a href="#" ng-click="raiseLogoutEvent()">Logout</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div><!-- /.navbar-collapse -->
|
</div>
|
||||||
</div><!-- /.container-fluid -->
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
Loading…
Add table
Reference in a new issue