diff options
| author | Michael Peter Christen <mc@yacy.net> | 2026-03-28 16:18:42 +0100 |
|---|---|---|
| committer | Michael Peter Christen <mc@yacy.net> | 2026-03-28 16:18:42 +0100 |
| commit | 106730d36b4bdfa34eb12a194453b8c0208487b3 (patch) | |
| tree | 2f9fc50268ea5b7bf1981b8c69b84d2e9e4d1822 | |
| parent | af97d3a682cb7c4bbb4f37fb42246b4ef6fc2ef2 (diff) | |
hero page modification for YaCy Chat
| -rw-r--r-- | defaults/yacy.init | 3 | ||||
| -rw-r--r-- | htroot/yacychat.html | 13 | ||||
| -rw-r--r-- | source/net/yacy/htroot/yacychat.java | 15 |
3 files changed, 29 insertions, 2 deletions
diff --git a/defaults/yacy.init b/defaults/yacy.init index 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 greeting
promoteSearchPageGreeting.useNetworkName = false
# the following attributes can be used to define a custom image, alternative text and home page on the search page
diff --git a/htroot/yacychat.html b/htroot/yacychat.html index 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.java index 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; |
