diff options
author | Udo Walter | 2019-01-22 22:28:49 +0100 |
---|---|---|
committer | Udo Walter | 2019-01-22 22:28:49 +0100 |
commit | f49177bc1faa49a90618ebf8e21e69a6f898590f (patch) | |
tree | 10d2e93da05cbd1e722dd06985b6e4c667b8607c | |
parent | Add server speeds graph, option to show peak speeds and some design changes (diff) | |
download | dnbd3-status-f49177bc1faa49a90618ebf8e21e69a6f898590f.tar.gz dnbd3-status-f49177bc1faa49a90618ebf8e21e69a6f898590f.tar.xz dnbd3-status-f49177bc1faa49a90618ebf8e21e69a6f898590f.zip |
Small labeling change
-rw-r--r-- | static/new_status-dnbd3.html | 26 |
1 files changed, 13 insertions, 13 deletions
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 @@ <tbody> <tr class="first-row"><td colspan="2" class="server-ip">{{ server.address }}</td></tr> <tr><td>Uptime:</td><td class="expand">{{ formatSeconds(server.uptime) }}</td></tr> - <tr><td>Upload speed:</td><td>{{ formatBytes(peak ? server.peakUploadSpeed : server.avgUploadSpeed) +'/s' }}</td></tr> - <tr><td>Download speed:</td><td>{{ formatBytes(peak ? server.peakDownloadSpeed : server.avgDownloadSpeed) +'/s' }}</td></tr> - <tr><td>Total sent:</td><td>{{ formatBytes(server.bytesSent) }}</td></tr> - <tr><td>Total received:</td><td>{{ formatBytes(server.bytesReceived) }}</td></tr> + <tr><td>Upload speed:</td><td>{{ formatSpeed(peak ? server.peakUploadSpeed : server.avgUploadSpeed) }}</td></tr> + <tr><td>Download speed:</td><td>{{ formatSpeed(peak ? server.peakDownloadSpeed : server.avgDownloadSpeed) }}</td></tr> + <tr><td>Total sent:</td><td>{{ formatSpeed(server.bytesSent) }}</td></tr> + <tr><td>Total received:</td><td>{{ formatSpeed(server.bytesReceived) }}</td></tr> <tr><td>Client count:</td><td>{{ server.clientCount }}</td></tr> <tr v-for="client in server.clients"> <td class="client-label">{{ client.address.split( ":" )[0] }}</td> <td class="client-speed" :style="calcBackgroundStyle(peak ? client.peakUploadSpeed : client.avgUploadSpeed)"> - <span>{{ formatBytes(peak ? client.peakUploadSpeed : client.avgUploadSpeed) + '/s' }}</span> + <span>{{ formatSpeed(peak ? client.peakUploadSpeed : client.avgUploadSpeed) }}</span> </td> </tr> </tbody> @@ -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, |