Files
i2p.i2p/apps/routerconsole/jsp/summary.jsi

56 lines
2.0 KiB
Plaintext
Raw Normal View History

2009-08-17 02:13:10 +00:00
<div class="routersummaryouter">
<%
// The refresh delay, 0 to disable
String d = "0";
boolean allowIFrame = intl.allowIFrame(request.getHeader("User-Agent"));
if (allowIFrame) {
// skip the iframe if refresh disabled
d = request.getParameter("refresh");
String newDelay = "";
if (d == null || "".equals(d))
d = intl.getRefresh();
else {
d = net.i2p.data.DataHelper.stripHTML(d); // XSS
// pass the new delay parameter to the iframe
newDelay = "?refresh=" + d;
}
if (!"0".equals(d))
out.print("<iframe src=\"/summaryframe.jsp" + newDelay + "\" height=\"1500\" width=\"200\" scrolling=\"auto\" frameborder=\"0\" title=\"sidepanel\">\n");
2010-01-02 02:43:18 +00:00
}
%>
<div class="routersummary">
<%
if (allowIFrame) {
// Display the whole summary bar
%>
<%@include file="summarynoframe.jsi" %>
<%
} else {
// Text browsers don't render the two divs side-by-side, so just provide a link
out.print("<a href=\"/summaryframe\">");
out.print(intl._("Summary Bar"));
out.print("</a>");
}
// d and allowIFrame defined above
if (!"0".equals(d)) {
out.print("</div></iframe>\n");
} else if (allowIFrame) {
// since we don't have an iframe this will reload the base page, and
// the new delay will be passed to the iframe above
out.print("<div class=\"refresh\"><form action=\"" + request.getRequestURI() + "\" method=\"POST\">\n" +
"<b>");
// We have intl defined when this is included, but not when compiled standalone.
2010-01-02 02:43:18 +00:00
out.print(intl._("Refresh (s)"));
out.print(":</b> <input size=\"3\" type=\"text\" name=\"refresh\" value=\"60\" >\n" +
"<button type=\"submit\" value=\"Enable\" >");
// ditto
2010-01-02 02:43:18 +00:00
out.print(intl._("Enable"));
out.print("</button>\n" +
"</form></div></div>\n");
} else {
out.print("</div>\n");
}
%>
2009-08-17 13:24:08 +00:00
</div>