mirror of https://github.com/nicolargo/glances
commit
a69eb9ff37
|
@ -247,9 +247,8 @@ Start the client browser (browser mode):\n\
|
|||
if args.disable_autodiscover:
|
||||
logger.info("Auto discover mode is disabled")
|
||||
|
||||
# In web server mode, defaul refresh time: 5 sec
|
||||
# In web server mode
|
||||
if args.webserver:
|
||||
args.time = 5
|
||||
args.process_short_name = True
|
||||
|
||||
# Server or client login/password
|
||||
|
|
|
@ -71,7 +71,7 @@ class GlancesBottle(object):
|
|||
def _route(self):
|
||||
"""Define route."""
|
||||
self._app.route('/', method="GET", callback=self._index)
|
||||
self._app.route('/<refresh_time:int>', method=["GET", "POST"], callback=self._index)
|
||||
self._app.route('/<refresh_time:int>', method=["GET"], callback=self._index)
|
||||
|
||||
self._app.route('/<filename:re:.*\.css>', method="GET", callback=self._css)
|
||||
self._app.route('/<filename:re:.*\.js>', method="GET", callback=self._js)
|
||||
|
@ -115,10 +115,6 @@ class GlancesBottle(object):
|
|||
|
||||
def _index(self, refresh_time=None):
|
||||
"""Bottle callback for index.html (/) file."""
|
||||
# Manage parameter
|
||||
if refresh_time is None:
|
||||
refresh_time = self.args.time
|
||||
|
||||
# Update the stat
|
||||
self.stats.update()
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title ng-bind="title ">Glances</title>
|
||||
<title ng-bind="title">Glances</title>
|
||||
<base href="/">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<div class="table-row">
|
||||
<div class="table-cell text-left title">DISK I/O</div>
|
||||
<div class="table-cell" ng-show="!show.diskio_iops">R/s</div>
|
||||
<div class="table-cell" ng-show="!show.diskio_iops">W/s</div>
|
||||
<div class="table-cell" ng-show="!arguments.diskio_iops">R/s</div>
|
||||
<div class="table-cell" ng-show="!arguments.diskio_iops">W/s</div>
|
||||
|
||||
<div class="table-cell" ng-show="show.diskio_iops">IOR/s</div>
|
||||
<div class="table-cell" ng-show="show.diskio_iops">IOW/s</div>
|
||||
<div class="table-cell" ng-show="arguments.diskio_iops">IOR/s</div>
|
||||
<div class="table-cell" ng-show="arguments.diskio_iops">IOW/s</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="disk in statsDiskio.disks">
|
||||
<div class="table-cell text-left">{{disk.name | min_size}}</div>
|
||||
<div class="table-cell" ng-show="!show.diskio_iops">{{disk.bitrate.txps }}</div>
|
||||
<div class="table-cell" ng-show="!show.diskio_iops">{{disk.bitrate.rxps }}</div>
|
||||
<div class="table-cell" ng-show="!arguments.diskio_iops">{{disk.bitrate.txps }}</div>
|
||||
<div class="table-cell" ng-show="!arguments.diskio_iops">{{disk.bitrate.rxps }}</div>
|
||||
|
||||
<div class="table-cell" ng-show="show.diskio_iops">{{disk.count.txps }}</div>
|
||||
<div class="table-cell" ng-show="show.diskio_iops">{{disk.count.rxps }}</div>
|
||||
<div class="table-cell" ng-show="arguments.diskio_iops">{{disk.count.txps }}</div>
|
||||
<div class="table-cell" ng-show="arguments.diskio_iops">{{disk.count.rxps }}</div>
|
||||
</div>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<div class="table-row">
|
||||
<div class="table-cell text-left title">FILE SYS</div>
|
||||
<div class="table-cell">
|
||||
<span ng-show="!show.filesystem_free_space">Used</span>
|
||||
<span ng-show="show.filesystem_free_space">Free</span>
|
||||
<span ng-show="!arguments.fs_free_space">Used</span>
|
||||
<span ng-show="arguments.fs_free_space">Free</span>
|
||||
</div>
|
||||
<div class="table-cell">Total</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="fs in statsFs.fileSystems | orderBy: 'mnt_point'">
|
||||
<div class="table-cell text-left">{{ fs.mountPoint }} ({{ fs.name }})</div>
|
||||
<div class="table-cell" ng-class="statsFs.getDecoration(fs.mountPoint, 'used')">
|
||||
<span ng-show="!show.filesystem_free_space">{{ fs.used | bytes }}</span>
|
||||
<span ng-show="show.filesystem_free_space">{{ fs.free | bytes }}</span>
|
||||
<span ng-show="!arguments.fs_free_space">{{ fs.used | bytes }}</span>
|
||||
<span ng-show="arguments.fs_free_space">{{ fs.free | bytes }}</span>
|
||||
</div>
|
||||
<div class="table-cell">{{ fs.size | bytes }}</div>
|
||||
</div>
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
<div class="table-row">
|
||||
<div class="table-cell text-left title">NETWORK</div>
|
||||
<div class="table-cell" ng-show="!show.network_io_cumulative && !show.network_io_combination">Rx/s</div>
|
||||
<div class="table-cell" ng-show="!show.network_io_cumulative && !show.network_io_combination">Tx/s</div>
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && !arguments.network_sum">Rx/s</div>
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && !arguments.network_sum">Tx/s</div>
|
||||
|
||||
<div class="table-cell" ng-show="!show.network_io_cumulative && show.network_io_combination"></div>
|
||||
<div class="table-cell" ng-show="!show.network_io_cumulative && show.network_io_combination">Rx+Tx/s</div>
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && arguments.network_sum"></div>
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && arguments.network_sum">Rx+Tx/s</div>
|
||||
|
||||
<div class="table-cell" ng-show="show.network_io_cumulative && !show.network_io_combination">Rx</div>
|
||||
<div class="table-cell" ng-show="show.network_io_cumulative && !show.network_io_combination">Tx</div>
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && !arguments.network_sum">Rx</div>
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && !arguments.network_sum">Tx</div>
|
||||
|
||||
<div class="table-cell" ng-show="show.network_io_cumulative && show.network_io_combination"></div>
|
||||
<div class="table-cell" ng-show="show.network_io_cumulative && show.network_io_combination">Rx+Tx</div>
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && arguments.network_sum"></div>
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && arguments.network_sum">Rx+Tx</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="network in statsNetwork.networks | orderBy: 'interfaceName'">
|
||||
<div class="table-cell text-left">{{ network.interfaceName | min_size }}</div>
|
||||
<div class="table-cell" ng-show="!show.network_io_cumulative && !show.network_io_combination">{{ show.network_by_bytes ? (network.rx / network.time_since_update | bytes) : (network.rx / network.time_since_update | bits) }}</div>
|
||||
<div class="table-cell" ng-show="!show.network_io_cumulative && !show.network_io_combination">{{ show.network_by_bytes ? (network.tx / network.time_since_update | bytes) : (network.tx / network.time_since_update | bits) }}</div>
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && !arguments.network_sum">{{ arguments.byte ? (network.rx / network.time_since_update | bytes) : (network.rx / network.time_since_update | bits) }}</div>
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && !arguments.network_sum">{{ arguments.byte ? (network.tx / network.time_since_update | bytes) : (network.tx / network.time_since_update | bits) }}</div>
|
||||
|
||||
<div class="table-cell" ng-show="!show.network_io_cumulative && show.network_io_combination"></div>
|
||||
<div class="table-cell" ng-show="!show.network_io_cumulative && show.network_io_combination">{{ show.network_by_bytes ? (network.cx / network.time_since_update | bytes) : (network.cx / network.time_since_update | bits) }}</div>
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && arguments.network_sum"></div>
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && arguments.network_sum">{{ arguments.byte ? (network.cx / network.time_since_update | bytes) : (network.cx / network.time_since_update | bits) }}</div>
|
||||
|
||||
<div class="table-cell" ng-show="show.network_io_cumulative && !show.network_io_combination">{{ show.network_by_bytes ? (network.cumulativeRx | bytes) : (network.cumulativeRx | bits) }}</div>
|
||||
<div class="table-cell" ng-show="show.network_io_cumulative && !show.network_io_combination">{{ show.network_by_bytes ? (network.cumulativeTx | bytes) : (network.cumulativeTx | bits) }}</div>
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && !arguments.network_sum">{{ arguments.byte ? (network.cumulativeRx | bytes) : (network.cumulativeRx | bits) }}</div>
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && !arguments.network_sum">{{ arguments.byte ? (network.cumulativeTx | bytes) : (network.cumulativeTx | bits) }}</div>
|
||||
|
||||
<div class="table-cell" ng-show="show.network_io_cumulative && show.network_io_combination"></div>
|
||||
<div class="table-cell" ng-show="show.network_io_cumulative && show.network_io_combination">{{ show.network_by_bytes ? (network.cumulativeCx | bytes) : (network.cumulativeCx | bits) }}</div>
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && arguments.network_sum"></div>
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && arguments.network_sum">{{ arguments.byte ? (network.cumulativeCx | bytes) : (network.cumulativeCx | bits) }}</div>
|
||||
</div>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
</div>
|
||||
<div class="table-cell hidden-xs hidden-sm" ng-show="statsProcessList.ioReadWritePresent">{{process.ioRead}}</div>
|
||||
<div class="table-cell hidden-xs hidden-sm" ng-show="statsProcessList.ioReadWritePresent">{{process.ioWrite}}</div>
|
||||
<div class="table-cell text-left" ng-show="show.short_process_name">{{process.name}}</div>
|
||||
<div class="table-cell text-left" ng-show="!show.short_process_name">{{process.cmdline}}</div>
|
||||
<div class="table-cell text-left" ng-show="arguments.process_short_name">{{process.name}}</div>
|
||||
<div class="table-cell text-left" ng-show="!arguments.process_short_name">{{process.cmdline}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="table">
|
||||
<div class="table-row" ng-show="!show.per_cpu">
|
||||
<div class="table-row" ng-show="!arguments.percpu">
|
||||
<div class="table-cell text-left">CPU</div>
|
||||
<div class="table-cell">
|
||||
<div class="progress">
|
||||
|
@ -12,7 +12,7 @@
|
|||
{{ statsQuicklook.cpu }}%
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-row" ng-show="show.per_cpu" ng-repeat="percpu in statsQuicklook.percpus">
|
||||
<div class="table-row" ng-show="arguments.percpu" ng-repeat="percpu in statsQuicklook.percpus">
|
||||
<div class="table-cell text-left">CPU{{ percpu.number }}</div>
|
||||
<div class="table-cell">
|
||||
<div class="progress">
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<div class="loader">Loading...</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="help_screen" class="container-fluid" ng-include src="'help.html'"></div>
|
||||
<div ng-show="arguments.help_tag" class="container-fluid" ng-include src="'help.html'"></div>
|
||||
|
||||
<div ng-show="dataLoaded && !help_screen" class="container-fluid">
|
||||
<div ng-show="dataLoaded && !arguments.help_tag" class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-24">
|
||||
<div class="pull-left">
|
||||
|
@ -20,47 +20,47 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="hidden-xs hidden-sm hidden-md col-lg-6" ng-if="show.quick_look">
|
||||
<div class="hidden-xs hidden-sm hidden-md col-lg-6" ng-if="!arguments.disable_quicklook">
|
||||
<section id="quicklook" class="plugin" ng-include src="'plugins/quicklook.html'"></section>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="show.cpu && !show.per_cpu">
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="!arguments.disable_cpu && !arguments.percpu">
|
||||
<section id="cpu" class="plugin" ng-include src="'plugins/cpu.html'"></section>
|
||||
</div>
|
||||
<div class="hidden-xs hidden-sm col-md-4 col-lg-3" ng-if="show.cpu && !show.per_cpu">
|
||||
<div class="hidden-xs hidden-sm col-md-4 col-lg-3" ng-if="!arguments.disable_cpu && !arguments.percpu">
|
||||
<section id="cpu_more" class="plugin" ng-if="statsCpu.nice != undefined" ng-include src="'plugins/cpu_more.html'"></section>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-8 col-lg-6" ng-if="show.cpu && show.per_cpu">
|
||||
<div class="col-sm-12 col-md-8 col-lg-6" ng-if="!arguments.disable_cpu && arguments.percpu">
|
||||
<section id="per_cpu" class="plugin" ng-include src="'plugins/per_cpu.html'"></section>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="show.mem">
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="!arguments.disable_mem">
|
||||
<section id="mem" class="plugin" ng-include src="'plugins/mem.html'"></section>
|
||||
</div>
|
||||
<div class="hidden-xs hidden-sm col-md-4 col-lg-3" ng-if="show.mem">
|
||||
<div class="hidden-xs hidden-sm col-md-4 col-lg-3" ng-if="!arguments.disable_mem">
|
||||
<section id="mem_more" class="plugin" ng-include src="'plugins/mem_more.html'"></section>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="show.swap">
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="!arguments.disable_swap">
|
||||
<section id="memswap" class="plugin" ng-include src="'plugins/memswap.html'"></section>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="show.load">
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="!arguments.disable_load">
|
||||
<section id="load" class="plugin" ng-if="statsLoad.cpucore != undefined" ng-include src="'plugins/load.html'"></section>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 sidebar" ng-show="show.sidebar">
|
||||
<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="show.network" ng-include src="'plugins/network.html'"></section>
|
||||
<section id="diskio" class="plugin table-row-group" ng-show="show.diskio" ng-include src="'plugins/diskio.html'"></section>
|
||||
<section id="fs" class="plugin table-row-group" ng-show="show.fs" ng-include src="'plugins/fs.html'"></section>
|
||||
<section id="network" class="plugin table-row-group" ng-show="!arguments.disable_network" ng-include src="'plugins/network.html'"></section>
|
||||
<section id="diskio" class="plugin table-row-group" ng-show="!arguments.disable_diskio" 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="show.folders" ng-include src="'plugins/folders.html'"></section>
|
||||
<section id="raid" class="plugin table-row-group" ng-show="statsRaid.hasDisks()" ng-include src="'plugins/raid.html'"></section>
|
||||
<section id="sensors" class="plugin table-row-group" ng-show="show.sensors && statsSensors.sensors.length > 0" ng-include src="'plugins/sensors.html'"></section>
|
||||
<section id="sensors" class="plugin table-row-group" ng-show="!arguments.disable_sensors && statsSensors.sensors.length > 0" ng-include src="'plugins/sensors.html'"></section>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-18">
|
||||
<section id="containers" class="plugin" ng-show="statsDocker.containers.length && show.docker_stats" ng-include src="'plugins/docker.html'"></section>
|
||||
<section id="alerts" ng-show="show.alert" ng-include src="'plugins/alerts.html'"></section>
|
||||
<section id="alert" class="plugin" ng-show="show.alert" ng-include src="'plugins/alert.html'"></section>
|
||||
<div ng-show="show.process_stats">
|
||||
<section id="containers" class="plugin" ng-show="statsDocker.containers.length && !arguments.disable_docker" ng-include src="'plugins/docker.html'"></section>
|
||||
<section id="alerts" ng-show="!arguments.disable_log" ng-include src="'plugins/alerts.html'"></section>
|
||||
<section id="alert" class="plugin" ng-show="!arguments.disable_log" ng-include src="'plugins/alert.html'"></section>
|
||||
<div ng-show="!arguments.disable_process">
|
||||
<section id="processcount" class="plugin" ng-include src="'plugins/processcount.html'"></section>
|
||||
<div class="row">
|
||||
<div class="col-lg-18">
|
||||
|
@ -69,7 +69,7 @@
|
|||
</div>
|
||||
<section id="processlist" class="plugin" ng-include src="'plugins/processlist.html'"></section>
|
||||
</div>
|
||||
<div ng-show="!show.process_stats">PROCESSES DISABLED (press 'z' to display)</div>
|
||||
<div ng-show="arguments.disable_process">PROCESSES DISABLED (press 'z' to display)</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,12 +1,24 @@
|
|||
var glancesApp = angular.module('glancesApp', ['ngRoute'])
|
||||
|
||||
.config(function($routeProvider, $locationProvider) {
|
||||
$routeProvider.when('/', {
|
||||
$routeProvider.when('/:refresh_time?', {
|
||||
templateUrl : 'stats.html',
|
||||
controller : 'statsController'
|
||||
}).when('/:refresh_time', {
|
||||
templateUrl : 'stats.html',
|
||||
controller : 'statsController'
|
||||
controller : 'statsController',
|
||||
resolve: {
|
||||
help: function(GlancesStats) {
|
||||
return GlancesStats.getHelp();
|
||||
},
|
||||
arguments: function(GlancesStats, $route) {
|
||||
return GlancesStats.getArguments().then(function(arguments) {
|
||||
var refreshTimeRoute = parseInt($route.current.params.refresh_time);
|
||||
if (!isNaN(refreshTimeRoute) && refreshTimeRoute > 1) {
|
||||
arguments.time = refreshTimeRoute;
|
||||
}
|
||||
|
||||
return arguments;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$locationProvider.html5Mode(true);
|
||||
|
|
|
@ -65,6 +65,12 @@ glancesApp.service('GlancesStats', function($http, $injector, $q, GlancesPlugin)
|
|||
});
|
||||
};
|
||||
|
||||
this.getArguments = function() {
|
||||
return $http.get('/api/2/args').then(function (response) {
|
||||
return response.data;
|
||||
});
|
||||
};
|
||||
|
||||
this.getPlugin = function(name) {
|
||||
var plugin = _plugins[name];
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
glancesApp.controller('statsController', function ($scope, $rootScope, $interval, $routeParams, GlancesStats) {
|
||||
$scope.refreshTime = 3;
|
||||
glancesApp.controller('statsController', function ($scope, $rootScope, $interval, GlancesStats, help, arguments) {
|
||||
$scope.help = help;
|
||||
$scope.arguments = arguments;
|
||||
|
||||
$scope.sorter = {
|
||||
column: "cpu_percent",
|
||||
auto: true,
|
||||
|
@ -15,52 +17,6 @@ glancesApp.controller('statsController', function ($scope, $rootScope, $interval
|
|||
}
|
||||
};
|
||||
|
||||
$scope.help_screen = false;
|
||||
$scope.show = {
|
||||
'diskio': true,
|
||||
'network': true,
|
||||
'fs': true,
|
||||
'cpu': true,
|
||||
'mem': true,
|
||||
'swap': true,
|
||||
'load': true,
|
||||
'sensors': true,
|
||||
'top_menu': false,
|
||||
'sidebar': true,
|
||||
'alert': true,
|
||||
'short_process_name': true,
|
||||
'per_cpu': false,
|
||||
'warning_alerts': true,
|
||||
'warning_critical_alerts': true,
|
||||
'process_stats': true,
|
||||
'quick_look': true,
|
||||
'top_extended_stats': true,
|
||||
'docker_stats': true,
|
||||
'network_io_combination': false,
|
||||
'network_io_cumulative': false,
|
||||
'filesystem_freespace': false,
|
||||
'network_by_bytes': false,
|
||||
'filesystem_free_space': false,
|
||||
'diskio_iops': false
|
||||
};
|
||||
|
||||
$scope.init_refresh_time = function () {
|
||||
if ($routeParams != undefined && $routeParams.refresh_time != undefined) {
|
||||
var new_refresh_time = parseInt($routeParams.refresh_time);
|
||||
if (new_refresh_time >= 1) {
|
||||
$scope.refreshTime = new_refresh_time
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.show_hide = function (bloc) {
|
||||
if (bloc == 'help') {
|
||||
$scope.help_screen = !$scope.help_screen
|
||||
} else {
|
||||
$scope.show[bloc] = !$scope.show[bloc]
|
||||
}
|
||||
};
|
||||
|
||||
$scope.dataLoaded = false;
|
||||
$scope.refreshData = function () {
|
||||
GlancesStats.getData().then(function (data) {
|
||||
|
@ -94,41 +50,10 @@ glancesApp.controller('statsController', function ($scope, $rootScope, $interval
|
|||
});
|
||||
};
|
||||
|
||||
$scope.init_refresh_time();
|
||||
GlancesStats.getHelp().then(function (help) {
|
||||
$scope.help = help;
|
||||
});
|
||||
|
||||
var stop;
|
||||
$scope.configure_refresh = function () {
|
||||
$scope.refreshData();
|
||||
$interval(function () {
|
||||
$scope.refreshData();
|
||||
if (!angular.isDefined(stop)) {
|
||||
stop = $interval(function () {
|
||||
$scope.refreshData();
|
||||
}, $scope.refreshTime * 1000); // in milliseconds
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$watch(
|
||||
function () {
|
||||
return $scope.refreshTime;
|
||||
},
|
||||
function (newValue, oldValue) {
|
||||
$scope.stop_refresh();
|
||||
$scope.configure_refresh();
|
||||
}
|
||||
);
|
||||
|
||||
$scope.stop_refresh = function () {
|
||||
if (angular.isDefined(stop)) {
|
||||
$interval.cancel(stop);
|
||||
stop = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$on('$destroy', function () {
|
||||
$scope.stop_refresh();
|
||||
});
|
||||
}, arguments.time * 1000); // in milliseconds
|
||||
|
||||
$scope.onKeyDown = function ($event) {
|
||||
|
||||
|
@ -170,79 +95,78 @@ glancesApp.controller('statsController', function ($scope, $rootScope, $interval
|
|||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.d:
|
||||
// d => Show/hide disk I/O stats
|
||||
$scope.show_hide('diskio');
|
||||
$scope.arguments.disable_diskio = !$scope.arguments.disable_diskio;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.f:
|
||||
// f => Show/hide filesystem stats
|
||||
$scope.show_hide('fs');
|
||||
$scope.arguments.disable_fs = !$scope.arguments.disable_fs;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.n:
|
||||
// n => Show/hide network stats
|
||||
$scope.show_hide('network');
|
||||
$scope.arguments.disable_network = !$scope.arguments.disable_network;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.s:
|
||||
// s => Show/hide sensors stats
|
||||
$scope.show_hide('sensors');
|
||||
$scope.arguments.disable_sensors = !$scope.arguments.disable_sensors;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.TWO:
|
||||
// 2 => Show/hide left sidebar
|
||||
$scope.show_hide('sidebar');
|
||||
$scope.arguments.disable_left_sidebar = !$scope.arguments.disable_left_sidebar;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.z:
|
||||
// z => Enable/disable processes stats
|
||||
$scope.show_hide('process_stats');
|
||||
$scope.arguments.disable_process = !$scope.arguments.disable_process;
|
||||
break;
|
||||
case $event.keyCode == keycodes.SLASH:
|
||||
// SLASH => Enable/disable short processes name
|
||||
$scope.show_hide('short_process_name');
|
||||
$scope.arguments.process_short_name = !$scope.arguments.process_short_name;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.D:
|
||||
// D => Enable/disable Docker stats
|
||||
$scope.show_hide('docker_stats');
|
||||
$scope.arguments.disable_docker = !$scope.arguments.disable_docker;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.b:
|
||||
// b => Bytes or bits for network I/O
|
||||
$scope.show_hide('network_by_bytes');
|
||||
$scope.arguments.byte = !$scope.arguments.byte;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.b:
|
||||
// 'B' => Switch between bit/s and IO/s for Disk IO
|
||||
$scope.show_hide('diskio_iops');
|
||||
$scope.arguments.diskio_iops = !$scope.arguments.diskio_iops;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.l:
|
||||
// l => Show/hide alert logs
|
||||
$scope.show_hide('alert');
|
||||
$scope.arguments.disable_log = !$scope.arguments.disable_log;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.ONE:
|
||||
// 1 => Global CPU or per-CPU stats
|
||||
$scope.show_hide('per_cpu');
|
||||
$scope.arguments.percpu = !$scope.arguments.percpu;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.h:
|
||||
// h => Show/hide this help screen
|
||||
$scope.show_hide('help');
|
||||
$scope.arguments.help_tag = !$scope.arguments.help_tag;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.T:
|
||||
// T => View network I/O as combination
|
||||
$scope.show_hide('network_io_combination');
|
||||
$scope.arguments.network_sum = !$scope.arguments.network_sum;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.u:
|
||||
// U => View cumulative network I/O
|
||||
$scope.show_hide('network_io_cumulative');
|
||||
$scope.arguments.network_cumul = !$scope.arguments.network_cumul;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.f:
|
||||
// F => Show filesystem free space
|
||||
$scope.show_hide('filesystem_free_space');
|
||||
$scope.arguments.fs_free_space = !$scope.arguments.fs_free_space;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.THREE:
|
||||
// 3 => Enable/disable quick look plugin
|
||||
$scope.show_hide('quick_look');
|
||||
$scope.arguments.disable_quicklook = !$scope.arguments.disable_quicklook;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.FIVE:
|
||||
// 5 => Show/hide top menu (QL, CPU, MEM, SWAP and LOAD)
|
||||
$scope.show_hide('quick_look');
|
||||
$scope.show_hide('cpu');
|
||||
$scope.show_hide('mem');
|
||||
$scope.show_hide('swap');
|
||||
$scope.show_hide('load');
|
||||
$scope.arguments.disable_quicklook = !$scope.arguments.disable_quicklook;
|
||||
$scope.arguments.disable_cpu = !$scope.arguments.disable_cpu;
|
||||
$scope.arguments.disable_mem = !$scope.arguments.disable_mem;
|
||||
$scope.arguments.disable_swap = !$scope.arguments.disable_swap;
|
||||
$scope.arguments.disable_load = !$scope.arguments.disable_load;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue