Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix for http://bugs.yacy.net/view.php?id=12

orbiter08108f0ece30
diff --git a/htroot/index.html b/htroot/index.html
index d449c1a49..9338e3bc7 100644
--- a/htroot/index.html
+++ b/htroot/index.html
@@ -85,20 +85,22 @@
</td>
</tr>
<tr>
+ #(resource-select)#::
<td><label for="resource">Resource</label>:</td>
<td>
<select id="resource" name="resource">
- <option value="global" #(resource-global)#::selected="selected"#(/resource-global)#
- #(resource-global-disabled)#::disabled="disabled"#(/resource-global-disabled)#>global</option>
- <option value="local" #(resource-local)#::selected="selected"#(/resource-local)#>local</option>
+ <option value="global" #(global)#::selected="selected"#(/global)#
+ #(global-disabled)#::disabled="disabled"#(/global-disabled)#>global</option>
+ <option value="local" #(local)#::selected="selected"#(/local)#>local</option>
</select>
- #(resource-global-disabled)#::
+ #(global-disabled)#::
Global search is disabled because<br />#(reason)#
<a class="lock" href="ConfigNetwork_p.html">DHT Distribution</a> is::
<a class="lock" href="ConfigNetwork_p.html">Index Receive</a> is::
<a class="lock" href="ConfigNetwork_p.html">DHT Distribution and Index Receive</a> are#(/reason)#
- disabled.#(/resource-global-disabled)#
+ disabled.#(/global-disabled)#
</td>
+ #(/resource-select)#
</tr>
<tr>
<td><label for="urlmaskfilter">URL mask</label>:</td>
diff --git a/htroot/index.java b/htroot/index.java
index 4ab2f9707..6414b972f 100644
--- a/htroot/index.java
+++ b/htroot/index.java
@@ -102,10 +102,11 @@ public class index {
prop.put("searchoptions_count-10", (count == 10) ? "1" : "0");
prop.put("searchoptions_count-50", (count == 50) ? "1" : "0");
prop.put("searchoptions_count-100", (count == 100) ? "1" : "0");
- prop.put("searchoptions_resource-global", global ? "1" : "0");
- prop.put("searchoptions_resource-global-disabled", (indexReceiveGranted && indexDistributeGranted) ? "0" : "1");
- prop.put("searchoptions_resource-global-disabled_reason", (indexReceiveGranted) ? "0" : (indexDistributeGranted ? "1" : "2"));
- prop.put("searchoptions_resource-local", global ? "0" : "1");
+ prop.put("searchoptions_resource-select", sb.peers.sizeConnected() > 0 ? 1 : 0);
+ prop.put("searchoptions_resource-select_global", global ? "1" : "0");
+ prop.put("searchoptions_resource-select_global-disabled", (indexReceiveGranted && indexDistributeGranted) ? "0" : "1");
+ prop.put("searchoptions_resource-select_global-disabled_reason", (indexReceiveGranted) ? "0" : (indexDistributeGranted ? "1" : "2"));
+ prop.put("searchoptions_resource-select_local", global ? "0" : "1");
prop.put("searchoptions_urlmaskoptions", "0");
prop.putHTML("searchoptions_urlmaskoptions_urlmaskfilter", urlmaskfilter);
prop.put("searchoptions_prefermaskoptions", "0");