Server health icon status on header fixed

Change-Id: I06100d8ffe9e26129585ca9476fa7097ef34a6b4
Signed-off-by: Iftekharul Islam <iffy.ryan@ibm.com>
diff --git a/app/common/directives/app-header.js b/app/common/directives/app-header.js
index 6a9493b..cb4704e 100644
--- a/app/common/directives/app-header.js
+++ b/app/common/directives/app-header.js
@@ -13,6 +13,12 @@
                 'controller': ['$rootScope', '$scope','dataService', 'userModel', '$location', function($rootScope, $scope, dataService, userModel, $location){
                     $scope.dataService = dataService;
 
+                    $scope.loadServerHealth = function(){
+                        APIUtils.getLogs().then(function(result){
+                            dataService.updateServerHealth(result.data);
+                        });
+                    }
+
                     $scope.loadServerStatus = function(){
                         if(!userModel.isLoggedIn()){
                             return;
@@ -37,8 +43,13 @@
                         });
                     }
 
-                    $scope.loadServerStatus();
-                    $scope.loadNetworkInfo();
+                    function loadData(){
+                       $scope.loadServerStatus();
+                       $scope.loadNetworkInfo();
+                       $scope.loadServerHealth();
+                    }
+
+                    loadData();
 
                     $scope.logout = function(){
                         userModel.logout(function(status, error){
@@ -51,8 +62,7 @@
                     }
 
                     $scope.refresh = function(){
-                        $scope.loadServerStatus();
-                        $scope.loadNetworkInfo();
+                        loadData();
 
                         //Add flash class to header timestamp on click of refresh
                         var myEl = angular.element( document.querySelector( '.header__refresh' ) );
@@ -64,8 +74,7 @@
                     }
 
                     var loginListener = $rootScope.$on('user-logged-in', function(event, arg){
-                        $scope.loadServerStatus();
-                        $scope.loadNetworkInfo();
+                        loadData();
                     });
 
                     $scope.$on('$destroy', function(){