represent signing

This commit is contained in:
astroshim 2016-11-16 12:45:37 +09:00
parent 9bf56d9f64
commit 0a5e992040
2 changed files with 8 additions and 2 deletions

View file

@ -17,11 +17,13 @@
angular.module('zeppelinWebApp').controller('LoginCtrl', LoginCtrl);
LoginCtrl.$inject = ['$scope', '$rootScope', '$http', '$httpParamSerializer', 'baseUrlSrv'];
$scope.SigningIn = false;
function LoginCtrl($scope, $rootScope, $http, $httpParamSerializer, baseUrlSrv) {
$scope.loginParams = {};
$scope.login = function() {
$scope.SigningIn = true;
$http({
method: 'POST',
url: baseUrlSrv.getRestApiBase() + '/login',
@ -39,6 +41,7 @@
$rootScope.userName = $scope.loginParams.userName;
}, function errorCallback(errorResponse) {
$scope.loginParams.errorText = 'The username and password that you entered don\'t match.';
$scope.SigningIn = false;
});
};

View file

@ -41,8 +41,11 @@ limitations under the License.
</div>
</div>
<div class="modal-footer">
<div>
<div class="modal-footer" ng-switch on="SigningIn">
<div ng-switch-when="true">
<button type="button" class="btn btn-default btn-primary" disabled><i class="fa fa-circle-o-notch fa-spin"></i> Signing In</button>
</div>
<div ng-switch-default>
<button type="button" class="btn btn-default btn-primary" ng-click="login()">Login</button>
</div>
</div>