summaryrefslogtreecommitdiffhomepage
path: root/applications
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-03-01 10:27:30 +0100
committerJo-Philipp Wich <jo@mein.io>2021-03-01 10:27:30 +0100
commit77d6b2893524df3c3a9e3df7c974ed054e0171ab (patch)
tree6eeebb151462305ed135105227d10da5cbdce8f7 /applications
parenta9da1dc5a5d33cd321d83f42fb16bc6bf9d77b5c (diff)
luci-app-nlbwmon: fix traffic numbers display in pie chart tooltips
The pie chart tooltips used base 1000 to format traffic numbers while table cell values were formatted using base 1024. Use base 1024 for both to report the same values. Fixes: #4759 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications')
-rw-r--r--applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js
index 6d57c12c5c..ccef949fb0 100644
--- a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js
+++ b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js
@@ -346,12 +346,12 @@ return view.extend({
trafData.push({
value: rec.rx_bytes + rec.tx_bytes,
- label: ["%s: %%.2mB".format(key), cell]
+ label: ["%s: %%1024.2mB".format(key), cell]
});
connData.push({
value: rec.conns,
- label: ["%s: %%.2m".format(key), cell]
+ label: ["%s: %%1000.2m".format(key), cell]
});
rx_total += rec.rx_bytes;
@@ -404,12 +404,12 @@ return view.extend({
rxData.push({
value: rec.rx_bytes,
- label: ["%s: %%.2mB".format(rec.layer7 || _('other')), cell]
+ label: ["%s: %%1024.2mB".format(rec.layer7 || _('other')), cell]
});
txData.push({
value: rec.tx_bytes,
- label: ["%s: %%.2mB".format(rec.layer7 || _('other')), cell]
+ label: ["%s: %%1024.2mB".format(rec.layer7 || _('other')), cell]
});
if (rec.layer7) {
@@ -533,14 +533,14 @@ return view.extend({
if (rx4_total > 0 || tx4_total > 0)
shareData.push({
value: rx4_total + tx4_total,
- label: ["IPv4: %.2mB"],
+ label: ["IPv4: %1024.2mB"],
color: 'hsl(140, 100%, 50%)'
});
if (rx6_total > 0 || tx6_total > 0)
shareData.push({
value: rx6_total + tx6_total,
- label: ["IPv6: %.2mB"],
+ label: ["IPv6: %1024.2mB"],
color: 'hsl(180, 100%, 50%)'
});