mirror of
https://github.com/Lissy93/dashy.git
synced 2024-12-23 17:03:59 +03:00
🔀 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.
This commit is contained in:
commit
bede08c00c
@ -68,11 +68,11 @@ export default {
|
|||||||
networks.push({
|
networks.push({
|
||||||
name: network.interface_name,
|
name: network.interface_name,
|
||||||
speed: network.speed,
|
speed: network.speed,
|
||||||
online: network.is_up ? 'up' : 'down',
|
online: network.speed ? 'up' : 'down', //v3 to v4 is_up no longer seems to be a default response field
|
||||||
currentDownload: network.rx,
|
currentDownload: network.bytes_recv,
|
||||||
currentUpload: network.tx,
|
currentUpload: network.bytes_sent,
|
||||||
totalDownload: network.cumulative_rx,
|
totalDownload: network.bytes_recv_gauge,
|
||||||
totalUpload: network.cumulative_tx,
|
totalUpload: network.bytes_sent_gauge,
|
||||||
changeDownload: this.previous && network.rx > this.previous[index].rx,
|
changeDownload: this.previous && network.rx > this.previous[index].rx,
|
||||||
changeUpload: this.previous && network.tx > this.previous[index].tx,
|
changeUpload: this.previous && network.tx > this.previous[index].tx,
|
||||||
});
|
});
|
||||||
|
@ -33,8 +33,8 @@ export default {
|
|||||||
/* eslint-disable prefer-destructuring */
|
/* eslint-disable prefer-destructuring */
|
||||||
Object.keys(trafficData).forEach((keyName) => {
|
Object.keys(trafficData).forEach((keyName) => {
|
||||||
let upOrDown = null;
|
let upOrDown = null;
|
||||||
if (keyName.includes('_tx')) upOrDown = 'up';
|
if (keyName.includes('_sent')) upOrDown = 'up';
|
||||||
else if (keyName.includes('_rx')) upOrDown = 'down';
|
else if (keyName.includes('_recv')) upOrDown = 'down';
|
||||||
trafficData[keyName].forEach((dataPoint) => {
|
trafficData[keyName].forEach((dataPoint) => {
|
||||||
const dataTime = this.getRoundedTime(dataPoint[0]);
|
const dataTime = this.getRoundedTime(dataPoint[0]);
|
||||||
if (upOrDown === 'up') {
|
if (upOrDown === 'up') {
|
||||||
|
Loading…
Reference in New Issue
Block a user