- Refactor handling of required stats
    - Shorten description of required stats
    - Improve save messages on configstats.jsp
    - Change bw.sendBps and bw.receiveBps stats to bytes, not Kbytes
    - Expires directive for graphs
This commit is contained in:
zzz
2011-03-21 18:14:58 +00:00
parent ddddc686fe
commit 40fd4ccd15
27 changed files with 139 additions and 136 deletions

View File

@@ -104,14 +104,21 @@ public class ConfigStatsHandler extends FormHandler {
}
_context.router().setConfigSetting(StatManager.PROP_STAT_FILTER, stats.toString());
boolean graphsChanged = !_graphs.equals(_context.getProperty("stat.summaries"));
_context.router().setConfigSetting("stat.summaries", _graphs);
boolean fullChanged = _context.getBooleanProperty(StatManager.PROP_STAT_FULL) != _isFull;
_context.router().setConfigSetting(StatManager.PROP_STAT_FULL, "" + _isFull);
boolean ok = _context.router().saveConfig();
if (ok)
_context.router().saveConfig();
if (!_stats.isEmpty())
addFormNotice(_("Stat filter and location updated successfully to") + ": " + stats.toString());
else
addFormError(_("Failed to update the stat filter and location"));
addFormNotice(_("Graph list updated, may take up to 60s to be reflected here and on the <a href=\"graphs.jsp\">Graphs Page</a>"));
if (fullChanged) {
if (_isFull)
addFormNotice(_("Full statistics enabled - restart required to take effect"));
else
addFormNotice(_("Full statistics disabled - restart required to take effect"));
}
if (graphsChanged)
addFormNotice(_("Graph list updated, may take up to 60s to be reflected here and on the <a href=\"graphs.jsp\">Graphs Page</a>"));
}
}