summaryrefslogtreecommitdiff
path: root/client/js/controllers/status.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/js/controllers/status.js')
-rw-r--r--client/js/controllers/status.js38
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
+}]);