aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-chatstudio.js
diff options
context:
space:
mode:
authorAgando <roduccomm@gmail.com>2026-06-02 18:00:37 +0200
committerAgando <roduccomm@gmail.com>2026-06-02 18:00:37 +0200
commitaafb0fbde5289a45f9f818a00141f80b149be283 (patch)
treed4d8f588187719c99240fbaef1940c068402b892 /modules/core/module-chatstudio.js
parent6d41e590a38c73ef60f1c04beaf8f5438f350f46 (diff)
auto: 2026-06-02_18:00 changes
Diffstat (limited to 'modules/core/module-chatstudio.js')
-rw-r--r--modules/core/module-chatstudio.js32
1 files changed, 6 insertions, 26 deletions
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 <base-url>', '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();
});