Skip to content

Commit bede08c

Browse files
authored
🔀 Merge pull request #1646 from hockwill/BUG/1608_glances-network-error
Resolves and updates the various broken glances widgets to be compatible with V4 of glances.
2 parents 4741b93 + 12e3dbe commit bede08c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/components/Widgets/GlNetworkInterfaces.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ export default {
6868
networks.push({
6969
name: network.interface_name,
7070
speed: network.speed,
71-
online: network.is_up ? 'up' : 'down',
72-
currentDownload: network.rx,
73-
currentUpload: network.tx,
74-
totalDownload: network.cumulative_rx,
75-
totalUpload: network.cumulative_tx,
71+
online: network.speed ? 'up' : 'down', //v3 to v4 is_up no longer seems to be a default response field
72+
currentDownload: network.bytes_recv,
73+
currentUpload: network.bytes_sent,
74+
totalDownload: network.bytes_recv_gauge,
75+
totalUpload: network.bytes_sent_gauge,
7676
changeDownload: this.previous && network.rx > this.previous[index].rx,
7777
changeUpload: this.previous && network.tx > this.previous[index].tx,
7878
});

src/components/Widgets/GlNetworkTraffic.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export default {
3333
/* eslint-disable prefer-destructuring */
3434
Object.keys(trafficData).forEach((keyName) => {
3535
let upOrDown = null;
36-
if (keyName.includes('_tx')) upOrDown = 'up';
37-
else if (keyName.includes('_rx')) upOrDown = 'down';
36+
if (keyName.includes('_sent')) upOrDown = 'up';
37+
else if (keyName.includes('_recv')) upOrDown = 'down';
3838
trafficData[keyName].forEach((dataPoint) => {
3939
const dataTime = this.getRoundedTime(dataPoint[0]);
4040
if (upOrDown === 'up') {

0 commit comments

Comments
 (0)