Console: Improve error message when graphs disabled (ticket #2452)

This commit is contained in:
zzz
2019-04-18 13:17:45 +00:00
parent a8ad30b335
commit ea7ddaf6d5

View File

@ -19,6 +19,7 @@ import net.i2p.router.web.NavHelper;
import net.i2p.router.web.StatSummarizer;
import net.i2p.router.web.SummaryListener;
import net.i2p.stat.Rate;
import net.i2p.util.SystemVersion;
/**
* /graphs.jsp, including form, and /graph.jsp
@ -436,11 +437,17 @@ public class GraphHelper extends FormHandler {
@Override
public String getAllMessages() {
if (StatSummarizer.isDisabled(_context)) {
addFormError("Graphing not supported with this JVM: " +
System.getProperty("java.vendor") + ' ' +
addFormError("Graphing not supported with this JVM or OS");
addFormNotice("JVM: " + System.getProperty("java.vendor") + ' ' +
System.getProperty("java.version") + " (" +
System.getProperty("java.runtime.name") + ' ' +
System.getProperty("java.runtime.version") + ')');
addFormNotice("OS: " + System.getProperty("os.name") + ' ' +
System.getProperty("os.arch") + ' ' +
System.getProperty("os.version"));
if (!SystemVersion.isMac() && !SystemVersion.isWindows())
addFormNotice("Installing the fonts-dejavu package and then restarting I2P may resolve the issue");
addFormNotice("Check logs for more information");
if (_context.getProperty(PROP_REFRESH, 0) >= 0) {
// force no refresh, save silently
_context.router().saveConfig(PROP_REFRESH, "-1");