* graphs.jsp: Tag some more
This commit is contained in:
@ -79,19 +79,21 @@ public class GraphHelper extends HelperBase {
|
|||||||
+ "&width=" + (3 * _width)
|
+ "&width=" + (3 * _width)
|
||||||
+ "&height=" + (3 * _height)
|
+ "&height=" + (3 * _height)
|
||||||
+ "\" / target=\"_blank\">");
|
+ "\" / target=\"_blank\">");
|
||||||
|
String title = _("Combined bandwidth graph");
|
||||||
_out.write("<img class=\"statimage\" width=\""
|
_out.write("<img class=\"statimage\" width=\""
|
||||||
+ (_width + 83) + "\" height=\"" + (_height + 92)
|
+ (_width + 83) + "\" height=\"" + (_height + 92)
|
||||||
+ "\" src=\"viewstat.jsp?stat=bw.combined"
|
+ "\" src=\"viewstat.jsp?stat=bw.combined"
|
||||||
+ "&periodCount=" + _periodCount
|
+ "&periodCount=" + _periodCount
|
||||||
+ "&width=" + _width
|
+ "&width=" + _width
|
||||||
+ "&height=" + (_height - 14)
|
+ "&height=" + (_height - 14)
|
||||||
+ "\" alt=\"Combined bandwidth graph\" title=\"Combined bandwidth graph\"></a>\n");
|
+ "\" alt=\"" + title + "\" title=\"" + title + "\"></a>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Iterator iter = ordered.iterator(); iter.hasNext(); ) {
|
for (Iterator iter = ordered.iterator(); iter.hasNext(); ) {
|
||||||
SummaryListener lsnr = (SummaryListener)iter.next();
|
SummaryListener lsnr = (SummaryListener)iter.next();
|
||||||
Rate r = lsnr.getRate();
|
Rate r = lsnr.getRate();
|
||||||
String title = r.getRateStat().getName() + " for " + DataHelper.formatDuration(_periodCount * r.getPeriod());
|
// e.g. "statname for 60m"
|
||||||
|
String title = _("{0} for {1}", r.getRateStat().getName(), DataHelper.formatDuration(_periodCount * r.getPeriod()));
|
||||||
_out.write("<a href=\"viewstat.jsp?stat="
|
_out.write("<a href=\"viewstat.jsp?stat="
|
||||||
+ r.getRateStat().getName()
|
+ r.getRateStat().getName()
|
||||||
+ "&showEvents=" + _showEvents
|
+ "&showEvents=" + _showEvents
|
||||||
|
@ -51,6 +51,11 @@ public abstract class HelperBase {
|
|||||||
return Messages.getString(s, o, _context);
|
return Messages.getString(s, o, _context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** two params @since 0.7.14 */
|
||||||
|
public String _(String s, Object o, Object o2) {
|
||||||
|
return Messages.getString(s, o, o2, _context);
|
||||||
|
}
|
||||||
|
|
||||||
/** translate (ngettext) @since 0.7.14 */
|
/** translate (ngettext) @since 0.7.14 */
|
||||||
public String _(int n, String s, String p) {
|
public String _(int n, String s, String p) {
|
||||||
return Messages.getString(n, s, p, _context);
|
return Messages.getString(n, s, p, _context);
|
||||||
|
@ -30,6 +30,11 @@ public class Messages extends Translate {
|
|||||||
return Translate.getString(s, o, ctx, BUNDLE_NAME);
|
return Translate.getString(s, o, ctx, BUNDLE_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** two params @since 0.7.14 */
|
||||||
|
public static String getString(String s, Object o, Object o2, I2PAppContext ctx) {
|
||||||
|
return Translate.getString(s, o, o2, ctx, BUNDLE_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
/** translate (ngettext) @since 0.7.14 */
|
/** translate (ngettext) @since 0.7.14 */
|
||||||
public static String getString(int n, String s, String p, I2PAppContext ctx) {
|
public static String getString(int n, String s, String p, I2PAppContext ctx) {
|
||||||
return Translate.getString(n, s, p, ctx, BUNDLE_NAME);
|
return Translate.getString(n, s, p, ctx, BUNDLE_NAME);
|
||||||
|
@ -170,6 +170,7 @@ public class StatSummarizer implements Runnable {
|
|||||||
def.setTimePeriod(start/1000, 0);
|
def.setTimePeriod(start/1000, 0);
|
||||||
def.setLowerLimit(0d);
|
def.setLowerLimit(0d);
|
||||||
def.setBaseValue(1024);
|
def.setBaseValue(1024);
|
||||||
|
// Note to translators: all runtime zh translation disabled in this file, no font available in RRD
|
||||||
String title = _("Bandwidth usage");
|
String title = _("Bandwidth usage");
|
||||||
if (!hideTitle)
|
if (!hideTitle)
|
||||||
def.setTitle(title);
|
def.setTitle(title);
|
||||||
|
@ -80,6 +80,7 @@ class SummaryRenderer {
|
|||||||
String title;
|
String title;
|
||||||
String p = DataHelper.formatDuration(_listener.getRate().getPeriod());
|
String p = DataHelper.formatDuration(_listener.getRate().getPeriod());
|
||||||
if (showEvents)
|
if (showEvents)
|
||||||
|
// Note to translators: all runtime zh translation disabled in this file, no font available in RRD
|
||||||
title = name + ' ' + _("events in {0}", p);
|
title = name + ' ' + _("events in {0}", p);
|
||||||
else
|
else
|
||||||
title = name + ' ' + _("averaged for {0}", p);
|
title = name + ' ' + _("averaged for {0}", p);
|
||||||
@ -96,7 +97,11 @@ class SummaryRenderer {
|
|||||||
} else {
|
} else {
|
||||||
// include the average value
|
// include the average value
|
||||||
plotName = dsNames[0];
|
plotName = dsNames[0];
|
||||||
descr = _listener.getRate().getRateStat().getDescription();
|
// The descriptions are not tagged in the createRateStat calls
|
||||||
|
// (there are over 500 of them)
|
||||||
|
// but the descriptions for the default graphs are tagged in
|
||||||
|
// Strings.java
|
||||||
|
descr = _(_listener.getRate().getRateStat().getDescription());
|
||||||
}
|
}
|
||||||
def.datasource(plotName, path, plotName, "AVERAGE", "MEMORY");
|
def.datasource(plotName, path, plotName, "AVERAGE", "MEMORY");
|
||||||
def.area(plotName, Color.BLUE, descr + "@r");
|
def.area(plotName, Color.BLUE, descr + "@r");
|
||||||
|
@ -96,5 +96,12 @@ class Dummy {
|
|||||||
_("itag1");
|
_("itag1");
|
||||||
_("itag2");
|
_("itag2");
|
||||||
|
|
||||||
|
// Descriptions for the stats that are graphed by default
|
||||||
|
// There are over 500 stats currently defined, we aren't going to tag them all
|
||||||
|
_("Low-level bandwidth receive rate"); // bw.recvRate
|
||||||
|
_("Low-level bandwidth send rate"); // bw.sendRate
|
||||||
|
_("How many peers we are actively talking with"); // router.activePeers
|
||||||
|
// router.memoryUsed currently has the max size in the description so it can't be tagged
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user