Upload 5 modified files from chat-switchboard-v0.5.1-1.zip
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="favicon.svg">
|
<link rel="icon" type="image/svg+xml" href="favicon.svg">
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32.png">
|
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32.png">
|
||||||
<link rel="apple-touch-icon" sizes="192x192" href="favicon-192.png">
|
<link rel="apple-touch-icon" sizes="192x192" href="favicon-192.png">
|
||||||
<link rel="stylesheet" href="css/styles.css?v=0.5.1">
|
<link rel="stylesheet" href="css/styles.css?v=0.5.1-1">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
@@ -305,9 +305,9 @@
|
|||||||
onerror="this.onerror=null; this.src='https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.2.4/purify.min.js'">
|
onerror="this.onerror=null; this.src='https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.2.4/purify.min.js'">
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="js/debug.js?v=0.5.1"></script>
|
<script src="js/debug.js?v=0.5.1-1"></script>
|
||||||
<script src="js/api.js?v=0.5.1"></script>
|
<script src="js/api.js?v=0.5.1-1"></script>
|
||||||
<script src="js/ui.js?v=0.5.1"></script>
|
<script src="js/ui.js?v=0.5.1-1"></script>
|
||||||
<script src="js/app.js?v=0.5.1"></script>
|
<script src="js/app.js?v=0.5.1-1"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -260,7 +260,17 @@ async function sendMessage() {
|
|||||||
UI.toast('Generation stopped', 'warning');
|
UI.toast('Generation stopped', 'warning');
|
||||||
} else {
|
} else {
|
||||||
console.error('Completion error:', e);
|
console.error('Completion error:', e);
|
||||||
UI.toast(e.message, 'error');
|
// Distinguish provider-side auth errors from session issues
|
||||||
|
const msg = e.message || '';
|
||||||
|
if (msg.includes('provider error') && msg.includes('401')) {
|
||||||
|
UI.toast('Provider API key rejected — check your key in Settings → Providers', 'error');
|
||||||
|
} else if (msg.includes('provider error') && msg.includes('429')) {
|
||||||
|
UI.toast('Provider rate limit hit — wait a moment and retry', 'warning');
|
||||||
|
} else if (msg.includes('no API config') || msg.includes('no model')) {
|
||||||
|
UI.toast('No provider configured — add one in Settings → Providers', 'error');
|
||||||
|
} else {
|
||||||
|
UI.toast(msg, 'error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
App.isGenerating = false;
|
App.isGenerating = false;
|
||||||
@@ -306,7 +316,14 @@ async function regenerate() {
|
|||||||
chat.messages.push({ role: 'assistant', content, model, timestamp: new Date().toISOString() });
|
chat.messages.push({ role: 'assistant', content, model, timestamp: new Date().toISOString() });
|
||||||
UI.showRegenerate(true);
|
UI.showRegenerate(true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.name !== 'AbortError') UI.toast(e.message, 'error');
|
if (e.name !== 'AbortError') {
|
||||||
|
const msg = e.message || '';
|
||||||
|
if (msg.includes('provider error') && msg.includes('401')) {
|
||||||
|
UI.toast('Provider API key rejected — check Settings → Providers', 'error');
|
||||||
|
} else {
|
||||||
|
UI.toast(msg, 'error');
|
||||||
|
}
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
App.isGenerating = false;
|
App.isGenerating = false;
|
||||||
App.abortController = null;
|
App.abortController = null;
|
||||||
|
|||||||
@@ -508,7 +508,8 @@ function switchDebugTab(tab) {
|
|||||||
document.querySelectorAll('.debug-tab').forEach(t => t.classList.remove('active'));
|
document.querySelectorAll('.debug-tab').forEach(t => t.classList.remove('active'));
|
||||||
document.querySelectorAll('.debug-tab-content').forEach(c => c.style.display = 'none');
|
document.querySelectorAll('.debug-tab-content').forEach(c => c.style.display = 'none');
|
||||||
document.querySelector(`.debug-tab[data-tab="${tab}"]`)?.classList.add('active');
|
document.querySelector(`.debug-tab[data-tab="${tab}"]`)?.classList.add('active');
|
||||||
document.getElementById(`debug${tab.charAt(0).toUpperCase() + tab.slice(1)}Tab`)?.style.display = '';
|
const panel = document.getElementById(`debug${tab.charAt(0).toUpperCase() + tab.slice(1)}Tab`);
|
||||||
|
if (panel) panel.style.display = '';
|
||||||
DebugLog.render();
|
DebugLog.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user