formatSize cleanups
This commit is contained in:
@ -142,7 +142,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
||||
buf.append(_pct.format(pct));
|
||||
}
|
||||
buf.append(": ");
|
||||
buf.append(_("{0}B transferred", DataHelper.formatSize(currentWrite + alreadyTransferred)));
|
||||
buf.append(_("{0}B transferred", DataHelper.formatSize2(currentWrite + alreadyTransferred)));
|
||||
updateStatus(buf.toString());
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ public class TunnelRenderer {
|
||||
out.write("<td class=\"cells\" align=\"center\">" + DataHelper.formatDuration(timeLeft) + "</td>");
|
||||
else
|
||||
out.write("<td class=\"cells\" align=\"center\">(" + _("grace period") + ")</td>");
|
||||
out.write("<td class=\"cells\" align=\"center\">" + cfg.getProcessedMessagesCount() + "KB</td>");
|
||||
out.write("<td class=\"cells\" align=\"center\">" + cfg.getProcessedMessagesCount() + " KB</td>");
|
||||
int lifetime = (int) ((_context.clock().now() - cfg.getCreation()) / 1000);
|
||||
if (lifetime <= 0)
|
||||
lifetime = 1;
|
||||
@ -124,7 +124,7 @@ public class TunnelRenderer {
|
||||
}
|
||||
out.write("</table>\n");
|
||||
out.write("<div class=\"statusnotes\"><b>" + _("Inactive participating tunnels") + ": " + inactive + "</b></div>\n");
|
||||
out.write("<div class=\"statusnotes\"><b>" + _("Lifetime bandwidth usage") + ": " + DataHelper.formatSize(processed*1024) + "B</b></div>\n");
|
||||
out.write("<div class=\"statusnotes\"><b>" + _("Lifetime bandwidth usage") + ": " + DataHelper.formatSize2(processed*1024) + "B</b></div>\n");
|
||||
renderPeers(out);
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ public class TunnelRenderer {
|
||||
else
|
||||
out.write("<tr> <td class=\"cells\" align=\"center\"><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"Outbound\"></td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + DataHelper.formatDuration(timeLeft) + "</td>\n");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + info.getProcessedMessagesCount() + "KB</td>\n");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + info.getProcessedMessagesCount() + " KB</td>\n");
|
||||
for (int j = 0; j < info.getLength(); j++) {
|
||||
Hash peer = info.getPeer(j);
|
||||
TunnelId id = (info.isInbound() ? info.getReceiveTunnelId(j) : info.getSendTunnelId(j));
|
||||
@ -215,8 +215,9 @@ public class TunnelRenderer {
|
||||
}
|
||||
if (live <= 0)
|
||||
out.write("<div class=\"statusnotes\"><center><b>" + _("No tunnels; waiting for the grace period to end.") + "</center></b></div>\n");
|
||||
out.write("<div class=\"statusnotes\"><center><b>" + _("Lifetime bandwidth usage") + ": " + DataHelper.formatSize(processedIn*1024) + "B " + _("in") + ", " +
|
||||
DataHelper.formatSize(processedOut*1024) + "B " + _("out") + "</b></center></div>");
|
||||
out.write("<div class=\"statusnotes\"><center><b>" + _("Lifetime bandwidth usage") + ": " +
|
||||
DataHelper.formatSize2(processedIn*1024) + "B " + _("in") + ", " +
|
||||
DataHelper.formatSize2(processedOut*1024) + "B " + _("out") + "</b></center></div>");
|
||||
}
|
||||
|
||||
private void renderPeers(Writer out) throws IOException {
|
||||
|
@ -176,7 +176,7 @@ public class UpdateHandler {
|
||||
buf.append(_pct.format(pct));
|
||||
}
|
||||
buf.append(":<br>\n");
|
||||
buf.append(_("{0}B transferred", DataHelper.formatSize(currentWrite + alreadyTransferred)));
|
||||
buf.append(_("{0}B transferred", DataHelper.formatSize2(currentWrite + alreadyTransferred)));
|
||||
updateStatus(buf.toString());
|
||||
}
|
||||
public void transferComplete(long alreadyTransferred, long bytesTransferred, long bytesRemaining, String url, String outputFile, boolean notModified) {
|
||||
|
Reference in New Issue
Block a user