diff options
Diffstat (limited to 'client/js')
| -rw-r--r-- | client/js/app.js | 6 | ||||
| -rw-r--r-- | client/js/controllers/home/main.js (renamed from client/js/controllers/home.js) | 3 | ||||
| -rw-r--r-- | client/js/controllers/login.js | 39 | ||||
| -rw-r--r-- | client/js/controllers/network/main.js (renamed from client/js/controllers/network.js) | 1 | ||||
| -rw-r--r-- | client/js/controllers/status.js | 24 | ||||
| -rw-r--r-- | client/js/directives/empty | 0 | ||||
| -rw-r--r-- | client/js/filters/empty | 0 | ||||
| -rw-r--r-- | client/js/requests/identity.js | 42 | ||||
| -rw-r--r-- | client/js/services/empty | 0 |
9 files changed, 106 insertions, 9 deletions
diff --git a/client/js/app.js b/client/js/app.js index 7fedb32..0e9c423 100644 --- a/client/js/app.js +++ b/client/js/app.js @@ -1,16 +1,16 @@ // Declare main app -var mainApp=angular.module("mainApp",['ngRoute']); +var mainApp=angular.module("mainApp",['ngRoute', 'ngSanitize']); mainApp.config(['$routeProvider', function($routeProvider){ $routeProvider. when('/home',{ - templateUrl: 'partials/home.html', + templateUrl: 'partials/home/main.html', controller: 'homeCtrl' }). when('/network',{ - templateUrl: 'partials/network.html', + templateUrl: 'partials/network/main.html', controller: 'networkCtrl' }).otherwise({ redirectTo: '/home' diff --git a/client/js/controllers/home.js b/client/js/controllers/home/main.js index d4e1b0e..2898de2 100644 --- a/client/js/controllers/home.js +++ b/client/js/controllers/home/main.js @@ -6,5 +6,6 @@ mainApp.controller('homeCtrl', function ($scope) { - $scope.test="Home view"; + + });
\ No newline at end of file diff --git a/client/js/controllers/login.js b/client/js/controllers/login.js new file mode 100644 index 0000000..2f74414 --- /dev/null +++ b/client/js/controllers/login.js @@ -0,0 +1,39 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +/** + * Represents a book. + * @constructor + */ +mainApp.controller('loginCtrl', function ($scope,$interval,$sce) +{ + // Define default states + $('#loginModal').modal({backdrop: 'static', keyboard: false}); + $('#loadingLoginButton').hide(); + $('#failedToLoginAlert').hide(); + + + $('#loginButton').click(function(){ + $('#loginButton').hide(); + $('#loadingLoginButton').show(); + $('#failedToLoginAlert').hide(); + + + + $interval( + function() + { + $('#failedToLoginAlert').show(); + + $('#loginButton').show(); + $('#loadingLoginButton').hide(); + + }, 2000,1); + + + + }); +}) diff --git a/client/js/controllers/network.js b/client/js/controllers/network/main.js index c2a9794..6c916ae 100644 --- a/client/js/controllers/network.js +++ b/client/js/controllers/network/main.js @@ -6,5 +6,4 @@ mainApp.controller('networkCtrl', function ($scope) { - $scope.test="Network View"; });
\ No newline at end of file diff --git a/client/js/controllers/status.js b/client/js/controllers/status.js index 3534912..42a54d4 100644 --- a/client/js/controllers/status.js +++ b/client/js/controllers/status.js @@ -4,9 +4,25 @@ -mainApp.controller('statusCtrl', function ($scope) +mainApp.controller('statusCtrl', function ($scope,$interval,$sce) { - $scope.username="User 1"; - $scope.connection="Online"; - $scope.lastconnection="1 Septembre"; + $scope.username="John Doe"; + $scope.projectname="Web Server"; + // Update status every 2 seconds + /*$interval(function(){ + var status=identity.fetchStatus(); + $scope.username=status[1]; + $scope.lastconnection=status[2]; + if(status[0] == "1"){ + $scope.connection=$sce.trustAsHtml("<span style=\"color:green;\">Online</span>"); + } + else{ + $scope.connection=$sce.trustAsHtml("<span style=\"color:red;\">Offline</span>"); + } + }, 2000);*/ + + + + + });
\ No newline at end of file diff --git a/client/js/directives/empty b/client/js/directives/empty deleted file mode 100644 index e69de29..0000000 --- a/client/js/directives/empty +++ /dev/null diff --git a/client/js/filters/empty b/client/js/filters/empty deleted file mode 100644 index e69de29..0000000 --- a/client/js/filters/empty +++ /dev/null diff --git a/client/js/requests/identity.js b/client/js/requests/identity.js new file mode 100644 index 0000000..cad1261 --- /dev/null +++ b/client/js/requests/identity.js @@ -0,0 +1,42 @@ + +// Make Namespace +var identity = {} ; + + + + + + +/* +mainApp.controller('identityCtrl', function($scope, $http) { + + $scope.identityFormData = {}; + + $scope.processForm = function() { + + $http({ + method : 'POST', + url : 'http://148.60.11.31/', + data : $.param($scope.identityFormData), + headers : { 'Content-Type': 'application/x-www-form-urlencoded' } + }) + .success(function(data) { + console.log(data); + + if (!data.success) { + // if not successful, bind errors to error variables + //$scope.errorName = data.errors.name; + //$scope.errorSuperhero = data.errors.superheroAlias; + } else { + // if successful, bind success message to message + //$scope.message = data.message; + } + }); + }; + + + +});*/ + + + diff --git a/client/js/services/empty b/client/js/services/empty deleted file mode 100644 index e69de29..0000000 --- a/client/js/services/empty +++ /dev/null |
