forked from I2P_Developers/i2p.i2p
Console: Number format tweaks (ticket #1913)
This commit is contained in:
@ -532,7 +532,7 @@ public class SummaryHelper extends HelperBase {
|
|||||||
if (_context == null)
|
if (_context == null)
|
||||||
return "0";
|
return "0";
|
||||||
long received = _context.bandwidthLimiter().getTotalAllocatedInboundBytes();
|
long received = _context.bandwidthLimiter().getTotalAllocatedInboundBytes();
|
||||||
return DataHelper.formatSize2(received) + 'B';
|
return DataHelper.formatSize2Decimal(received) + 'B';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -544,7 +544,7 @@ public class SummaryHelper extends HelperBase {
|
|||||||
if (_context == null)
|
if (_context == null)
|
||||||
return "0";
|
return "0";
|
||||||
long sent = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes();
|
long sent = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes();
|
||||||
return DataHelper.formatSize2(sent) + 'B';
|
return DataHelper.formatSize2Decimal(sent) + 'B';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -142,7 +142,7 @@ class TunnelRenderer {
|
|||||||
out.write("<td class=\"cells\" align=\"center\">" + DataHelper.formatDuration2(timeLeft) + "</td>");
|
out.write("<td class=\"cells\" align=\"center\">" + DataHelper.formatDuration2(timeLeft) + "</td>");
|
||||||
else
|
else
|
||||||
out.write("<td class=\"cells\" align=\"center\">(" + _t("grace period") + ")</td>");
|
out.write("<td class=\"cells\" align=\"center\">(" + _t("grace period") + ")</td>");
|
||||||
out.write("<td class=\"cells\" align=\"center\">" + count + " KB</td>");
|
out.write("<td class=\"cells\" align=\"center\">" + (count * 1024 / 1000) + " KB</td>");
|
||||||
int lifetime = (int) ((_context.clock().now() - cfg.getCreation()) / 1000);
|
int lifetime = (int) ((_context.clock().now() - cfg.getCreation()) / 1000);
|
||||||
if (lifetime <= 0)
|
if (lifetime <= 0)
|
||||||
lifetime = 1;
|
lifetime = 1;
|
||||||
@ -166,7 +166,7 @@ class TunnelRenderer {
|
|||||||
out.write("<div class=\"statusnotes\"><b>" + _t("Inactive participating tunnels") + ": " + inactive + "</b></div>\n");
|
out.write("<div class=\"statusnotes\"><b>" + _t("Inactive participating tunnels") + ": " + inactive + "</b></div>\n");
|
||||||
else if (displayed <= 0)
|
else if (displayed <= 0)
|
||||||
out.write("<div class=\"statusnotes\"><b>" + _t("none") + "</b></div>\n");
|
out.write("<div class=\"statusnotes\"><b>" + _t("none") + "</b></div>\n");
|
||||||
out.write("<div class=\"statusnotes\"><b>" + _t("Lifetime bandwidth usage") + ": " + DataHelper.formatSize2(processed*1024) + "B</b></div>\n");
|
out.write("<div class=\"statusnotes\"><b>" + _t("Lifetime bandwidth usage") + ": " + DataHelper.formatSize2Decimal(processed*1024) + "B</b></div>\n");
|
||||||
} else {
|
} else {
|
||||||
out.write("<div class=\"statusnotes noparticipate\"><b>" + _t("Not enough shared bandwidth to build participating tunnels.") +
|
out.write("<div class=\"statusnotes noparticipate\"><b>" + _t("Not enough shared bandwidth to build participating tunnels.") +
|
||||||
"</b> <a href=\"config\">[" + _t("Configure") + "]</a></div>\n");
|
"</b> <a href=\"config\">[" + _t("Configure") + "]</a></div>\n");
|
||||||
@ -247,8 +247,8 @@ class TunnelRenderer {
|
|||||||
out.write("<tr><td class=\"cells\" align=\"center\"><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"" +
|
out.write("<tr><td class=\"cells\" align=\"center\"><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"" +
|
||||||
_t("Outbound") + "\"></td>");
|
_t("Outbound") + "\"></td>");
|
||||||
out.write("<td class=\"cells\" align=\"center\">" + DataHelper.formatDuration2(timeLeft) + "</td>\n");
|
out.write("<td class=\"cells\" align=\"center\">" + DataHelper.formatDuration2(timeLeft) + "</td>\n");
|
||||||
int count = info.getProcessedMessagesCount();
|
int count = info.getProcessedMessagesCount() * 1024 / 1000;
|
||||||
out.write("<td class=\"cells\" align=\"center\">" + count + " KiB</td>\n");
|
out.write("<td class=\"cells\" align=\"center\">" + count + " KB</td>\n");
|
||||||
for (int j = 0; j < info.getLength(); j++) {
|
for (int j = 0; j < info.getLength(); j++) {
|
||||||
Hash peer = info.getPeer(j);
|
Hash peer = info.getPeer(j);
|
||||||
TunnelId id = (info.isInbound() ? info.getReceiveTunnelId(j) : info.getSendTunnelId(j));
|
TunnelId id = (info.isInbound() ? info.getReceiveTunnelId(j) : info.getSendTunnelId(j));
|
||||||
@ -297,8 +297,8 @@ class TunnelRenderer {
|
|||||||
if (live <= 0)
|
if (live <= 0)
|
||||||
out.write("<div class=\"statusnotes\"><center><b>" + _t("No tunnels; waiting for the grace period to end.") + "</b></center></div>\n");
|
out.write("<div class=\"statusnotes\"><center><b>" + _t("No tunnels; waiting for the grace period to end.") + "</b></center></div>\n");
|
||||||
out.write("<div class=\"statusnotes\"><center><b>" + _t("Lifetime bandwidth usage") + ": " +
|
out.write("<div class=\"statusnotes\"><center><b>" + _t("Lifetime bandwidth usage") + ": " +
|
||||||
DataHelper.formatSize2(processedIn*1024) + "B " + _t("in") + ", " +
|
DataHelper.formatSize2Decimal(processedIn*1024) + "B " + _t("in") + ", " +
|
||||||
DataHelper.formatSize2(processedOut*1024) + "B " + _t("out") + "</b></center></div>");
|
DataHelper.formatSize2Decimal(processedOut*1024) + "B " + _t("out") + "</b></center></div>");
|
||||||
}
|
}
|
||||||
|
|
||||||
/****
|
/****
|
||||||
|
Reference in New Issue
Block a user