From 56749d6a0b20173a139d6e7fda1887974f8e06a0 Mon Sep 17 00:00:00 2001 From: ScalWeb Info Date: Wed, 30 Oct 2019 22:55:22 +0200 Subject: [PATCH] Showing network interface name --- lib/monitor/net.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/monitor/net.js b/lib/monitor/net.js index 9fd0d47..64aae07 100644 --- a/lib/monitor/net.js +++ b/lib/monitor/net.js @@ -11,7 +11,7 @@ function Net(sparkline) { var that = this; var updater = function() { si.networkStats(iface, data => { - that.updateData(data[0]); + that.updateData(data[0], iface); }); } updater(); @@ -19,7 +19,7 @@ function Net(sparkline) { }) } -Net.prototype.updateData = function(data) { +Net.prototype.updateData = function(data, iface) { var rx_sec = Math.max(0, data['rx_sec']); var tx_sec = Math.max(0, data['tx_sec']); @@ -30,12 +30,12 @@ Net.prototype.updateData = function(data) { this.netData[1].shift(); this.netData[1].push(tx_sec); - rx_label = 'Receiving: ' + + rx_label = iface + ' Receiving: ' + utils.humanFileSize(rx_sec) + '/s \nTotal received: ' + utils.humanFileSize(data['rx_bytes']); - tx_label = 'Transferring: ' + + tx_label = iface + ' Transferring: ' + utils.humanFileSize(tx_sec) + '/s \nTotal transferred: ' + utils.humanFileSize(data['tx_bytes']);