Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
hero page modification for YaCy Chat
Michael Peter Christen106730d36b4b
diff --git a/defaults/yacy.init b/defaults/yacy.initindex dd0db4496..a08516364 100644--- a/defaults/yacy.init+++ b/defaults/yacy.init@@ -347,7 +347,8 @@ parser.pdf.individualpages.key=page# These strings appear in the Web Mask of the YACY search client# Set these Strings to cusomize your peer and give any message to# other peer users-promoteSearchPageGreeting = search...+promoteSearchPageGreeting = Your Own Search Engine+promoteChatPageGreeting = Private Chat with Your Own Knowledge# if the following property is set to true, the network name is used as greetingpromoteSearchPageGreeting.useNetworkName = false# the following attributes can be used to define a custom image, alternative text and home page on the search pagediff --git a/htroot/yacychat.html b/htroot/yacychat.htmlindex cfe815291..294da5eee 100644--- a/htroot/yacychat.html+++ b/htroot/yacychat.html@@ -729,8 +729,19 @@#%env/templates/submenuAI.template%##(/topmenu)#+ #(topmenu)#+ <script>document.getElementById("greeting-icon").src="env/grafics/invisible.png"</script>+ <h2 class="yacy"><a href="#[promoteSearchPageGreeting.homepage]#" class="yacylogo"><img src="#[promoteSearchPageGreeting.largeImage]#" alt="#[promoteSearchPageGreeting.imageAlt]#" style="margin: auto;"/></a></h2>+ <h2 class="yacy">#[promoteChatPageGreeting]#</h2>+ ::+ <script>document.getElementById("greeting-icon").src="env/grafics/invisible.png"</script>+ <h2 class="yacy"><a href="#[promoteSearchPageGreeting.homepage]#" class="yacylogo"><img src="#[promoteSearchPageGreeting.largeImage]#" alt="#[promoteSearchPageGreeting.imageAlt]#" style="margin: auto;"/></a></h2>+ <h2 class="yacy">#[promoteChatPageGreeting]#</h2>+ ::+ #(/topmenu)#+<h2>YaCy Chat</h2>- <p>Chat with your configured LLM using the local YaCy settings. Requests are sent to the same host that served this page.</p>+ <p>This Chat is private. YaCy does not keep any history — only your browser remembers the current conversation.</p><div class="chat-panel"><div class="chat-flow">diff --git a/source/net/yacy/htroot/yacychat.java b/source/net/yacy/htroot/yacychat.javaindex 5545d2e57..0037d4f04 100644--- a/source/net/yacy/htroot/yacychat.java+++ b/source/net/yacy/htroot/yacychat.java@@ -6,6 +6,7 @@ import org.json.JSONTokener;import net.yacy.cora.protocol.RequestHeader;import net.yacy.search.Switchboard;+import net.yacy.search.SwitchboardConstants;import net.yacy.server.serverObjects;import net.yacy.server.serverSwitch;@@ -30,6 +31,20 @@ public class yacychat {final String systemPrompt = sb.getConfig("ai.system-prompt", net.yacy.http.servlets.RAGProxyServlet.LLM_SYSTEM_PROMPT_DEFAULT);prop.put("system_prompt", systemPrompt);prop.put("topmenu", sb.getConfigBool("ai.shield.show-chat-link", false) ? (sb.getConfigBool("publicTopmenu", true) ? 1 : 0) : 2);++ String promoteChatPageGreeting = env.getConfig("promoteChatPageGreeting", "");+ if (env.getConfigBool(SwitchboardConstants.GREETING_NETWORK_NAME, false)) {+ promoteChatPageGreeting = env.getConfig("network.unit.description", "");+ }+ prop.put("promoteChatPageGreeting", promoteChatPageGreeting);+ prop.put("topmenu_promoteChatPageGreeting", promoteChatPageGreeting);+ prop.put(SwitchboardConstants.GREETING_HOMEPAGE, sb.getConfig(SwitchboardConstants.GREETING_HOMEPAGE, ""));+ prop.put("topmenu_" + SwitchboardConstants.GREETING_HOMEPAGE, sb.getConfig(SwitchboardConstants.GREETING_HOMEPAGE, ""));+ prop.put(SwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, ""));+ prop.put("topmenu_" + SwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, ""));+ prop.put(SwitchboardConstants.GREETING_IMAGE_ALT, sb.getConfig(SwitchboardConstants.GREETING_IMAGE_ALT, ""));+ prop.put("topmenu_" + SwitchboardConstants.GREETING_IMAGE_ALT, sb.getConfig(SwitchboardConstants.GREETING_IMAGE_ALT, ""));+// determine if P2P mode is active (global search available)final boolean indexReceiveGranted = sb.getConfigBool(net.yacy.search.SwitchboardConstants.INDEX_RECEIVE_ALLOW_SEARCH, true) || (sb.isRobinsonMode() && sb.getConfig(net.yacy.search.SwitchboardConstants.CLUSTER_MODE, "").equals(net.yacy.search.SwitchboardConstants.CLUSTER_MODE_PUBLIC_CLUSTER));final boolean p2pmode = indexReceiveGranted;