From aafb0fbde5289a45f9f818a00141f80b149be283 Mon Sep 17 00:00:00 2001 From: Agando Date: Tue, 2 Jun 2026 18:00:37 +0200 Subject: auto: 2026-06-02_18:00 changes --- modules/core/module-chatstudio.js | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) (limited to 'modules/core/module-chatstudio.js') diff --git a/modules/core/module-chatstudio.js b/modules/core/module-chatstudio.js index 762eae3..9643fff 100644 --- a/modules/core/module-chatstudio.js +++ b/modules/core/module-chatstudio.js @@ -17,32 +17,12 @@ class ChatStudioModule { getHelpInfo() { return { - 'chat': 'Toggle the ChatStudio overlay', - 'chat-setapi': 'Set the API base URL for ChatStudio', - 'chat-setmodel': 'Set the default model for ChatStudio', - 'chat-ask': 'Ask a question directly via ChatStudio' + 'chat': 'Toggle the ChatStudio overlay (inside: /setapi, /setmodel, /ask, /help)', }; } registerCommands() { this.commands['chat'] = () => this.toggleChatOverlay(); - this.commands['chat-setapi'] = (args) => { - if (!args[0]) { - const base = window.API_BASE || '/api'; - this.terminal.print('Current API base: ' + base, 'info'); - this.terminal.print('Usage: chat-setapi ', 'info'); - this.terminal.print('Example: chat-setapi /api', 'info'); - return; - } - const url = args[0].replace(/\/+$/, ''); - window.API_BASE = url; - try { - var settings = JSON.parse(localStorage.getItem('webx11_chat_settings') || '{}'); - settings.apiBase = url; - localStorage.setItem('webx11_chat_settings', JSON.stringify(settings)); - } catch (e) {} - this.terminal.print('API base set to: ' + url + ' (reopen chat to apply)', 'success'); - }; } toggleChatOverlay() { @@ -59,7 +39,7 @@ class ChatStudioModule { if (!this._cssLoaded) { const link = document.createElement('link'); link.rel = 'stylesheet'; - link.href = 'chat/chat-ui.css?v=4'; + link.href = 'chat/chat-ui.css?v=5'; link.onload = () => { this._cssLoaded = true; }; link.onerror = () => reject(new Error('Failed to load chat/chat-ui.css')); document.head.appendChild(link); @@ -120,7 +100,7 @@ class ChatStudioModule { resolve(); return; } - fetch('chat/chat-ui.html?v=4') + fetch('chat/chat-ui.html?v=5') .then(r => r.text()) .then(html => { this._overlayHtml = html; // cache for re-open @@ -134,7 +114,7 @@ class ChatStudioModule { const loadScript = (src) => { return new Promise((res, rej) => { const s = document.createElement('script'); - s.src = src; + s.src = src + '?v=5'; s.onload = () => res(); s.onerror = () => rej(new Error('Failed to load ' + src)); document.body.appendChild(s); @@ -142,8 +122,8 @@ class ChatStudioModule { }; Promise.all([ - loadScript('chat/chat-commands.js?v=4'), - loadScript('chat/chat-modules.js?v=4') + loadScript('chat/chat-commands.js'), + loadScript('chat/chat-modules.js') ]).then(() => { resolve(); }); -- cgit v1.2.3