summaryrefslogtreecommitdiff
path: root/htroot
diff options
context:
space:
mode:
authorlotus <lotus@6c8d7289-2bf4-0310-a012-ef5d649a1542>2009-03-07 15:31:24 +0000
committerlotus <lotus@6c8d7289-2bf4-0310-a012-ef5d649a1542>2009-03-07 15:31:24 +0000
commit8ee946bf1d02db51aa6e8993aace78da71dc88ee (patch)
tree1b10b88d65a171d1c82b85238143e522f1803493 /htroot
parentf0947a20a871d82739c4f043662a98415fa04818 (diff)
show upnp status
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5679 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot')
-rw-r--r--htroot/ConfigBasic.html1
-rw-r--r--htroot/ConfigBasic.java5
2 files changed, 5 insertions, 1 deletions
diff --git a/htroot/ConfigBasic.html b/htroot/ConfigBasic.html
index c60f32407..4e6e91d9a 100644
--- a/htroot/ConfigBasic.html
+++ b/htroot/ConfigBasic.html
@@ -86,6 +86,7 @@
</dt>
<dd>
<input type="checkbox" name="enableUpnp" id="enableUpnp" align="top" #(enabled)#::checked="checked"#(/enabled)# />
+ #(success)#::<img src="/env/grafics/bad.png" height="16" width="16" alt="warning" /> Configuration was not successful. This may take a moment.::<img src="/env/grafics/ok.png" height="16" width="16" alt="ok" />#(/success)#
</dd>#(/upnp)#
</dl>
</fieldset>
diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java
index 428bbfa0a..2ee2915cb 100644
--- a/htroot/ConfigBasic.java
+++ b/htroot/ConfigBasic.java
@@ -212,8 +212,11 @@ public class ConfigBasic {
prop.put("nextStep", NEXTSTEP_FINISHED);
}
+ final boolean upnp_enabled = env.getConfigBool(plasmaSwitchboardConstants.UPNP_ENABLED, false);
prop.put("upnp", "1");
- prop.put("upnp_enabled", (env.getConfigBool(plasmaSwitchboardConstants.UPNP_ENABLED, false)) ? "1" : "0");
+ prop.put("upnp_enabled", upnp_enabled ? "1" : "0");
+ if (upnp_enabled) prop.put("upnp_success", (UPnP.getMappedPort() > 0) ? "2" : "1");
+ else prop.put("upnp_success", "0");
// set default values
prop.putHTML("defaultName", env.getConfig("peerName", ""));