Merge pull request #653 from nclsHart/disconnected

[Web UI] Warn user if the server is down/disconnected
This commit is contained in:
Nicolas Hennion 2015-08-21 11:18:32 +02:00
commit 01d1531d40
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,4 @@
<span ng-if="is_disconnected" class="critical">Disconnected from</span>
<span class="title">{{ result["system"].hostname }}</span>
<span ng-if="is_linux" class="hidden-xs hidden-sm">({{ result["system"].hr_name }} / {{ result["system"].os_name }} {{ result["system"].os_version }})</span>
<span ng-if="!is_linux" class="hidden-xs hidden-sm">({{ result["system"].os_name }} {{ result["system"].os_version }} {{ result["system"].platform }})</span>

View File

@ -150,10 +150,13 @@ glancesApp.controller('statsController', function($scope, $http, $interval, $q,
$scope.is_mac = response['system'].os_name === 'Darwin';
$scope.is_windows = response['system'].os_name === 'Windows';
$scope.is_disconnected = false;
$scope.result = response;
canceler.resolve()
}).error(function(d, status, headers, config) {
console.log('error status:' + status + " - headers = " + headers);
$scope.is_disconnected = true;
canceler.resolve()
});
}