Changeset 820c573


Ignore:
Timestamp:
Nov 3, 2009 8:37:21 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
8a1db31
Parents:
ab40454
Message:

tags

Location:
apps/routerconsole/java/src/net/i2p/router/web
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java

    rab40454 r820c573  
    8585        StringBuilder buf = new StringBuilder(4*1024);
    8686        buf.append("<h2>" + _("Network Database Contents") + "</h2>\n");
    87         buf.append("<a href=\"netdb.jsp\">" + _("View") + " RouterInfo</a>");
    88         buf.append("<h3>LeaseSets</h3>\n");
     87        buf.append("<a href=\"netdb.jsp\">" + _("View RouterInfo") + "</a>");
     88        buf.append("<h3>").append(_("LeaseSets")).append("</h3>\n");
    8989        Set leases = new TreeSet(new LeaseSetComparator());
    9090        leases.addAll(_context.netDb().getLeases());
     
    133133
    134134    public void renderStatusHTML(Writer out, boolean full) throws IOException {
    135         out.write("<h2>" + _("Network Database Contents") + " (<a href=\"netdb.jsp?l=1\">" + _("View") + " LeaseSets</a>)</h2>\n");
     135        out.write("<h2>" + _("Network Database Contents") + " (<a href=\"netdb.jsp?l=1\">" + _("View LeaseSets") + "</a>)</h2>\n");
    136136        if (!_context.netDb().isInitialized()) {
    137137            out.write(_("Not initialized"));
  • apps/routerconsole/java/src/net/i2p/router/web/ProfileOrganizerRenderer.java

    rab40454 r820c573  
    149149            buf.append("</td><td align=\"center\">");
    150150            if (_context.shitlist().isShitlisted(peer)) buf.append(_("Banned"));
    151             if (prof.getIsFailing()) buf.append(" ").append(_("Failing"));
    152             if (_context.commSystem().wasUnreachable(peer)) buf.append(" ").append(_("Unreachable"));
     151            if (prof.getIsFailing()) buf.append(' ').append(_("Failing"));
     152            if (_context.commSystem().wasUnreachable(peer)) buf.append(' ').append(_("Unreachable"));
    153153            Rate failed = prof.getTunnelHistory().getFailedRate().getRate(30*60*1000);
    154154            long fails = failed.getCurrentEventCount() + failed.getLastEventCount();
     
    157157                long total = fails + accepted.getCurrentEventCount() + accepted.getLastEventCount();
    158158                if (total / fails <= 10)   // hide if < 10%
    159                     buf.append(' ').append(fails).append('/').append(total).append(" ").append(_("Test Fails"));
     159                    buf.append(' ').append(fails).append('/').append(total).append(' ').append(_("Test Fails"));
    160160            }
    161161            buf.append("&nbsp;</td>");
     
    229229                buf.append("<td align=\"right\">").append(davg(dbh, 24*60*60*1000l)).append("</td>");
    230230            } else {
    231                 buf.append("<td align=\"right\">n/a<td align=\"right\">n/a<td align=\"right\">n/a<td align=\"right\">n/a<td align=\"right\">n/a<td align=\"right\">n/a");
     231                for (int i = 0; i < 6; i++)
     232                    buf.append("<td align=\"right\">").append(_(NA));
    232233            }
    233234        }
     
    235236
    236237        buf.append("<h3>").append(_("Thresholds:")).append("</h3>");
    237         buf.append("<p><b>").append(_("Speed")).append(":</b> ").append(num(_organizer.getSpeedThreshold())).append(" (").append(fast).append(" fast peers)<br>");
    238         buf.append("<b>").append(_("Capacity")).append(":</b> ").append(num(_organizer.getCapacityThreshold())).append(" (").append(reliable).append(" high capacity peers)<br>");
    239         buf.append("<b>").append(_("Integration")).append(":</b> ").append(num(_organizer.getIntegrationThreshold())).append(" (").append(integrated).append(" well integrated peers)</p>");
     238        buf.append("<p><b>").append(_("Speed")).append(":</b> ").append(num(_organizer.getSpeedThreshold()))
     239           .append(" (").append(fast).append(' ').append(_("fast peers")).append(")<br>");
     240        buf.append("<b>").append(_("Capacity")).append(":</b> ").append(num(_organizer.getCapacityThreshold()))
     241           .append(" (").append(reliable).append(' ').append(_("high capacity peers")).append(")<br>");
     242        buf.append("<b>").append(_("Integration")).append(":</b> ").append(num(_organizer.getIntegrationThreshold()))
     243           .append(" (").append(integrated).append(' ').append(_(" well integrated peers")).append(")</p>");
    240244        buf.append("<h3>").append(_("Definitions")).append(":</h3><ul>");
    241245                   buf.append("<li><b>").append(_("groups")).append("</b>: ").append(_("as determined by the profile organizer")).append("</li>");
     
    302306    private final static DecimalFormat _fmt = new DecimalFormat("###,##0.00");
    303307    private final static String num(double num) { synchronized (_fmt) { return _fmt.format(num); } }
    304     private final static String na = "n/a";
    305 
    306     private static String avg (PeerProfile prof, long rate) {
     308    private final static String NA = HelperBase._x("n/a");
     309
     310    private String avg (PeerProfile prof, long rate) {
    307311            RateStat rs = prof.getDbResponseTime();
    308312            if (rs == null)
    309                 return na;
     313                return _(NA);
    310314            Rate r = rs.getRate(rate);
    311315            if (r == null)
    312                 return na;
     316                return _(NA);
    313317            long c = r.getCurrentEventCount() + r.getLastEventCount();
    314318            if (c == 0)
    315                 return na;
     319                return _(NA);
    316320            double d = r.getCurrentTotalValue() + r.getLastTotalValue();
    317321            return Math.round(d/c) + "ms";
    318322    }
    319323
    320     private static String davg (DBHistory dbh, long rate) {
     324    private String davg (DBHistory dbh, long rate) {
    321325            RateStat rs = dbh.getFailedLookupRate();
    322326            if (rs == null)
    323                 return na;
     327                return _(NA);
    324328            Rate r = rs.getRate(rate);
    325329            if (r == null)
    326                 return na;
     330                return _(NA);
    327331            long c = r.getCurrentEventCount() + r.getLastEventCount();
    328332            return "" + c;
Note: See TracChangeset for help on using the changeset viewer.