From f49177bc1faa49a90618ebf8e21e69a6f898590f Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Tue, 22 Jan 2019 22:28:49 +0100 Subject: Small labeling change --- static/new_status-dnbd3.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'static') diff --git a/static/new_status-dnbd3.html b/static/new_status-dnbd3.html index cb26cba..85a34ec 100644 --- a/static/new_status-dnbd3.html +++ b/static/new_status-dnbd3.html @@ -59,15 +59,15 @@ {{ server.address }} Uptime:{{ formatSeconds(server.uptime) }} - Upload speed:{{ formatBytes(peak ? server.peakUploadSpeed : server.avgUploadSpeed) +'/s' }} - Download speed:{{ formatBytes(peak ? server.peakDownloadSpeed : server.avgDownloadSpeed) +'/s' }} - Total sent:{{ formatBytes(server.bytesSent) }} - Total received:{{ formatBytes(server.bytesReceived) }} + Upload speed:{{ formatSpeed(peak ? server.peakUploadSpeed : server.avgUploadSpeed) }} + Download speed:{{ formatSpeed(peak ? server.peakDownloadSpeed : server.avgDownloadSpeed) }} + Total sent:{{ formatSpeed(server.bytesSent) }} + Total received:{{ formatSpeed(server.bytesReceived) }} Client count:{{ server.clientCount }} {{ client.address.split( ":" )[0] }} - {{ formatBytes(peak ? client.peakUploadSpeed : client.avgUploadSpeed) + '/s' }} + {{ formatSpeed(peak ? client.peakUploadSpeed : client.avgUploadSpeed) }} @@ -162,12 +162,12 @@ var app = new Vue({ obj.avgDownloadSpeed = (b.bytesReceived - a.bytesReceived) / time } }, - formatBytes (bytes) { - if (bytes < 1024) return bytes.toFixed(2) + ' Bytes' - else if (bytes < 1048576) return (bytes / 1024).toFixed(2) + ' KiB' - else if (bytes < 1073741824) return (bytes / 1048576).toFixed(2) + ' MiB' - else if (bytes < 1099511627776) return (bytes / 1073741824).toFixed(2) + ' GiB' - else return (bytes / 1099511627776).toFixed(2) + ' TiB' + formatSpeed (bytes) { + if (bytes < 1024) return bytes.toFixed(2) + ' B/s' + else if (bytes < 1048576) return (bytes / 1024).toFixed(2) + ' KiB/s' + else if (bytes < 1073741824) return (bytes / 1048576).toFixed(2) + ' MiB/s' + else if (bytes < 1099511627776) return (bytes / 1073741824).toFixed(2) + ' GiB/s' + else return (bytes / 1099511627776).toFixed(2) + ' TiB/s' }, formatSeconds (seconds) { return ( Math.floor(seconds / ( 3600 * 24 ) ) + 'd ' @@ -210,8 +210,8 @@ var app = new Vue({ 'millisPerPixel': 300, 'grid': { 'millisPerLine': 30000 }, timestampFormatter: SmoothieChart.timeFormatter, - yMaxFormatter: this.formatBytes, - yMinFormatter: this.formatBytes, + yMaxFormatter: this.formatSpeed, + yMinFormatter: this.formatSpeed, valueTransformFunction: this.logScale, minValue: 0, maxValue: 262144000, -- cgit v1.2.3-55-g7522