From c93093d39fef7f7e146d209d683dffd810c1c52f Mon Sep 17 00:00:00 2001 From: Nicolas Hart Date: Tue, 3 May 2016 22:31:16 +0200 Subject: [PATCH 1/3] [Web UI] does not display process with no result --- .../outputs/static/js/services/plugins/glances_amps.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/glances/outputs/static/js/services/plugins/glances_amps.js b/glances/outputs/static/js/services/plugins/glances_amps.js index 1a7be44d..effcc571 100644 --- a/glances/outputs/static/js/services/plugins/glances_amps.js +++ b/glances/outputs/static/js/services/plugins/glances_amps.js @@ -3,7 +3,14 @@ glancesApp.service('GlancesPluginAmps', function() { this.processes = []; this.setData = function(data, views) { - this.processes = data[_pluginName]; + var processes = data[_pluginName]; + + this.processes = []; + angular.forEach(processes, function(process, key) { + if (process.result !== null) { + this.processes.push(process); + } + }, this); }; this.getDescriptionDecoration = function(process) { From 3e423acb0f8f172c1bea8dbfe9ad9dcc098111c8 Mon Sep 17 00:00:00 2001 From: Nicolas Hart Date: Tue, 3 May 2016 22:32:24 +0200 Subject: [PATCH 2/3] [Web UI] display \n as new line in amp plugin result --- glances/outputs/static/css/style.css | 2 +- glances/outputs/static/html/plugins/amps.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glances/outputs/static/css/style.css b/glances/outputs/static/css/style.css index 99372d7b..44eaadcc 100644 --- a/glances/outputs/static/css/style.css +++ b/glances/outputs/static/css/style.css @@ -136,7 +136,7 @@ body { #amps .process-result { max-width: 300px; overflow: hidden; - white-space: nowrap; + white-space: pre-wrap; padding-left: 10px; text-overflow: ellipsis; } diff --git a/glances/outputs/static/html/plugins/amps.html b/glances/outputs/static/html/plugins/amps.html index a103a366..bd149629 100644 --- a/glances/outputs/static/html/plugins/amps.html +++ b/glances/outputs/static/html/plugins/amps.html @@ -1,7 +1,7 @@
-
{{ process.name }}
-
{{ process.count }}
-
{{ process.result }}
+
{{ process.name }}
+
{{ process.count }}
+
{{ process.result }}
From fcd6157aaed3cbc5baa6081258ca930ffcb09444 Mon Sep 17 00:00:00 2001 From: Nicolas Hart Date: Tue, 3 May 2016 22:41:18 +0200 Subject: [PATCH 3/3] [Web UI] Working shortcut A for amp plugin --- glances/outputs/static/js/stats_controller.js | 2 +- glances/outputs/static/js/variables.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/glances/outputs/static/js/stats_controller.js b/glances/outputs/static/js/stats_controller.js index d0eac213..53e01080 100644 --- a/glances/outputs/static/js/stats_controller.js +++ b/glances/outputs/static/js/stats_controller.js @@ -65,7 +65,7 @@ glancesApp.controller('statsController', function ($scope, $rootScope, $interval $scope.sorter.auto = true; break; case $event.shiftKey && $event.keyCode == keycodes.A: - // D => Enable/disable AMPs + // A => Enable/disable AMPs $scope.arguments.disable_amps = !$scope.arguments.disable_amps; break; case !$event.shiftKey && $event.keyCode == keycodes.c: diff --git a/glances/outputs/static/js/variables.js b/glances/outputs/static/js/variables.js index fe258f85..c0400c2f 100644 --- a/glances/outputs/static/js/variables.js +++ b/glances/outputs/static/js/variables.js @@ -28,5 +28,6 @@ var keycodes = { 'F' : '70', 'g' : '71', 'r' : '82', - 'q' : '81' + 'q' : '81', + 'A' : '65' }