summaryrefslogtreecommitdiffstats
path: root/app/login/controllers/login-controller.js
diff options
context:
space:
mode:
authorAndrew Geissler <geissonator@yahoo.com>2018-05-24 11:07:27 -0700
committerAndrew Geissler <geissonator@yahoo.com>2018-05-24 11:07:27 -0700
commitd27bb135f1561b87a174d1b9890dde2f3cf01c80 (patch)
treefee09cde2808a2319d33f65092bebecb9651dd78 /app/login/controllers/login-controller.js
parentba5e3f3484c0de46f4f5fc5baf5804648179a9eb (diff)
downloadphosphor-webui-d27bb135f1561b87a174d1b9890dde2f3cf01c80.tar.gz
phosphor-webui-d27bb135f1561b87a174d1b9890dde2f3cf01c80.zip
Format code using clang-format-5.0
Once merged, this repository will have CI enforce the coding guidelines in the .clang-format file. Change-Id: I96a05972665f9c67625c6850c3da25edc540be06 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'app/login/controllers/login-controller.js')
-rw-r--r--app/login/controllers/login-controller.js75
1 files changed, 32 insertions, 43 deletions
diff --git a/app/login/controllers/login-controller.js b/app/login/controllers/login-controller.js
index 03bbc15..be79bb6 100644
--- a/app/login/controllers/login-controller.js
+++ b/app/login/controllers/login-controller.js
@@ -9,51 +9,40 @@
window.angular && (function(angular) {
'use strict';
- angular
- .module('app.login')
- .controller('LoginController', [
- '$scope',
- '$window',
- 'APIUtils',
- 'dataService',
- 'userModel',
- '$routeParams',
- function($scope, $window, APIUtils, dataService, userModel, $routeParams) {
- $scope.dataService = dataService;
- $scope.host = $scope.dataService.host.replace(/^https?\:\/\//ig, '');
+ angular.module('app.login').controller('LoginController', [
+ '$scope', '$window', 'APIUtils', 'dataService', 'userModel', '$routeParams',
+ function($scope, $window, APIUtils, dataService, userModel, $routeParams) {
+ $scope.dataService = dataService;
+ $scope.host = $scope.dataService.host.replace(/^https?\:\/\//ig, '');
- $scope.tryLogin = function(host, username, password, event) {
- if (event.keyCode === 13) {
- $scope.login(host, username, password);
- }
- };
- $scope.login = function(host, username, password) {
- $scope.error = false;
- $scope.description = false;
+ $scope.tryLogin = function(host, username, password, event) {
+ if (event.keyCode === 13) {
+ $scope.login(host, username, password);
+ }
+ };
+ $scope.login = function(host, username, password) {
+ $scope.error = false;
+ $scope.description = false;
- if (!username || username == '' ||
- !password || password == '' ||
- !host || host == ''
- ) {
- return false;
- }
- else {
- $scope.dataService.setHost(host);
- userModel.login(username, password, function(status, description) {
- if (status) {
- $scope.$emit('user-logged-in', {});
- $window.location.hash = '#/overview/server';
+ if (!username || username == '' || !password || password == '' ||
+ !host || host == '') {
+ return false;
+ } else {
+ $scope.dataService.setHost(host);
+ userModel.login(username, password, function(status, description) {
+ if (status) {
+ $scope.$emit('user-logged-in', {});
+ $window.location.hash = '#/overview/server';
+ } else {
+ $scope.error = true;
+ if (description) {
+ $scope.description = description;
}
- else {
- $scope.error = true;
- if (description) {
- $scope.description = description;
- }
- }
- });
- }
- };
- }
- ]);
+ }
+ });
+ }
+ };
+ }
+ ]);
})(angular);
OpenPOWER on IntegriCloud