mirror of
https://github.com/nicolargo/glances.git
synced 2025-01-01 22:16:54 +03:00
Network interfaces not applying in web UI #1884
This commit is contained in:
parent
26ce4e5d48
commit
7dd70a93a6
@ -159,7 +159,7 @@ tx_critical=90
|
||||
# Define the list of hidden network interfaces (comma-separated regexp)
|
||||
#hide=docker.*,lo
|
||||
# WLAN 0 alias
|
||||
#wlan0_alias=Wireless IF
|
||||
#wlan0_alias=Wireless
|
||||
# It is possible to overwrite the bitrate thresholds per interface
|
||||
# WLAN 0 Default limits (in bits per second aka bps) for interface bitrate
|
||||
#wlan0_rx_careful=4000000
|
||||
@ -196,7 +196,7 @@ disable=False
|
||||
#hide=sda2,sda5,loop.*
|
||||
hide=loop.*,/dev/loop*
|
||||
# Alias for sda1
|
||||
#sda1_alias=InternalDisk
|
||||
sda1_alias=InternalDisk
|
||||
|
||||
[fs]
|
||||
disable=False
|
||||
|
@ -27,7 +27,8 @@ export default function GlancesPluginNetworkController($scope, $filter, GlancesS
|
||||
'time_since_update': networkData['time_since_update'],
|
||||
'cumulativeRx': networkData['cumulative_rx'],
|
||||
'cumulativeTx': networkData['cumulative_tx'],
|
||||
'cumulativeCx': networkData['cumulative_cx']
|
||||
'cumulativeCx': networkData['cumulative_cx'],
|
||||
'alias': networkData['alias'] !== undefined ? networkData['alias'] : null
|
||||
};
|
||||
|
||||
vm.networks.push(network);
|
||||
|
@ -13,7 +13,7 @@
|
||||
<div class="table-cell" ng-show="vm.arguments.network_cumul && vm.arguments.network_sum">Rx+Tx</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="network in vm.networks track by network.interfaceName">
|
||||
<div class="table-cell text-left">{{ network.interfaceName | min_size }}</div>
|
||||
<div class="table-cell text-left">{{ (network.alias ? network.alias : network.interfaceName) | min_size }}</div>
|
||||
<div class="table-cell" ng-show="!vm.arguments.network_cumul && !vm.arguments.network_sum">{{ vm.arguments.byte ?
|
||||
(network.rx / network.time_since_update | bytes) : (network.rx / network.time_since_update | bits) }}
|
||||
</div>
|
||||
|
5
glances/outputs/static/public/glances.js
vendored
5
glances/outputs/static/public/glances.js
vendored
@ -59046,7 +59046,8 @@ function GlancesPluginNetworkController($scope, $filter, GlancesStats, ARGUMENTS
|
||||
'time_since_update': networkData['time_since_update'],
|
||||
'cumulativeRx': networkData['cumulative_rx'],
|
||||
'cumulativeTx': networkData['cumulative_tx'],
|
||||
'cumulativeCx': networkData['cumulative_cx']
|
||||
'cumulativeCx': networkData['cumulative_cx'],
|
||||
'alias': networkData['alias'] !== undefined ? networkData['alias'] : null
|
||||
};
|
||||
|
||||
vm.networks.push(network);
|
||||
@ -59062,7 +59063,7 @@ function GlancesPluginNetworkController($scope, $filter, GlancesStats, ARGUMENTS
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
var path = '/home/nicolargo/dev/glances/glances/outputs/static/js/components/plugin-network/view.html';
|
||||
var html = "<div class=\"table-row\">\n <div class=\"table-cell text-left title\">NETWORK</div>\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && !vm.arguments.network_sum\">Rx/s</div>\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && !vm.arguments.network_sum\">Tx/s</div>\n\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && vm.arguments.network_sum\"></div>\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && vm.arguments.network_sum\">Rx+Tx/s</div>\n\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && !vm.arguments.network_sum\">Rx</div>\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && !vm.arguments.network_sum\">Tx</div>\n\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && vm.arguments.network_sum\"></div>\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && vm.arguments.network_sum\">Rx+Tx</div>\n</div>\n<div class=\"table-row\" ng-repeat=\"network in vm.networks track by network.interfaceName\">\n <div class=\"table-cell text-left\">{{ network.interfaceName | min_size }}</div>\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && !vm.arguments.network_sum\">{{ vm.arguments.byte ?\n (network.rx / network.time_since_update | bytes) : (network.rx / network.time_since_update | bits) }}\n </div>\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && !vm.arguments.network_sum\">{{ vm.arguments.byte ?\n (network.tx / network.time_since_update | bytes) : (network.tx / network.time_since_update | bits) }}\n </div>\n\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && vm.arguments.network_sum\"></div>\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && vm.arguments.network_sum\">{{ vm.arguments.byte ?\n (network.cx / network.time_since_update | bytes) : (network.cx / network.time_since_update | bits) }}\n </div>\n\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && !vm.arguments.network_sum\">{{ vm.arguments.byte ?\n (network.cumulativeRx | bytes) : (network.cumulativeRx | bits) }}\n </div>\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && !vm.arguments.network_sum\">{{ vm.arguments.byte ?\n (network.cumulativeTx | bytes) : (network.cumulativeTx | bits) }}\n </div>\n\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && vm.arguments.network_sum\"></div>\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && vm.arguments.network_sum\">{{ vm.arguments.byte ?\n (network.cumulativeCx | bytes) : (network.cumulativeCx | bits) }}\n </div>\n</div>\n";
|
||||
var html = "<div class=\"table-row\">\n <div class=\"table-cell text-left title\">NETWORK</div>\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && !vm.arguments.network_sum\">Rx/s</div>\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && !vm.arguments.network_sum\">Tx/s</div>\n\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && vm.arguments.network_sum\"></div>\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && vm.arguments.network_sum\">Rx+Tx/s</div>\n\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && !vm.arguments.network_sum\">Rx</div>\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && !vm.arguments.network_sum\">Tx</div>\n\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && vm.arguments.network_sum\"></div>\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && vm.arguments.network_sum\">Rx+Tx</div>\n</div>\n<div class=\"table-row\" ng-repeat=\"network in vm.networks track by network.interfaceName\">\n <div class=\"table-cell text-left\">{{ (network.alias ? network.alias : network.interfaceName) | min_size }}</div>\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && !vm.arguments.network_sum\">{{ vm.arguments.byte ?\n (network.rx / network.time_since_update | bytes) : (network.rx / network.time_since_update | bits) }}\n </div>\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && !vm.arguments.network_sum\">{{ vm.arguments.byte ?\n (network.tx / network.time_since_update | bytes) : (network.tx / network.time_since_update | bits) }}\n </div>\n\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && vm.arguments.network_sum\"></div>\n <div class=\"table-cell\" ng-show=\"!vm.arguments.network_cumul && vm.arguments.network_sum\">{{ vm.arguments.byte ?\n (network.cx / network.time_since_update | bytes) : (network.cx / network.time_since_update | bits) }}\n </div>\n\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && !vm.arguments.network_sum\">{{ vm.arguments.byte ?\n (network.cumulativeRx | bytes) : (network.cumulativeRx | bits) }}\n </div>\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && !vm.arguments.network_sum\">{{ vm.arguments.byte ?\n (network.cumulativeTx | bytes) : (network.cumulativeTx | bits) }}\n </div>\n\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && vm.arguments.network_sum\"></div>\n <div class=\"table-cell\" ng-show=\"vm.arguments.network_cumul && vm.arguments.network_sum\">{{ vm.arguments.byte ?\n (network.cumulativeCx | bytes) : (network.cumulativeCx | bits) }}\n </div>\n</div>\n";
|
||||
window.angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
|
||||
module.exports = path;
|
||||
|
||||
|
2
glances/outputs/static/public/glances.map.js
vendored
2
glances/outputs/static/public/glances.map.js
vendored
File diff suppressed because one or more lines are too long
@ -135,6 +135,7 @@ class Plugin(GlancesPlugin):
|
||||
tx = cumulative_tx - self.network_old[net].bytes_sent
|
||||
cx = rx + tx
|
||||
netstat = {'interface_name': n(net),
|
||||
'alias': self.has_alias(n(net)),
|
||||
'time_since_update': time_since_update,
|
||||
'cumulative_rx': cumulative_rx,
|
||||
'rx': rx,
|
||||
@ -208,6 +209,7 @@ class Plugin(GlancesPlugin):
|
||||
cx = rx + tx
|
||||
netstat = {
|
||||
'interface_name': interface_name,
|
||||
'alias': self.has_alias(interface_name),
|
||||
'time_since_update': time_since_update,
|
||||
'cumulative_rx': cumulative_rx,
|
||||
'rx': rx,
|
||||
@ -310,10 +312,10 @@ class Plugin(GlancesPlugin):
|
||||
continue
|
||||
# Format stats
|
||||
# Is there an alias for the interface name ?
|
||||
ifrealname = i['interface_name'].split(':')[0]
|
||||
ifname = self.has_alias(i['interface_name'])
|
||||
if ifname is None:
|
||||
ifname = ifrealname
|
||||
if i['alias'] is None:
|
||||
ifname = i['interface_name'].split(':')[0]
|
||||
else:
|
||||
ifname = i['alias']
|
||||
if len(ifname) > name_max_width:
|
||||
# Cut interface name if it is too long
|
||||
ifname = '_' + ifname[-name_max_width + 1:]
|
||||
|
Loading…
Reference in New Issue
Block a user