Used relative URLs in ConfigPortal preview frames.

This is more reliable when YaCy is behind a reverse proxy.

Also updated integration examples to keep the current protocol part
(http or https) in the example address.
pull/93/head
luccioman 8 years ago
parent 2da5f339f8
commit 3444d947ac

@ -139,7 +139,7 @@
</h3>
<fieldset><pre>
&lt;iframe name=&quot;target&quot;
src=&quot;http://#[myaddress]#/index.html?display=2&amp;resource=local&quot;
src=&quot;#[myContext]#/index.html?display=2&amp;resource=local&quot;
width=&quot;100%&quot;
height=&quot;410&quot;
frameborder=&quot;0&quot;
@ -149,7 +149,7 @@
</pre></fieldset>
This would look like:
<iframe name="target"
src="#[myPreviewContext]#/index.html?display=2&amp;resource=local&amp;focus=0"
src="index.html?display=2&amp;resource=local&amp;focus=0"
width="100%"
height="410"
frameborder="0"
@ -162,7 +162,7 @@
</h3>
<fieldset><pre>
&lt;iframe name=&quot;target2&quot;
src=&quot;http://#[myaddress]#/yacysearch.html?display=2&amp;resource=local&quot;
src=&quot;#[myContext]#/yacysearch.html?display=2&amp;resource=local&quot;
width=&quot;100%&quot;
height=&quot;180&quot;
frameborder=&quot;0&quot;
@ -172,7 +172,7 @@
</pre></fieldset>
This would look like:
<iframe name="target2"
src="#[myPreviewContext]#/yacysearch.html?display=2&amp;resource=local&amp;focus=0"
src="yacysearch.html?display=2&amp;resource=local&amp;focus=0"
width="100%"
height="180"
frameborder="0"
@ -186,7 +186,7 @@
</h3>
<fieldset><pre>
&lt;iframe name="target3"
src=&quot;http://#[myaddress]#/yacyinteractive.html?display=2&quot;
src=&quot;#[myContext]#/yacyinteractive.html?display=2&quot;
width=&quot;100%&quot;
height=&quot;180&quot;
frameborder=&quot;0&quot;
@ -196,7 +196,7 @@
</pre></fieldset>
This would look like:
<iframe name="target3"
src="#[myPreviewContext]#/yacyinteractive.html?display=2&amp;focus=0"
src="yacyinteractive.html?display=2&amp;focus=0"
width="100%"
height="180"
frameborder="0"

@ -228,14 +228,7 @@ public class ConfigPortal {
prop.put("target_selected_special_searchresult", "searchresult".equals(target_special) ? 1 : 0);
prop.put("target_special_pattern", sb.getConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, ""));
/* Address used in code template */
String myaddress = (sb.peers == null) || sb.peers.mySeed() == null || sb.peers.mySeed().getIPs().isEmpty() ? null : sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIPs().iterator().next());
if (myaddress == null) {
myaddress = "localhost:" + sb.getLocalPort();
}
prop.put("myaddress", myaddress);
prop.put("myPreviewContext", YaCyDefaultServlet.getContext(header, sb));
prop.put("myContext", YaCyDefaultServlet.getContext(header, sb));
return prop;
}

Loading…
Cancel
Save