未验证 提交 6589534f 编写于 作者: G GitSquared

🐛 Fix Conninfo not listening to the right iface

上级 6a20722d
......@@ -58,10 +58,30 @@ class Conninfo {
}, 1000);
}
updateInfo() {
this.si.networkStats((data) => {
this.si.networkInterfaces((data) => {
let net = data[0];
let netID = 0;
while (net.internal === true) {
netID++;
if (data[netID] !== undefined) {
net = data[netID];
} else {
break;
}
}
let time = new Date().getTime();
this.series[0].append(time,data.tx_sec);
this.series[1].append(time, -data.rx_sec);
if (net.ip4 === "127.0.0.1") {
this.series[0].append(time, 0);
this.series[1].append(time, 0);
return;
} else {
this.si.networkStats(net.iface, (data) => {
this.series[0].append(time,data.tx_sec);
this.series[1].append(time, -data.rx_sec);
});
}
});
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册