From 3fa02041533d2b9485c27cd5f852e5f697ee8599 Mon Sep 17 00:00:00 2001 From: Floran Brutel Date: Sun, 4 Jun 2017 19:48:10 +0200 Subject: [PATCH] Apply previous fix "remove domain from username in processlist" --- .../js/components/plugin-process/view.html | 6 +- .../plugin-processlist/controller.js | 4 + glances/outputs/static/public/js/main.min.js | 88 ++++++++++--------- .../outputs/static/public/js/templates.min.js | 4 +- 4 files changed, 57 insertions(+), 45 deletions(-) diff --git a/glances/outputs/static/js/components/plugin-process/view.html b/glances/outputs/static/js/components/plugin-process/view.html index f5d82cc3..91da2311 100644 --- a/glances/outputs/static/js/components/plugin-process/view.html +++ b/glances/outputs/static/js/components/plugin-process/view.html @@ -1,6 +1,10 @@
- +
+
+ +
+
PROCESSES DISABLED (press 'z' to display)
diff --git a/glances/outputs/static/js/components/plugin-processlist/controller.js b/glances/outputs/static/js/components/plugin-processlist/controller.js index 262ca108..b6f79c93 100644 --- a/glances/outputs/static/js/components/plugin-processlist/controller.js +++ b/glances/outputs/static/js/components/plugin-processlist/controller.js @@ -46,6 +46,10 @@ function GlancesPluginProcesslistController($scope, GlancesPluginHelper, $filter process.cmdline = process.cmdline.join(' '); } + if (data.isWindows) { + process.username = _.last(process.username.split('\\')); + } + vm.processes.push(process); } }); diff --git a/glances/outputs/static/public/js/main.min.js b/glances/outputs/static/public/js/main.min.js index 475cc5b8..4a7e0f1e 100644 --- a/glances/outputs/static/public/js/main.min.js +++ b/glances/outputs/static/public/js/main.min.js @@ -1054,6 +1054,48 @@ function GlancesPluginNetworkController($scope, $filter, ARGUMENTS) { 'use strict'; +glancesApp.component('glancesPluginPercpu', { + controller: GlancesPluginPercpuController, + controllerAs: 'vm', + templateUrl: 'components/plugin-percpu/view.html' +}); + +'use strict'; + +function GlancesPluginPercpuController($scope, GlancesPluginHelper) { + var vm = this; + vm.cpus = []; + + $scope.$on('data_refreshed', function(event, data) { + var percpuStats = data.stats['percpu']; + + vm.cpus = []; + + for (var i = 0; i < percpuStats.length; i++) { + var cpuData = percpuStats[i]; + + vm.cpus.push({ + 'total': cpuData.total, + 'user': cpuData.user, + 'system': cpuData.system, + 'idle': cpuData.idle, + 'iowait': cpuData.iowait, + 'steal': cpuData.steal + }); + } + }); + + vm.getUserAlert = function(cpu) { + return GlancesPluginHelper.getAlert('percpu', 'percpu_user_', cpu.user) + }; + + vm.getSystemAlert = function(cpu) { + return GlancesPluginHelper.getAlert('percpu', 'percpu_system_', cpu.system); + }; +} + +'use strict'; + glancesApp.component('glancesPluginPorts', { controller: GlancesPluginPortsController, controllerAs: 'vm', @@ -1278,6 +1320,10 @@ function GlancesPluginProcesslistController($scope, GlancesPluginHelper, $filter process.cmdline = process.cmdline.join(' '); } + if (data.isWindows) { + process.username = _.last(process.username.split('\\')); + } + vm.processes.push(process); } }); @@ -1297,48 +1343,6 @@ function GlancesPluginProcesslistController($scope, GlancesPluginHelper, $filter 'use strict'; -glancesApp.component('glancesPluginPercpu', { - controller: GlancesPluginPercpuController, - controllerAs: 'vm', - templateUrl: 'components/plugin-percpu/view.html' -}); - -'use strict'; - -function GlancesPluginPercpuController($scope, GlancesPluginHelper) { - var vm = this; - vm.cpus = []; - - $scope.$on('data_refreshed', function(event, data) { - var percpuStats = data.stats['percpu']; - - vm.cpus = []; - - for (var i = 0; i < percpuStats.length; i++) { - var cpuData = percpuStats[i]; - - vm.cpus.push({ - 'total': cpuData.total, - 'user': cpuData.user, - 'system': cpuData.system, - 'idle': cpuData.idle, - 'iowait': cpuData.iowait, - 'steal': cpuData.steal - }); - } - }); - - vm.getUserAlert = function(cpu) { - return GlancesPluginHelper.getAlert('percpu', 'percpu_user_', cpu.user) - }; - - vm.getSystemAlert = function(cpu) { - return GlancesPluginHelper.getAlert('percpu', 'percpu_system_', cpu.system); - }; -} - -'use strict'; - glancesApp.component('glancesPluginQuicklook', { controller: GlancesPluginQuicklookController, controllerAs: 'vm', diff --git a/glances/outputs/static/public/js/templates.min.js b/glances/outputs/static/public/js/templates.min.js index 93b26139..ab382d4c 100644 --- a/glances/outputs/static/public/js/templates.min.js +++ b/glances/outputs/static/public/js/templates.min.js @@ -12,11 +12,11 @@ $templateCache.put('components/plugin-mem/view.html','
\n
\n
\n
active:
\n
{{ vm.active | bytes }}
\n
\n
\n
inactive:
\n
{{ vm.inactive | bytes }}
\n
\n
\n
buffers:
\n
{{ vm.buffers | bytes }}
\n
\n
\n
cached:
\n
{{ vm.cached | bytes }}
\n
\n
\n
\n'); $templateCache.put('components/plugin-memswap/view.html','
\n
\n
\n
SWAP
\n
{{ vm.percent }}%
\n
\n
\n
total:
\n
{{ vm.total | bytes }}
\n
\n
\n
used:
\n
\n {{ vm.used | bytes }}\n
\n
\n
\n
free:
\n
{{ vm.free | bytes }}
\n
\n
\n
\n'); $templateCache.put('components/plugin-network/view.html','
\n
NETWORK
\n
Rx/s
\n
Tx/s
\n\n
\n
Rx+Tx/s
\n\n
Rx
\n
Tx
\n\n
\n
Rx+Tx
\n
\n
\n
{{ network.interfaceName | min_size }}
\n
{{ vm.arguments.byte ? (network.rx / network.time_since_update | bytes) : (network.rx / network.time_since_update | bits) }}
\n
{{ vm.arguments.byte ? (network.tx / network.time_since_update | bytes) : (network.tx / network.time_since_update | bits) }}
\n\n
\n
{{ vm.arguments.byte ? (network.cx / network.time_since_update | bytes) : (network.cx / network.time_since_update | bits) }}
\n\n
{{ vm.arguments.byte ? (network.cumulativeRx | bytes) : (network.cumulativeRx | bits) }}
\n
{{ vm.arguments.byte ? (network.cumulativeTx | bytes) : (network.cumulativeTx | bits) }}
\n\n
\n
{{ vm.arguments.byte ? (network.cumulativeCx | bytes) : (network.cumulativeCx | bits) }}
\n
\n'); +$templateCache.put('components/plugin-percpu/view.html','
\n
\n
\n
PER CPU
\n
{{ percpu.total }}%
\n
\n
\n
user:
\n
\n {{ percpu.user }}%\n
\n
\n
\n
system:
\n
\n {{ percpu.system }}%\n
\n
\n
\n
idle:
\n
{{ percpu.idle }}%
\n
\n
\n
iowait:
\n
\n {{ percpu.iowait }}%\n
\n
\n
\n
steal:
\n
\n {{ percpu.steal }}%\n
\n
\n
\n
\n'); $templateCache.put('components/plugin-ports/view.html','
\n
{{(port.description ? port.description : port.host + \' \' + port.port) | min_size: 20}}
\n
\n
\n Scanning\n Timeout\n Open\n {{port.status * 1000.0 | number:0}}ms\n
\n
'); -$templateCache.put('components/plugin-process/view.html','
\n \n \n \n
\n
PROCESSES DISABLED (press \'z\' to display)
\n'); +$templateCache.put('components/plugin-process/view.html','
\n \n
\n
\n \n
\n
\n \n
\n
PROCESSES DISABLED (press \'z\' to display)
\n'); $templateCache.put('components/plugin-processcount/view.html','
\n TASKS\n {{ vm.total }} ({{ vm.thread }} thr),\n {{ vm.running }} run,\n {{ vm.sleeping }} slp,\n {{ vm.stopped }} oth\n sorted {{ vm.sorter.auto ? \'automatically\' : \'\' }} by {{ vm.sorter.getColumnLabel(vm.sorter.column) }}, flat view\n
'); $templateCache.put('components/plugin-processlist/view.html','
\n
\n
\n
CPU%
\n
MEM%
\n \n \n
PID
\n
USER
\n
NI
\n
S
\n \n \n \n
Command
\n
\n
\n
{{process.cpu_percent | number:1}}
\n
{{process.memory_percent | number:1}}
\n \n \n
{{process.pid}}
\n
{{process.username}}
\n
{{process.nice | exclamation}}
\n
{{process.status}}
\n \n \n \n
{{process.name}}
\n
{{process.cmdline}}
\n
\n
\n
\n'); -$templateCache.put('components/plugin-percpu/view.html','
\n
\n
\n
PER CPU
\n
{{ percpu.total }}%
\n
\n
\n
user:
\n
\n {{ percpu.user }}%\n
\n
\n
\n
system:
\n
\n {{ percpu.system }}%\n
\n
\n
\n
idle:
\n
{{ percpu.idle }}%
\n
\n
\n
iowait:
\n
\n {{ percpu.iowait }}%\n
\n
\n
\n
steal:
\n
\n {{ percpu.steal }}%\n
\n
\n
\n
\n'); $templateCache.put('components/plugin-quicklook/view.html','
\n
\n {{ vm.cpu_name }}\n
\n
\n
\n
CPU
\n
\n
\n
\n  \n
\n
\n
\n
\n {{ vm.cpu }}%\n
\n
\n
\n
CPU{{ percpu.number }}
\n
\n
\n
\n  \n
\n
\n
\n
\n {{ percpu.total }}%\n
\n
\n
\n
MEM
\n
\n
\n
\n  \n
\n
\n
\n
\n {{ vm.mem }}%\n
\n
\n
\n
SWAP
\n
\n
\n
\n  \n
\n
\n
\n
\n {{ vm.swap }}%\n
\n
\n
\n
\n'); $templateCache.put('components/plugin-system/view.html','
\n Disconnected from\n {{ vm.hostname }}\n \n \n
\n'); $templateCache.put('components/plugin-uptime/view.html','
\n Uptime: {{ vm.value }}\n
\n');