Skip to content

Commit

Permalink
🔀 Merge pull request #1646 from hockwill/BUG/1608_glances-network-error
Browse files Browse the repository at this point in the history
Resolves and updates the various broken glances widgets to be compatible with V4 of glances.
  • Loading branch information
CrazyWolf13 committed Sep 1, 2024
2 parents 4741b93 + 12e3dbe commit bede08c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/components/Widgets/GlNetworkInterfaces.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ export default {
networks.push({
name: network.interface_name,
speed: network.speed,
online: network.is_up ? 'up' : 'down',
currentDownload: network.rx,
currentUpload: network.tx,
totalDownload: network.cumulative_rx,
totalUpload: network.cumulative_tx,
online: network.speed ? 'up' : 'down', //v3 to v4 is_up no longer seems to be a default response field
currentDownload: network.bytes_recv,
currentUpload: network.bytes_sent,
totalDownload: network.bytes_recv_gauge,
totalUpload: network.bytes_sent_gauge,
changeDownload: this.previous && network.rx > this.previous[index].rx,
changeUpload: this.previous && network.tx > this.previous[index].tx,
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/Widgets/GlNetworkTraffic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default {
/* eslint-disable prefer-destructuring */
Object.keys(trafficData).forEach((keyName) => {
let upOrDown = null;
if (keyName.includes('_tx')) upOrDown = 'up';
else if (keyName.includes('_rx')) upOrDown = 'down';
if (keyName.includes('_sent')) upOrDown = 'up';
else if (keyName.includes('_recv')) upOrDown = 'down';
trafficData[keyName].forEach((dataPoint) => {
const dataTime = this.getRoundedTime(dataPoint[0]);
if (upOrDown === 'up') {
Expand Down

0 comments on commit bede08c

Please sign in to comment.