diff options
author | Alessio Sergi <al3hex@gmail.com> | 2015-05-08 12:28:51 +0200 |
---|---|---|
committer | Alessio Sergi <al3hex@gmail.com> | 2015-05-08 12:28:51 +0200 |
commit | 43b5cc606db5cbb9cec045896ab6828d2ed3839f (patch) | |
tree | a405bf6a4511c6bec38b7e7d1f6f720f7090bb0e | |
parent | 5d8b177c4f855b99204d4879f82dfec1a55e629c (diff) | |
parent | de0dc0c25c73c8e09c5a8502eb0e019429b55261 (diff) |
Merge pull request #583 from notFloran/fix-nice-web-ui
[Web UI] Highlight nice values
-rw-r--r-- | glances/outputs/static/html/plugins/processlist.html | 2 | ||||
-rw-r--r-- | glances/outputs/static/html/plugins/system.html | 4 | ||||
-rw-r--r-- | glances/outputs/static/js/stats_controller.js | 14 |
3 files changed, 17 insertions, 3 deletions
diff --git a/glances/outputs/static/html/plugins/processlist.html b/glances/outputs/static/html/plugins/processlist.html index 03688839..6b1e7bb6 100644 --- a/glances/outputs/static/html/plugins/processlist.html +++ b/glances/outputs/static/html/plugins/processlist.html @@ -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> diff --git a/glances/outputs/static/html/plugins/system.html b/glances/outputs/static/html/plugins/system.html index 60c6b2cd..05fb7cea 100644 --- a/glances/outputs/static/html/plugins/system.html +++ b/glances/outputs/static/html/plugins/system.html @@ -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> diff --git a/glances/outputs/static/js/stats_controller.js b/glances/outputs/static/js/stats_controller.js index 5c774691..aacc0e2f 100644 --- a/glances/outputs/static/js/stats_controller.js +++ b/glances/outputs/static/js/stats_controller.js @@ -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++) { |