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
|
||||
$scope.$on('logoutEvent', function(){
|
||||
Identity.logout();
|
||||
$('#loginModal').modal({backdrop: 'static', keyboard: false});
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Hide loading button and message alert
|
||||
$('#loadingLoginButton').hide();
|
||||
$('#failedToLoginAlert').hide();
|
||||
|
|
|
@ -13,8 +13,8 @@ mainApp.controller('statusCtrl', ['$scope','Identity', '$rootScope', function ($
|
|||
$scope.profile=Identity.getProfile();
|
||||
|
||||
// Function to logout
|
||||
$scope.raiseLogoutEvent=function(){
|
||||
$rootScope.$broadcast('logoutEvent');
|
||||
$scope.logout=function(){
|
||||
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
|
||||
* about current session
|
||||
|
@ -51,6 +51,9 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){
|
|||
token=null;
|
||||
profile.username=null;
|
||||
profile.projectname=null;
|
||||
|
||||
// Reload Page
|
||||
location.reload();
|
||||
}
|
||||
|
||||
|
||||
|
@ -96,6 +99,7 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){
|
|||
requestParserResult.failReason="Please check your username, password and project name !";
|
||||
}
|
||||
|
||||
|
||||
return requestParserResult;
|
||||
};
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#"><b>Status</b></a>
|
||||
<a class="navbar-brand"><b>Status</b></a>
|
||||
</div>
|
||||
|
||||
<div class="navbar-"></div>
|
||||
|
@ -18,24 +18,12 @@
|
|||
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-divider"></li>
|
||||
<li><a href="#">User : {{ profile.username }}</a></li>
|
||||
<li><a href="#">Project Name : {{ profile.projectname }}</a></li>
|
||||
|
||||
<!--<li><a href="#" >Connection : <span ng-bind-html="connection"></span></a></li>-->
|
||||
|
||||
<li><a>User : {{ profile.username }}</a></li>
|
||||
<li><a>Project Name : {{ profile.projectname }}</a></li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="dropdown">
|
||||
<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>
|
||||
<li><a ng-click="logout()">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div><!-- /.navbar-collapse -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
Loading…
Add table
Reference in a new issue