Merge pull request #899 from nclsHart/ports-shortcut

Ports plugin keyboard shortcut
This commit is contained in:
Nicolas Hennion 2016-07-25 14:08:34 +02:00 committed by GitHub
commit 1a777d7ec3
4 changed files with 12 additions and 1 deletions

View File

@ -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">{{help.enable_disable_short_processname}}</div>
<div class="col-sm-12 col-lg-6"></div> <div class="col-sm-12 col-lg-6"></div>
</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>

View File

@ -46,7 +46,7 @@
<div class="col-sm-6 sidebar" ng-show="!arguments.disable_left_sidebar"> <div class="col-sm-6 sidebar" ng-show="!arguments.disable_left_sidebar">
<div class="table"> <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="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="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="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> <section id="folders" class="plugin table-row-group" ng-show="!arguments.disable_fs && statsFolders.folders.length > 0" ng-include src="'plugins/folders.html'"></section>

View File

@ -178,6 +178,10 @@ glancesApp.controller('statsController', function ($scope, $rootScope, $interval
// I => Show/hide IP module // I => Show/hide IP module
$scope.arguments.disable_ip = !$scope.arguments.disable_ip; $scope.arguments.disable_ip = !$scope.arguments.disable_ip;
break; break;
case $event.shiftKey && $event.keyCode == keycodes.p:
// I => Enable/disable ports module
$scope.arguments.disable_ports = !$scope.arguments.disable_ports;
break;
} }
}; };
}); });

View File

@ -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['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_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['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' self.view_data['edit_pattern_filter'] = 'ENTER: Edit the process filter pattern'
def get_view_data(self, args=None): 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['enable_disable_irix']))
ret.append(self.curse_add_line(self.view_data['quit'])) ret.append(self.curse_add_line(self.view_data['quit']))
ret.append(self.curse_new_line()) 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()) ret.append(self.curse_new_line())