mirror of https://github.com/nicolargo/glances
Merge pull request #1759 from nicolargo/webui-sort-by-disk-io
[WebUI] Fix sort by disk iopull/1762/head
commit
26f191a208
|
@ -10,7 +10,7 @@ export default function GlancesPluginProcessController(ARGUMENTS, hotkeys) {
|
||||||
return !(column === 'username' || column === 'name');
|
return !(column === 'username' || column === 'name');
|
||||||
},
|
},
|
||||||
getColumnLabel: function (column) {
|
getColumnLabel: function (column) {
|
||||||
if (_.isEqual(column, ['io_read', 'io_write'])) {
|
if (column === 'io_read' || column === 'io_write') {
|
||||||
return 'io_counters';
|
return 'io_counters';
|
||||||
} else {
|
} else {
|
||||||
return column;
|
return column;
|
||||||
|
|
|
@ -49,23 +49,14 @@ export default function GlancesPluginProcesslistController($scope, GlancesStats,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
process.ioRead = null;
|
process.io_read = null;
|
||||||
process.ioWrite = null;
|
process.io_write = null;
|
||||||
|
|
||||||
if (process.io_counters) {
|
if (process.io_counters) {
|
||||||
vm.ioReadWritePresent = true;
|
vm.ioReadWritePresent = true;
|
||||||
|
|
||||||
process.ioRead = (process.io_counters[0] - process.io_counters[2]) / process.time_since_update;
|
process.io_read = (process.io_counters[0] - process.io_counters[2]) / process.time_since_update;
|
||||||
|
process.io_write = (process.io_counters[1] - process.io_counters[3]) / process.time_since_update;
|
||||||
if (process.ioRead != 0) {
|
|
||||||
process.ioRead = $filter('bytes')(process.ioRead);
|
|
||||||
}
|
|
||||||
|
|
||||||
process.ioWrite = (process.io_counters[1] - process.io_counters[3]) / process.time_since_update;
|
|
||||||
|
|
||||||
if (process.ioWrite != 0) {
|
|
||||||
process.ioWrite = $filter('bytes')(process.ioWrite);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
process.isNice = process.nice !== undefined && ((data.stats.isWindows && process.nice != 32) || (!data.stats.isWindows && process.nice != 0));
|
process.isNice = process.nice !== undefined && ((data.stats.isWindows && process.nice != 32) || (!data.stats.isWindows && process.nice != 0));
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
<div class="table-cell text-left hidden-xs hidden-sm">{{ process.num_threads == -1 ? '?' : process.num_threads }}</div>
|
<div class="table-cell text-left hidden-xs hidden-sm">{{ process.num_threads == -1 ? '?' : process.num_threads }}</div>
|
||||||
<div class="table-cell" ng-class="{nice: process.isNice}">{{process.nice | exclamation}}</div>
|
<div class="table-cell" ng-class="{nice: process.isNice}">{{process.nice | exclamation}}</div>
|
||||||
<div class="table-cell" ng-class="{status: process.status == 'R'}">{{process.status}}</div>
|
<div class="table-cell" ng-class="{status: process.status == 'R'}">{{process.status}}</div>
|
||||||
<div class="table-cell hidden-xs hidden-sm" ng-show="vm.ioReadWritePresent">{{process.ioRead}}</div>
|
<div class="table-cell hidden-xs hidden-sm" ng-show="vm.ioReadWritePresent">{{process.io_read | bytes}}</div>
|
||||||
<div class="table-cell text-left hidden-xs hidden-sm" ng-show="vm.ioReadWritePresent">{{process.ioWrite}}</div>
|
<div class="table-cell text-left hidden-xs hidden-sm" ng-show="vm.ioReadWritePresent">{{process.io_write | bytes}}</div>
|
||||||
<div class="table-cell text-left" ng-show="vm.arguments.process_short_name">{{process.name}}</div>
|
<div class="table-cell text-left" ng-show="vm.arguments.process_short_name">{{process.name}}</div>
|
||||||
<div class="table-cell text-left" ng-show="!vm.arguments.process_short_name">{{process.cmdline}}</div>
|
<div class="table-cell text-left" ng-show="!vm.arguments.process_short_name">{{process.cmdline}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -59285,7 +59285,7 @@ function GlancesPluginProcessController(ARGUMENTS, hotkeys) {
|
||||||
return !(column === 'username' || column === 'name');
|
return !(column === 'username' || column === 'name');
|
||||||
},
|
},
|
||||||
getColumnLabel: function (column) {
|
getColumnLabel: function (column) {
|
||||||
if (_.isEqual(column, ['io_read', 'io_write'])) {
|
if (column === 'io_read' || column === 'io_write') {
|
||||||
return 'io_counters';
|
return 'io_counters';
|
||||||
} else {
|
} else {
|
||||||
return column;
|
return column;
|
||||||
|
@ -59521,23 +59521,14 @@ function GlancesPluginProcesslistController($scope, GlancesStats, GlancesPluginH
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
process.ioRead = null;
|
process.io_read = null;
|
||||||
process.ioWrite = null;
|
process.io_write = null;
|
||||||
|
|
||||||
if (process.io_counters) {
|
if (process.io_counters) {
|
||||||
vm.ioReadWritePresent = true;
|
vm.ioReadWritePresent = true;
|
||||||
|
|
||||||
process.ioRead = (process.io_counters[0] - process.io_counters[2]) / process.time_since_update;
|
process.io_read = (process.io_counters[0] - process.io_counters[2]) / process.time_since_update;
|
||||||
|
process.io_write = (process.io_counters[1] - process.io_counters[3]) / process.time_since_update;
|
||||||
if (process.ioRead != 0) {
|
|
||||||
process.ioRead = $filter('bytes')(process.ioRead);
|
|
||||||
}
|
|
||||||
|
|
||||||
process.ioWrite = (process.io_counters[1] - process.io_counters[3]) / process.time_since_update;
|
|
||||||
|
|
||||||
if (process.ioWrite != 0) {
|
|
||||||
process.ioWrite = $filter('bytes')(process.ioWrite);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
process.isNice = process.nice !== undefined && ((data.stats.isWindows && process.nice != 32) || (!data.stats.isWindows && process.nice != 0));
|
process.isNice = process.nice !== undefined && ((data.stats.isWindows && process.nice != 32) || (!data.stats.isWindows && process.nice != 0));
|
||||||
|
@ -59577,7 +59568,7 @@ function GlancesPluginProcesslistController($scope, GlancesStats, GlancesPluginH
|
||||||
/***/ (function(module, exports) {
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
var path = '/Users/fbrutel/dev/glances/glances/outputs/static/js/components/plugin-processlist/view.html';
|
var path = '/Users/fbrutel/dev/glances/glances/outputs/static/js/components/plugin-processlist/view.html';
|
||||||
var html = "<section id=\"processlist-plugin\" class=\"plugin\">\n <div class=\"table\">\n <div class=\"table-row\">\n <div sortable-th sorter=\"vm.sorter\" column=\"cpu_percent\" class=\"table-cell\">CPU%</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"memory_percent\" class=\"table-cell\">MEM%</div>\n <div class=\"table-cell hidden-xs hidden-sm\">VIRT</div>\n <div class=\"table-cell hidden-xs hidden-sm\">RES</div>\n <div class=\"table-cell\">PID</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"username\" class=\"table-cell text-left\">USER</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"timemillis\" class=\"table-cell hidden-xs hidden-sm\">TIME+</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"num_threads\" class=\"table-cell text-left hidden-xs hidden-sm\">THR</div>\n <div class=\"table-cell\">NI</div>\n <div class=\"table-cell\">S</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"io_read\" class=\"table-cell hidden-xs hidden-sm\" ng-show=\"vm.ioReadWritePresent\">IOR/s</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"io_write\" class=\"table-cell text-left hidden-xs hidden-sm\" ng-show=\"vm.ioReadWritePresent\">IOW/s</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"name\" class=\"table-cell text-left\">Command</div>\n </div>\n <div class=\"table-row\"\n ng-repeat=\"process in vm.processes | orderBy:vm.sorter.column:vm.sorter.isReverseColumn(vm.sorter.column) | limitTo: vm.getLimit() track by process.pid\">\n <div class=\"table-cell\" ng-class=\"vm.getCpuPercentAlert(process)\">{{ process.cpu_percent == -1 ? '?' : (process.cpu_percent | number:1) }}</div>\n <div class=\"table-cell\" ng-class=\"vm.getMemoryPercentAlert(process)\">{{ process.memory_percent == -1 ? '?' : (process.memory_percent | number:1) }}</div>\n <div class=\"table-cell hidden-xs hidden-sm\">{{process.memvirt | bytes}}</div>\n <div class=\"table-cell hidden-xs hidden-sm\">{{process.memres | bytes}}</div>\n <div class=\"table-cell\">{{process.pid}}</div>\n <div class=\"table-cell text-left\">{{process.username}}</div>\n <div class=\"table-cell hidden-xs hidden-sm\" ng-if=\"process.timeplus != '?'\">\n <span ng-show=\"process.timeplus.hours > 0\" class=\"highlight\">{{ process.timeplus.hours }}h</span>{{\n process.timeplus.minutes | leftPad:2:'0' }}:{{ process.timeplus.seconds | leftPad:2:'0' }}<span\n ng-show=\"process.timeplus.hours <= 0\">.{{ process.timeplus.milliseconds | leftPad:2:'0' }}</span>\n </div>\n <div class=\"table-cell hidden-xs hidden-sm\" ng-if=\"process.timeplus == '?'\">?</div>\n <div class=\"table-cell text-left hidden-xs hidden-sm\">{{ process.num_threads == -1 ? '?' : process.num_threads }}</div>\n <div class=\"table-cell\" ng-class=\"{nice: process.isNice}\">{{process.nice | exclamation}}</div>\n <div class=\"table-cell\" ng-class=\"{status: process.status == 'R'}\">{{process.status}}</div>\n <div class=\"table-cell hidden-xs hidden-sm\" ng-show=\"vm.ioReadWritePresent\">{{process.ioRead}}</div>\n <div class=\"table-cell text-left hidden-xs hidden-sm\" ng-show=\"vm.ioReadWritePresent\">{{process.ioWrite}}</div>\n <div class=\"table-cell text-left\" ng-show=\"vm.arguments.process_short_name\">{{process.name}}</div>\n <div class=\"table-cell text-left\" ng-show=\"!vm.arguments.process_short_name\">{{process.cmdline}}</div>\n </div>\n </div>\n</section>\n";
|
var html = "<section id=\"processlist-plugin\" class=\"plugin\">\n <div class=\"table\">\n <div class=\"table-row\">\n <div sortable-th sorter=\"vm.sorter\" column=\"cpu_percent\" class=\"table-cell\">CPU%</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"memory_percent\" class=\"table-cell\">MEM%</div>\n <div class=\"table-cell hidden-xs hidden-sm\">VIRT</div>\n <div class=\"table-cell hidden-xs hidden-sm\">RES</div>\n <div class=\"table-cell\">PID</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"username\" class=\"table-cell text-left\">USER</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"timemillis\" class=\"table-cell hidden-xs hidden-sm\">TIME+</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"num_threads\" class=\"table-cell text-left hidden-xs hidden-sm\">THR</div>\n <div class=\"table-cell\">NI</div>\n <div class=\"table-cell\">S</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"io_read\" class=\"table-cell hidden-xs hidden-sm\" ng-show=\"vm.ioReadWritePresent\">IOR/s</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"io_write\" class=\"table-cell text-left hidden-xs hidden-sm\" ng-show=\"vm.ioReadWritePresent\">IOW/s</div>\n <div sortable-th sorter=\"vm.sorter\" column=\"name\" class=\"table-cell text-left\">Command</div>\n </div>\n <div class=\"table-row\"\n ng-repeat=\"process in vm.processes | orderBy:vm.sorter.column:vm.sorter.isReverseColumn(vm.sorter.column) | limitTo: vm.getLimit() track by process.pid\">\n <div class=\"table-cell\" ng-class=\"vm.getCpuPercentAlert(process)\">{{ process.cpu_percent == -1 ? '?' : (process.cpu_percent | number:1) }}</div>\n <div class=\"table-cell\" ng-class=\"vm.getMemoryPercentAlert(process)\">{{ process.memory_percent == -1 ? '?' : (process.memory_percent | number:1) }}</div>\n <div class=\"table-cell hidden-xs hidden-sm\">{{process.memvirt | bytes}}</div>\n <div class=\"table-cell hidden-xs hidden-sm\">{{process.memres | bytes}}</div>\n <div class=\"table-cell\">{{process.pid}}</div>\n <div class=\"table-cell text-left\">{{process.username}}</div>\n <div class=\"table-cell hidden-xs hidden-sm\" ng-if=\"process.timeplus != '?'\">\n <span ng-show=\"process.timeplus.hours > 0\" class=\"highlight\">{{ process.timeplus.hours }}h</span>{{\n process.timeplus.minutes | leftPad:2:'0' }}:{{ process.timeplus.seconds | leftPad:2:'0' }}<span\n ng-show=\"process.timeplus.hours <= 0\">.{{ process.timeplus.milliseconds | leftPad:2:'0' }}</span>\n </div>\n <div class=\"table-cell hidden-xs hidden-sm\" ng-if=\"process.timeplus == '?'\">?</div>\n <div class=\"table-cell text-left hidden-xs hidden-sm\">{{ process.num_threads == -1 ? '?' : process.num_threads }}</div>\n <div class=\"table-cell\" ng-class=\"{nice: process.isNice}\">{{process.nice | exclamation}}</div>\n <div class=\"table-cell\" ng-class=\"{status: process.status == 'R'}\">{{process.status}}</div>\n <div class=\"table-cell hidden-xs hidden-sm\" ng-show=\"vm.ioReadWritePresent\">{{process.io_read | bytes}}</div>\n <div class=\"table-cell text-left hidden-xs hidden-sm\" ng-show=\"vm.ioReadWritePresent\">{{process.io_write | bytes}}</div>\n <div class=\"table-cell text-left\" ng-show=\"vm.arguments.process_short_name\">{{process.name}}</div>\n <div class=\"table-cell text-left\" ng-show=\"!vm.arguments.process_short_name\">{{process.cmdline}}</div>\n </div>\n </div>\n</section>\n";
|
||||||
window.angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
|
window.angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
|
||||||
module.exports = path;
|
module.exports = path;
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue