From 106730d36b4bdfa34eb12a194453b8c0208487b3 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Sat, 28 Mar 2026 16:18:42 +0100 Subject: hero page modification for YaCy Chat --- defaults/yacy.init | 3 ++- htroot/yacychat.html | 13 ++++++++++++- 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)# + +

+

#[promoteChatPageGreeting]#

+ :: + +

+

#[promoteChatPageGreeting]#

+ :: + #(/topmenu)# +

YaCy Chat

-

Chat with your configured LLM using the local YaCy settings. Requests are sent to the same host that served this page.

+

This Chat is private. YaCy does not keep any history — only your browser remembers the current conversation.

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; -- cgit v1.2.3