diff options
| author | root <root@kabir-PC> | 2016-02-23 20:34:59 +0100 |
|---|---|---|
| committer | root <root@kabir-PC> | 2016-02-23 20:34:59 +0100 |
| commit | d2f5ae5c83ef5bc41cf430ace79769459b4acbf8 (patch) | |
| tree | b48882db52687bdd64a398c7d1844d05dbc01343 /client/js/controllers/status.js | |
| parent | 1eff9ee90bf26127463cae0ae2cb2e1951527591 (diff) | |
| parent | ff1832adcfe10fadb6cbf738c874611f77f6dd43 (diff) | |
Merge branch 'develop' of https://github.com/manzerbredes/istic-openstack into othmane
Diffstat (limited to 'client/js/controllers/status.js')
| -rw-r--r-- | client/js/controllers/status.js | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/client/js/controllers/status.js b/client/js/controllers/status.js index 42a54d4..e01df34 100644 --- a/client/js/controllers/status.js +++ b/client/js/controllers/status.js @@ -1,28 +1,22 @@ -/* - * mainApp Controller - */ - -mainApp.controller('statusCtrl', function ($scope,$interval,$sce) +/** + * The status controller + * + * @param {$scope} $scope The $scope service from angular + * @param {Identity} The Identity service + */ +mainApp.controller('statusCtrl', ['$scope','Identity', '$rootScope', function ($scope, Identity, $rootScope) { - $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);*/ + // Give profile to model + $scope.profile=Identity.profile; + + // Function to logout + $scope.logout=function(){ + Identity.logout(); + $rootScope.$broadcast('logoutEvent'); + }; - - -});
\ No newline at end of file +}]); |
