Fix "Nice: nice values != 0 (Unix-like) and != 32 (Windows) should be highlighted"

This commit is contained in:
Floran Brutel 2015-05-08 11:34:08 +02:00
parent 5d8b177c4f
commit de0dc0c25c
3 changed files with 17 additions and 3 deletions

View File

@ -20,7 +20,7 @@
<div class="table-cell hidden-xs hidden-sm">{{process.memres | bytes}}</div>
<div class="table-cell">{{process.pid}}</div>
<div class="table-cell text-left">{{process.username}}</div>
<div class="table-cell">{{process.nice | exclamation}}</div>
<div class="table-cell" ng-class="{nice: isNice(process.nice)}">{{process.nice | exclamation}}</div>
<div class="table-cell" ng-class="{status: process.status == 'R'}">{{process.status}}</div>
<div class="table-cell hidden-xs hidden-sm">{{process.timeformatted}}</div>
<div class="table-cell hidden-xs hidden-sm">{{process.io_read}}</div>

View File

@ -1,5 +1,5 @@
<span class="title">
{{ result["system"].hostname }}
</span>
<span ng-if="result['os_name'] == 'Linux'" class="hidden-xs hidden-sm">({{ result["system"].hr_name }} / {{ result["system"].os_name }} {{ result["system"].os_version }})</span>
<span ng-if="result['os_name'] != 'Linux'" class="hidden-xs hidden-sm">({{ result["system"].os_name }} {{ result["system"].os_version }} {{ result["system"].platform }})</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

@ -149,6 +149,12 @@ glancesApp.controller('statsController', function($scope, $http, $interval, $q,
alert.duration = durationBetweenTwoDates(alert.begin, alert.end);
}
}
$scope.is_bsd = response['system'].os_name === 'FreeBSD';
$scope.is_linux = response['system'].os_name === 'Linux';
$scope.is_mac = response['system'].os_name === 'Darwin';
$scope.is_windows = response['system'].os_name === 'Windows';
$scope.result = response;
canceler.resolve()
}).error(function(d, status, headers, config) {
@ -157,6 +163,14 @@ glancesApp.controller('statsController', function($scope, $http, $interval, $q,
});
}
$scope.isNice = function(nice) {
if(nice !== undefined && (($scope.is_windows && nice != 32) || (!$scope.is_windows && nice != 0))) {
return true;
}
return false;
}
$scope.getClass = function(pluginName, limitNamePrefix, value, num) {
if ($scope.pluginLimits != undefined && $scope.pluginLimits[pluginName] != undefined) {
for (var i = 0; i < $scope.limitSuffix.length; i++) {