return true;
}
@Override
public HTMLNode getHTMLText() {
HTMLNode textNode = new HTMLNode("div");
SubConfig sc = node.config.get("node");
Option<?> o = sc.getOption("tempIPAddressHint");
NodeL10n.getBase().addL10nSubstitution(textNode, "IPUndetectedUserAlert."+(node.ipDetector.isDetecting() ? "detectingWithConfigLink" : "unknownAddressWithConfigLink"),
new String[] { "link" },
new HTMLNode[] { HTMLNode.link("/config/"+sc.getPrefix()) });
int peers = node.peers.getDarknetPeers().length;
if(peers > 0)
textNode.addChild("p", l10n("noIPMaybeFromPeers", "number", Integer.toString(peers)));
if(node.ipDetector.noDetectPlugins()) {
HTMLNode p = textNode.addChild("p");
NodeL10n.getBase().addL10nSubstitution(p, "IPUndetectedUserAlert.loadDetectPlugins", new String[] { "plugins", "config", },
new HTMLNode[] { HTMLNode.link("/plugins/"), HTMLNode.link("/config/node") });
} else if(!node.ipDetector.hasJSTUN() && !node.ipDetector.isDetecting()) {
HTMLNode p = textNode.addChild("p");
NodeL10n.getBase().addL10nSubstitution(p, "IPUndetectedUserAlert.loadJSTUN", new String[] { "plugins" },
new HTMLNode[] { HTMLNode.link("/plugins/") });
}
addPortForwardSuggestion(textNode);
HTMLNode formNode = textNode.addChild("form", new String[] { "action", "method" }, new String[] { "/config/"+sc.getPrefix(), "post" });
formNode.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "formPassword", node.clientCore.formPassword });
formNode.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "subconfig", sc.getPrefix() });
HTMLNode listNode = formNode.addChild("ul", "class", "config");
HTMLNode itemNode = listNode.addChild("li");
itemNode.addChild("span", "class", "configshortdesc", o.getLocalisedShortDesc()).addChild("input", new String[] { "type", "name", "value" }, new String[] { "text", sc.getPrefix() + ".tempIPAddressHint", o.getValueDisplayString() });
itemNode.addChild("span", "class", "configlongdesc", o.getLocalisedLongDesc());
formNode.addChild("input", new String[] { "type", "value" }, new String[] { "submit", NodeL10n.getBase().getString("UserAlert.apply") });
formNode.addChild("input", new String[] { "type", "value" }, new String[] { "reset", NodeL10n.getBase().getString("UserAlert.reset") });
return textNode;
}