feat: rename moltbot-chat UI to Clawdbot and use secure proxy
- Update Assistant.tsx to use /api/moltbot/chat proxy instead of hardcoded URL - Rename 'Moltbot AI' to 'Clawdbot AI' in chat interface - Update welcome message to 'Welcome to Clawdbot' - Document MOLTBOT_SERVICE_URL pointing to clawdbot.svc.plus in .env.example
This commit is contained in:
parent
6f816bcdab
commit
b855f99563
@ -1 +1,3 @@
|
||||
# Moltbot / Clawdbot Service URL
|
||||
# Defaults to https://clawdbot.svc.plus if not set
|
||||
MOLTBOT_SERVICE_URL=https://clawdbot.svc.plus
|
||||
|
||||
@ -55,7 +55,7 @@ export function AIAssistant({ state }: AssistantProps) {
|
||||
// For now, we prepend it to the prompt to ensure the bot knows the current view context
|
||||
const contextAwarePrompt = `Context: [${contextSummary}]\n\nQuestion: ${prompt}`
|
||||
|
||||
const response = await fetch('https://clawdbot.svc.plus/chat', {
|
||||
const response = await fetch('/api/moltbot/chat', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@ -184,8 +184,8 @@ export function AIAssistant({ state }: AssistantProps) {
|
||||
<li
|
||||
key={entry.timestamp}
|
||||
className={`rounded-2xl px-3 py-2 text-sm ${entry.author === 'user'
|
||||
? 'bg-emerald-500/10 text-emerald-100'
|
||||
: 'bg-slate-900/80 text-slate-200'
|
||||
? 'bg-emerald-500/10 text-emerald-100'
|
||||
: 'bg-slate-900/80 text-slate-200'
|
||||
}`}
|
||||
>
|
||||
<p className="text-xs uppercase tracking-wide text-slate-500">
|
||||
|
||||
@ -38,17 +38,6 @@ export function MoltbotChat() {
|
||||
setLoading(true)
|
||||
|
||||
try {
|
||||
// Optimistic UI update or wait for stream?
|
||||
// Let's assume simple fetch for now based on user request "打通 https://clawdbot.svc.plus/chat"
|
||||
// If it's a chat interface, it might be streaming, but let's start with fetch.
|
||||
// Actually, if it's "https://clawdbot.svc.plus/chat", that might be a *page* URL, not an API URL.
|
||||
// The user said "打通 https://clawdbot.svc.plus/chat", which implies connecting TO it.
|
||||
// If it's a browser page, maybe they want an iframe?
|
||||
// But the previous instructions said "AskAI 按钮简单的UI不变", implying native UI.
|
||||
// Let's assume there is an API endpoint. If not, I might need to clarify.
|
||||
// PROXY: request to /api/moltbot/chat which proxies to clawdbot.svc.plus?
|
||||
// Let's try to fetch directly first, or map to a structured request.
|
||||
|
||||
// Use internal proxy to handle CORS and auth
|
||||
const response = await fetch('/api/moltbot/chat', {
|
||||
method: 'POST',
|
||||
@ -97,7 +86,7 @@ export function MoltbotChat() {
|
||||
<div className="flex flex-col h-full rounded-2xl border border-emerald-500/30 bg-slate-950/95 shadow-2xl overflow-hidden">
|
||||
<div className="flex items-center justify-between border-b border-emerald-500/20 px-6 py-4">
|
||||
<div>
|
||||
<p className="text-lg font-semibold text-slate-100">Moltbot AI</p>
|
||||
<p className="text-lg font-semibold text-slate-100">Clawdbot AI</p>
|
||||
<p className="text-xs text-slate-400">Your personal cloud assistant.</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -110,7 +99,7 @@ export function MoltbotChat() {
|
||||
<div className="w-12 h-12 flex items-center justify-center text-3xl">🦞</div>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<h3 className="text-slate-200 font-medium">Welcome to Moltbot</h3>
|
||||
<h3 className="text-slate-200 font-medium">Welcome to Clawdbot</h3>
|
||||
<p className="text-sm text-slate-500 max-w-xs mx-auto">
|
||||
Ask me anything about your infrastructure, logs, or just say hello.
|
||||
</p>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user