summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Hennion <nicolashennion@gmail.com>2016-07-25 14:08:34 +0200
committerGitHub <noreply@github.com>2016-07-25 14:08:34 +0200
commit1a777d7ec3725b51883b85e8fa201aa49db16594 (patch)
tree5593f8effa2b87837ca9a376a61044bb6c71af21
parent215d19e8f996ded5c0f7148009b240cf4061062e (diff)
parentf3aa3bd7261ad4e98cb6f5af7df93249ee1ba8fd (diff)
Merge pull request #899 from nclsHart/ports-shortcut
Ports plugin keyboard shortcut
-rw-r--r--glances/outputs/static/html/help.html4
-rw-r--r--glances/outputs/static/html/stats.html2
-rw-r--r--glances/outputs/static/js/stats_controller.js4
-rw-r--r--glances/plugins/glances_help.py3
4 files changed, 12 insertions, 1 deletions
diff --git a/glances/outputs/static/html/help.html b/glances/outputs/static/html/help.html
index e2a015b5..43308138 100644
--- a/glances/outputs/static/html/help.html
+++ b/glances/outputs/static/html/help.html
@@ -66,3 +66,7 @@
<div class="col-sm-12 col-lg-6">{{help.enable_disable_short_processname}}</div>
<div class="col-sm-12 col-lg-6"></div>
</div>
+<div class="row">
+ <div class="col-sm-12 col-lg-6">{{help.enable_disable_ports}}</div>
+ <div class="col-sm-12 col-lg-6"></div>
+</div>
diff --git a/glances/outputs/static/html/stats.html b/glances/outputs/static/html/stats.html
index 00fff51a..5658bc55 100644
--- a/glances/outputs/static/html/stats.html
+++ b/glances/outputs/static/html/stats.html
@@ -46,7 +46,7 @@
<div class="col-sm-6 sidebar" ng-show="!arguments.disable_left_sidebar">
<div class="table">
<section id="network" class="plugin table-row-group" ng-show="!arguments.disable_network" ng-include src="'plugins/network.html'"></section>
- <section id="ports" class="plugin table-row-group" ng-include src="'plugins/ports.html'"></section>
+ <section id="ports" class="plugin table-row-group" ng-show="!arguments.disable_ports" ng-include src="'plugins/ports.html'"></section>
<section id="diskio" class="plugin table-row-group" ng-show="!arguments.disable_diskio && statsDiskio.disks.length > 0" ng-include src="'plugins/diskio.html'"></section>
<section id="fs" class="plugin table-row-group" ng-show="!arguments.disable_fs" ng-include src="'plugins/fs.html'"></section>
<section id="folders" class="plugin table-row-group" ng-show="!arguments.disable_fs && statsFolders.folders.length > 0" ng-include src="'plugins/folders.html'"></section>
diff --git a/glances/outputs/static/js/stats_controller.js b/glances/outputs/static/js/stats_controller.js
index 516f3922..5a5320ba 100644
--- a/glances/outputs/static/js/stats_controller.js
+++ b/glances/outputs/static/js/stats_controller.js
@@ -178,6 +178,10 @@ glancesApp.controller('statsController', function ($scope, $rootScope, $interval
// I => Show/hide IP module
$scope.arguments.disable_ip = !$scope.arguments.disable_ip;
break;
+ case $event.shiftKey && $event.keyCode == keycodes.p:
+ // I => Enable/disable ports module
+ $scope.arguments.disable_ports = !$scope.arguments.disable_ports;
+ break;
}
};
});
diff --git a/glances/plugins/glances_help.py b/glances/plugins/glances_help.py
index e016727e..fb29130c 100644
--- a/glances/plugins/glances_help.py
+++ b/glances/plugins/glances_help.py
@@ -94,6 +94,7 @@ class Plugin(GlancesPlugin):
self.view_data['diskio_iops'] = msg_col2.format('B', 'Count/rate for Disk I/O')
self.view_data['show_hide_top_menu'] = msg_col2.format('5', 'Show/hide top menu (QL, CPU, MEM, SWAP and LOAD)')
self.view_data['show_hide_amp'] = msg_col2.format('A', 'Show/hide AMP plugin')
+ self.view_data['enable_disable_ports'] = msg_col.format('P', 'Enable/disable ports plugin')
self.view_data['edit_pattern_filter'] = 'ENTER: Edit the process filter pattern'
def get_view_data(self, args=None):
@@ -170,6 +171,8 @@ class Plugin(GlancesPlugin):
ret.append(self.curse_add_line(self.view_data['enable_disable_irix']))
ret.append(self.curse_add_line(self.view_data['quit']))
ret.append(self.curse_new_line())
+ ret.append(self.curse_add_line(self.view_data['enable_disable_ports']))
+ ret.append(self.curse_new_line())
ret.append(self.curse_new_line())