提交 43b5cc60 编写于 作者: A Alessio Sergi

Merge pull request #583 from notFloran/fix-nice-web-ui

[Web UI] Highlight nice values
......@@ -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>
......
<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>
......@@ -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++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册