" + _t("All times are UTC.") + "
\n"); } catch (IOException ioe) { ioe.printStackTrace(); } return ""; } /** * For single stat page; * stat = "bw.combined" treated specially * * @since 0.9 */ public String getSingleStat() { try { if (StatSummarizer.isDisabled()) return ""; if (_stat == null) { _out.write("No stat specified"); return ""; } long period; String name, displayName; if (_stat.equals("bw.combined")) { period = 60000; name = _stat; displayName = _t("Bandwidth usage"); } else { Set\n");
if (_width < MAX_X && _height < MAX_Y) {
_out.write(link(_stat, _showEvents, _periodCount, _end, _width * 3 / 2, _height * 3 / 2));
_out.write(_t("Larger"));
_out.write(" - ");
}
if (_width > MIN_X && _height > MIN_Y) {
_out.write(link(_stat, _showEvents, _periodCount, _end, _width * 2 / 3, _height * 2 / 3));
_out.write(_t("Smaller"));
_out.write(" - ");
}
if (_height < MAX_Y) {
_out.write(link(_stat, _showEvents, _periodCount, _end, _width, _height * 3 / 2));
_out.write(_t("Taller"));
_out.write(" - ");
}
if (_height > MIN_Y) {
_out.write(link(_stat, _showEvents, _periodCount, _end, _width, _height * 2 / 3));
_out.write(_t("Shorter"));
_out.write(" - ");
}
if (_width < MAX_X) {
_out.write(link(_stat, _showEvents, _periodCount, _end, _width * 3 / 2, _height));
_out.write(_t("Wider"));
_out.write(" - ");
}
if (_width > MIN_X) {
_out.write(link(_stat, _showEvents, _periodCount, _end, _width * 2 / 3, _height));
_out.write(_t("Narrower"));
_out.write("");
}
_out.write("
");
if (_periodCount < MAX_C) {
_out.write(link(_stat, _showEvents, _periodCount * 2, _end, _width, _height));
_out.write(_t("Larger interval"));
_out.write(" - ");
}
if (_periodCount > MIN_C) {
_out.write(link(_stat, _showEvents, _periodCount / 2, _end, _width, _height));
_out.write(_t("Smaller interval"));
_out.write("");
}
_out.write("
");
if (_periodCount < MAX_C) {
_out.write(link(_stat, _showEvents, _periodCount, _end + _periodCount, _width, _height));
_out.write(_t("Previous interval"));
_out.write("");
}
if (_end > 0) {
int end = _end - _periodCount;
if (end <= 0)
end = 0;
if (_periodCount < MAX_C)
_out.write(" - ");
_out.write(link(_stat, _showEvents, _periodCount, end, _width, _height));
_out.write(_t("Next interval"));
_out.write(" ");
}
_out.write("
");
_out.write(link(_stat, !_showEvents, _periodCount, _end, _width, _height));
if (!_stat.equals("bw.combined"))
_out.write(_showEvents ? _t("Plot averages") : _t("plot events"));
_out.write("");
_out.write("
" + _t("All times are UTC.") + "
\n"); } catch (IOException ioe) { ioe.printStackTrace(); } return ""; } /** @since 0.9 */ private static String link(String stat, boolean showEvents, int periodCount, int end, int width, int height) { return " 0 ? "&e=" + end : "") + (showEvents ? "&showEvents=1" : "") + "\">"; } private static final int[] times = { 15, 30, 60, 2*60, 5*60, 10*60, 30*60, 60*60, -1 }; public String getForm() { if (StatSummarizer.isDisabled()) return ""; // too hard to use the standard formhandler.jsi / FormHandler.java session nonces // since graphs.jsp needs the refresh value in its . // So just use the "shared/console nonce". String nonce = CSSHelper.getNonce(); try { _out.write("