I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit fa3e3e07 authored by str4d's avatar str4d
Browse files

Enforcing minimum refresh rate better, and reducing it to 3 seconds

This does mean that the iframe don't-refresh state (= refresh rate of 0 seconds)
doesn't hold if the page is changed (in fact, the refresh rate becomes the
minimum) - so maybe better to have a different config var for that?
parent 296ddbe9
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ public class CSSHelper extends HelperBase {
private static final String FORCE = "classic";
public static final String PROP_REFRESH = "routerconsole.summaryRefresh";
public static final String DEFAULT_REFRESH = "60";
public static final int MIN_REFRESH = 5;
public static final int MIN_REFRESH = 3;
private static final String PROP_XFRAME = "routerconsole.disableXFrame";
public String getTheme(String userAgent) {
......@@ -71,12 +71,23 @@ public class CSSHelper extends HelperBase {
/** change refresh and save it */
public void setRefresh(String r) {
try {
if (Integer.parseInt(r) < MIN_REFRESH)
r = "" + MIN_REFRESH;
} catch (Exception e) {
}
_context.router().saveConfig(PROP_REFRESH, r);
}
/** @return refresh time in seconds, as a string */
public String getRefresh() {
return _context.getProperty(PROP_REFRESH, DEFAULT_REFRESH);
String r = _context.getProperty(PROP_REFRESH, DEFAULT_REFRESH);
try {
if (Integer.parseInt(r) < MIN_REFRESH)
r = "" + MIN_REFRESH;
} catch (Exception e) {
}
return r;
}
/** translate the title and display consistently */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment