|
|
|
|
@@ -1,14 +1,631 @@
|
|
|
|
|
{{/*
|
|
|
|
|
Chat surface (Phase 1 bridge).
|
|
|
|
|
Server renders the page shell. Existing SPA JS takes over the DOM.
|
|
|
|
|
All scripts from index.html are loaded here — minus the three
|
|
|
|
|
already in base.html (api.js, events.js, ui-primitives.js).
|
|
|
|
|
Server renders the page shell with full SPA scaffold.
|
|
|
|
|
Existing SPA JS (app.js, ui-core.js, chat.js, etc.) populates
|
|
|
|
|
these pre-built DOM elements with data.
|
|
|
|
|
|
|
|
|
|
v0.22.6 fix: The original index.html contained the full scaffold
|
|
|
|
|
(1,296 lines). When it was replaced with a redirect stub, this
|
|
|
|
|
template needed the scaffold — but it was shipped empty.
|
|
|
|
|
This template restores the required DOM structure.
|
|
|
|
|
*/}}
|
|
|
|
|
|
|
|
|
|
{{define "surface-chat"}}
|
|
|
|
|
<div id="appContainer" class="app" style="display:none;height:100%;">
|
|
|
|
|
{{/* SPA builds its DOM here — same as current index.html */}}
|
|
|
|
|
|
|
|
|
|
{{/* ── Splash / Auth Gate ───────────────────────
|
|
|
|
|
Server-rendered surfaces use /login for auth, so the splash
|
|
|
|
|
is hidden by default. Kept as a DOM node so showSplash()/
|
|
|
|
|
hideSplash() in app.js don't crash on null. */}}
|
|
|
|
|
<div id="splashGate" class="splash" style="display:none;">
|
|
|
|
|
<div class="splash-hero">
|
|
|
|
|
<div id="brandHeadline" class="splash-title"></div>
|
|
|
|
|
<div id="brandTagline" class="splash-subtitle"></div>
|
|
|
|
|
<div id="brandPills" class="splash-pills"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="splash-auth">
|
|
|
|
|
<div id="splashError" class="splash-error" style="display:none;"></div>
|
|
|
|
|
<div class="auth-tabs">
|
|
|
|
|
<button id="authTabLogin" class="auth-tab active" onclick="switchAuthTab('login')">Sign In</button>
|
|
|
|
|
<button id="authTabRegister" class="auth-tab" onclick="switchAuthTab('register')">Register</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="authLoginForm">
|
|
|
|
|
<input type="text" id="authLogin" placeholder="Username or email" autocomplete="username">
|
|
|
|
|
<input type="password" id="authPassword" placeholder="Password" autocomplete="current-password">
|
|
|
|
|
<button id="authLoginBtn" onclick="handleLogin()">Sign In</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="authRegisterForm" style="display:none;">
|
|
|
|
|
<input type="text" id="authUsername" placeholder="Username" autocomplete="username">
|
|
|
|
|
<input type="text" id="authEmail" placeholder="Email" autocomplete="email">
|
|
|
|
|
<input type="password" id="authRegPassword" placeholder="Password" autocomplete="new-password">
|
|
|
|
|
<button id="authRegisterBtn" onclick="handleRegister()">Create Account</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="authError" class="auth-error"></div>
|
|
|
|
|
<div id="brandAuthFooter" class="auth-footer"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* ── App Container ───────────────────────── */}}
|
|
|
|
|
<div id="appContainer" class="app" style="display:none;height:100%;">
|
|
|
|
|
|
|
|
|
|
{{/* Fallback banner (admin-only, shown by Events role.fallback) */}}
|
|
|
|
|
<div id="roleFallbackBanner" class="role-fallback-banner" style="display:none;"></div>
|
|
|
|
|
|
|
|
|
|
<div class="app-body">
|
|
|
|
|
|
|
|
|
|
{{/* ── Sidebar ─────────────────────── */}}
|
|
|
|
|
<div id="sidebar" class="sidebar">
|
|
|
|
|
<div class="sidebar-top">
|
|
|
|
|
{{/* Brand */}}
|
|
|
|
|
<div class="sb-brand">
|
|
|
|
|
<div id="brandSidebarLogo" class="sb-logo">
|
|
|
|
|
<img src="{{.BasePath}}/favicon.svg" alt="" style="width:28px;height:28px;">
|
|
|
|
|
</div>
|
|
|
|
|
<span id="brandSidebarText" class="brand-text">Chat Switchboard</span>
|
|
|
|
|
<span id="brandWordmark" class="brand-text" style="display:none;"></span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* New Chat (split button) */}}
|
|
|
|
|
<div class="split-btn">
|
|
|
|
|
<button id="newChatBtn" class="split-btn-main sb-btn" title="New chat">
|
|
|
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
|
|
|
|
|
<span class="sb-label">New Chat</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button id="newChatDropBtn" class="split-btn-drop" title="More options">
|
|
|
|
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>
|
|
|
|
|
</button>
|
|
|
|
|
<div id="newChatDropdown" class="split-btn-dropdown">
|
|
|
|
|
{{/* Populated by projects-ui.js */}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* Search */}}
|
|
|
|
|
<div id="sidebarSearch" class="sidebar-search">
|
|
|
|
|
<svg class="search-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
|
|
|
|
|
<input type="text" id="chatSearchInput" placeholder="Search chats…" autocomplete="off">
|
|
|
|
|
<button id="chatSearchClear" class="search-clear" title="Clear search">✕</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* Sidebar toggle (hamburger) */}}
|
|
|
|
|
<button id="sidebarToggle" class="sb-btn sidebar-toggle" title="Toggle sidebar">
|
|
|
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* Sidebar Tabs (Chats / Files) */}}
|
|
|
|
|
<div id="sidebarTabs" class="sidebar-tabs" style="display:none;">
|
|
|
|
|
<button class="sidebar-tab active" data-tab="chats">Chats</button>
|
|
|
|
|
<button id="sidebarFilesTab" class="sidebar-tab" data-tab="files" style="display:none;">Files</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* Chat list */}}
|
|
|
|
|
<div id="chatHistory" class="sidebar-chats sidebar-tab-panel" data-tab-panel="chats">
|
|
|
|
|
{{/* Populated by UI.renderChatList() */}}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* Files panel (editor mode) */}}
|
|
|
|
|
<div class="sidebar-tab-panel" data-tab-panel="files" style="display:none;"></div>
|
|
|
|
|
|
|
|
|
|
{{/* User / bottom */}}
|
|
|
|
|
<div class="sidebar-bottom">
|
|
|
|
|
<button id="userMenuBtn" class="user-btn">
|
|
|
|
|
<div id="userAvatar" class="user-avatar">
|
|
|
|
|
<span id="avatarLetter">?</span>
|
|
|
|
|
</div>
|
|
|
|
|
<span id="userName" class="sb-label">User</span>
|
|
|
|
|
</button>
|
|
|
|
|
<div id="userFlyout" class="user-flyout">
|
|
|
|
|
<button id="menuSettings" class="flyout-item">
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.32 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
|
|
|
|
|
<span>Settings</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button id="menuAdmin" class="flyout-item" style="display:none;">
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>
|
|
|
|
|
<span>Admin</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button id="menuTeamAdmin" class="flyout-item" style="display:none;">
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>
|
|
|
|
|
<span>Team Admin</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button id="menuDebug" class="flyout-item" style="display:none;">
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z"/><path d="M12 6V12L16 14"/></svg>
|
|
|
|
|
<span>Debug Console</span>
|
|
|
|
|
</button>
|
|
|
|
|
<hr class="flyout-divider">
|
|
|
|
|
<button id="menuSignout" class="flyout-item flyout-danger">
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>
|
|
|
|
|
<span>Sign Out</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* Sidebar overlay (mobile) */}}
|
|
|
|
|
<div id="sidebarOverlay" class="sidebar-overlay" style="display:none;"></div>
|
|
|
|
|
|
|
|
|
|
{{/* Mobile menu button */}}
|
|
|
|
|
<button id="mobileMenuBtn" class="mobile-menu-btn">
|
|
|
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
{{/* ── Workspace ───────────────────── */}}
|
|
|
|
|
<div class="workspace">
|
|
|
|
|
<div class="workspace-primary workspace-pane">
|
|
|
|
|
|
|
|
|
|
{{/* Chat header: model selector + token count */}}
|
|
|
|
|
<div class="chat-header">
|
|
|
|
|
<div id="modelDropdown" class="model-dropdown">
|
|
|
|
|
<button id="modelDropdownBtn" class="model-dropdown-btn">
|
|
|
|
|
<span id="modelDropdownLabel" class="model-dropdown-label">Select model…</span>
|
|
|
|
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>
|
|
|
|
|
</button>
|
|
|
|
|
<div id="modelDropdownMenu" class="model-dropdown-menu">
|
|
|
|
|
{{/* Populated by UI.updateModelSelector() */}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<span id="modelCaps" class="model-caps"></span>
|
|
|
|
|
<div class="chat-header-right">
|
|
|
|
|
<span id="chatTokenCount" class="token-count" title="Estimated token count"></span>
|
|
|
|
|
<span id="summarizedHistory" class="summarized-badge" style="display:none;" title="Earlier messages are summarized">📋 Summarized</span>
|
|
|
|
|
<button id="summarizeBtn" class="action-btn" style="display:none;" title="Summarize older messages">
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* Messages */}}
|
|
|
|
|
<div id="chatMessages" class="msg-container">
|
|
|
|
|
{{/* Populated by UI.renderMessages() */}}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* Context warning */}}
|
|
|
|
|
<div id="contextWarning" class="context-warning" style="display:none;">
|
|
|
|
|
<span id="contextWarningText"></span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* Attachment strip */}}
|
|
|
|
|
<div id="attachmentStrip" class="attachment-strip"></div>
|
|
|
|
|
|
|
|
|
|
{{/* Streaming tools display */}}
|
|
|
|
|
<div id="streamTools" class="stream-tools" style="display:none;"></div>
|
|
|
|
|
|
|
|
|
|
{{/* Input toolbar (attach, tools toggle, KB) */}}
|
|
|
|
|
<div class="input-toolbar">
|
|
|
|
|
<button id="attachBtn" class="action-btn attach-btn" title="Attach file">
|
|
|
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg>
|
|
|
|
|
</button>
|
|
|
|
|
{{/* tools-toggle.js adds toggle buttons here */}}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* Input wrap: CM6 editor + send/stop */}}
|
|
|
|
|
<div class="input-wrap">
|
|
|
|
|
<div id="messageInputWrap">
|
|
|
|
|
{{/* CM6 mounts here (chat.js). Fallback textarea below. */}}
|
|
|
|
|
<textarea id="messageInput" placeholder="Type a message…" rows="1"></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="input-actions">
|
|
|
|
|
<span id="inputTokenCount" class="input-token-count"></span>
|
|
|
|
|
<button id="sendBtn" class="action-btn send-btn" title="Send message">
|
|
|
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
|
|
|
|
|
</button>
|
|
|
|
|
<button id="stopBtn" class="action-btn stop-btn" title="Stop generating">
|
|
|
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/></svg>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* Resize handle */}}
|
|
|
|
|
<div id="workspaceHandle" class="workspace-handle"></div>
|
|
|
|
|
|
|
|
|
|
{{/* Side panel (secondary pane) */}}
|
|
|
|
|
<div id="workspaceSecondary" class="workspace-secondary workspace-pane">
|
|
|
|
|
<div class="side-panel-header">
|
|
|
|
|
<span id="sidePanelLabel" class="side-panel-label"></span>
|
|
|
|
|
<div class="side-panel-header-actions">
|
|
|
|
|
<span id="sidePanelPanelActions"></span>
|
|
|
|
|
<button id="sidePanelFullscreenBtn" class="side-panel-btn" title="Toggle fullscreen" onclick="toggleSidePanelFullscreen()">
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>
|
|
|
|
|
</button>
|
|
|
|
|
<button class="side-panel-btn" title="Close panel" onclick="PanelRegistry.closeAll()">
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="sidePanelBody" class="side-panel-body">
|
|
|
|
|
{{/* Preview panel page */}}
|
|
|
|
|
<div id="sidePanelPreview" class="side-panel-page">
|
|
|
|
|
<iframe id="previewFrame" class="preview-frame" sandbox="allow-scripts allow-same-origin" style="display:none;"></iframe>
|
|
|
|
|
<div id="previewEmpty" class="preview-empty">
|
|
|
|
|
<p>Open a code block preview or extension output here.</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{{/* Notes and project panels are registered dynamically */}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* Side panel overlay (mobile) */}}
|
|
|
|
|
<div id="sidePanelOverlay" class="side-panel-overlay" style="display:none;"></div>
|
|
|
|
|
|
|
|
|
|
{{/* ── Toast Container ─────────────────────── */}}
|
|
|
|
|
<div id="toastContainer" class="toast-container"></div>
|
|
|
|
|
|
|
|
|
|
{{/* ── Lightbox ────────────────────────────── */}}
|
|
|
|
|
<div id="lightbox" class="lightbox" onclick="closeLightbox()">
|
|
|
|
|
<img id="lightboxImg" src="" alt="">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* ── Command Palette ─────────────────────── */}}
|
|
|
|
|
<div id="cmdPalette" class="cmd-palette" style="display:none;">
|
|
|
|
|
<div class="cmd-palette-inner">
|
|
|
|
|
<input type="text" class="cmd-palette-input" placeholder="Type a command…" autocomplete="off">
|
|
|
|
|
<div class="cmd-palette-results"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* ── Hidden File Input (attachments) ─────── */}}
|
|
|
|
|
<input type="file" id="fileInput" multiple style="display:none;">
|
|
|
|
|
|
|
|
|
|
{{/* ── Settings Modal ──────────────────────── */}}
|
|
|
|
|
<div id="settingsModal" class="modal-overlay">
|
|
|
|
|
<div class="modal-content modal-lg">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<h2>Settings</h2>
|
|
|
|
|
<button class="modal-close" onclick="closeModal('settingsModal')">✕</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-tabs">
|
|
|
|
|
<button class="settings-tab active" data-stab="general" onclick="UI.switchSettingsTab('general')">General</button>
|
|
|
|
|
<button class="settings-tab" data-stab="appearance" onclick="UI.switchSettingsTab('appearance')">Appearance</button>
|
|
|
|
|
<button id="settingsProvidersTabBtn" class="settings-tab" data-stab="providers" onclick="UI.switchSettingsTab('providers')">My Providers</button>
|
|
|
|
|
<button id="settingsPersonasTabBtn" class="settings-tab" data-stab="personas" onclick="UI.switchSettingsTab('personas')">My Presets</button>
|
|
|
|
|
<button id="settingsUsageTabBtn" class="settings-tab" data-stab="usage" onclick="UI.switchSettingsTab('usage')">Usage</button>
|
|
|
|
|
<button class="settings-tab" data-stab="profile" onclick="UI.switchSettingsTab('profile')">Profile</button>
|
|
|
|
|
<button id="settingsRolesTabBtn" class="settings-tab" data-stab="roles" onclick="UI.switchSettingsTab('roles')" style="display:none;">Roles</button>
|
|
|
|
|
<button id="settingsKBTabBtn" class="settings-tab" data-stab="kb" onclick="UI.switchSettingsTab('kb')" style="display:none;">Knowledge</button>
|
|
|
|
|
<button id="settingsTeamsSection" class="settings-tab" data-stab="teams" onclick="UI.switchSettingsTab('teams')">Teams</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
{{/* General tab */}}
|
|
|
|
|
<div id="settingsGeneralTab" class="settings-tab-content" style="display:block;">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label>Model</label>
|
|
|
|
|
<select id="settingsModel"></select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label>System Prompt</label>
|
|
|
|
|
<textarea id="settingsSystemPrompt" rows="4"></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label>Max Tokens <span id="settingsMaxHint" class="form-hint"></span></label>
|
|
|
|
|
<input type="number" id="settingsMaxTokens" placeholder="default">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label>Temperature</label>
|
|
|
|
|
<input type="range" id="settingsTemp" min="0" max="2" step="0.1" value="0.7">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label><input type="checkbox" id="settingsThinking"> Show thinking blocks</label>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{{/* Appearance tab */}}
|
|
|
|
|
<div id="settingsAppearanceTab" class="settings-tab-content" style="display:none;">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label>Message Font Size</label>
|
|
|
|
|
<div style="display:flex;align-items:center;gap:8px;">
|
|
|
|
|
<input type="range" id="settingsMsgFont" min="12" max="20" step="1" value="14">
|
|
|
|
|
<span id="msgFontValue">14px</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label>UI Scale</label>
|
|
|
|
|
<div style="display:flex;align-items:center;gap:8px;">
|
|
|
|
|
<input type="range" id="settingsScale" min="0.8" max="1.2" step="0.05" value="1.0">
|
|
|
|
|
<span id="scaleValue">100%</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{{/* Providers tab */}}
|
|
|
|
|
<div id="settingsProvidersTab" class="settings-tab-content" style="display:none;">
|
|
|
|
|
<div id="userProvidersDisabled" class="notice" style="display:none;">Personal API keys are not enabled by your administrator.</div>
|
|
|
|
|
<button id="providerShowAddBtn" class="btn-small" style="display:none;">+ Add Provider</button>
|
|
|
|
|
<div id="providerAddForm" style="display:none;"></div>
|
|
|
|
|
<div id="providerList"></div>
|
|
|
|
|
</div>
|
|
|
|
|
{{/* Presets tab */}}
|
|
|
|
|
<div id="settingsPersonasTab" class="settings-tab-content" style="display:none;">
|
|
|
|
|
<button id="userAddPresetBtn" class="btn-small" style="display:none;">+ New Preset</button>
|
|
|
|
|
<div id="userAddPresetForm" style="display:none;"></div>
|
|
|
|
|
<div id="userPresetList"></div>
|
|
|
|
|
</div>
|
|
|
|
|
{{/* Usage tab */}}
|
|
|
|
|
<div id="settingsUsageTab" class="settings-tab-content" style="display:none;">
|
|
|
|
|
<div id="myUsageTotals"></div>
|
|
|
|
|
</div>
|
|
|
|
|
{{/* Profile tab */}}
|
|
|
|
|
<div id="settingsProfileTab" class="settings-tab-content" style="display:none;">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label>Display Name</label>
|
|
|
|
|
<input type="text" id="profileDisplayName">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label>Email</label>
|
|
|
|
|
<input type="email" id="profileEmail" disabled>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<button class="btn-small" onclick="document.getElementById('profileChangePwForm').style.display=''">Change Password</button>
|
|
|
|
|
<div id="profileChangePwForm" style="display:none;margin-top:8px;">
|
|
|
|
|
<input type="password" id="settingsCurrentPw" placeholder="Current password" autocomplete="current-password" style="margin-bottom:6px;">
|
|
|
|
|
<input type="password" id="settingsNewPw" placeholder="New password" autocomplete="new-password" style="margin-bottom:6px;">
|
|
|
|
|
<input type="password" id="settingsConfirmPw" placeholder="Confirm new password" autocomplete="new-password" style="margin-bottom:6px;">
|
|
|
|
|
<button class="btn-small" onclick="Pages.changePassword()">Update Password</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{{/* Roles tab (admin) */}}
|
|
|
|
|
<div id="settingsRolesTab" class="settings-tab-content" style="display:none;">
|
|
|
|
|
<div id="userRolesDisabled" class="notice" style="display:none;"></div>
|
|
|
|
|
<div id="userRolesConfig"></div>
|
|
|
|
|
<div id="userModelList"></div>
|
|
|
|
|
</div>
|
|
|
|
|
{{/* KB tab */}}
|
|
|
|
|
<div id="settingsKBTab" class="settings-tab-content" style="display:none;">
|
|
|
|
|
<div id="kbManagePanel"></div>
|
|
|
|
|
</div>
|
|
|
|
|
{{/* Teams tab */}}
|
|
|
|
|
<div id="settingsTeamsTab" class="settings-tab-content" style="display:none;">
|
|
|
|
|
<div id="settingsTeamsList"></div>
|
|
|
|
|
<div id="settingsTeamMembers" style="display:none;"></div>
|
|
|
|
|
<div id="settingsTeamPresets" style="display:none;">
|
|
|
|
|
<div id="adminPresetList"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="settingsTeamProviders" style="display:none;">
|
|
|
|
|
<button id="settingsTeamAddProviderBtn" class="btn-small" style="display:none;">+ Add Provider</button>
|
|
|
|
|
<div id="settingsTeamProviderForm" style="display:none;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="settingsTeamGroups" style="display:none;"></div>
|
|
|
|
|
<div id="settingsTeamAudit" style="display:none;"></div>
|
|
|
|
|
<div id="settingsTeamUsageTotals" style="display:none;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
{{/* Memory tab */}}
|
|
|
|
|
<div id="settingsMemoryTab" class="settings-tab-content" style="display:none;">
|
|
|
|
|
<div id="settingsMemoryContent"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
<button class="btn-primary" onclick="UI.saveSettingsAndClose()">Save</button>
|
|
|
|
|
<button class="btn-secondary" onclick="closeModal('settingsModal')">Cancel</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* ── Admin Panel (SPA modal — fallback, admin surface is preferred) */}}
|
|
|
|
|
<div id="adminPanel" class="modal-overlay">
|
|
|
|
|
<div class="modal-content modal-xl">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<h2>Admin</h2>
|
|
|
|
|
<button class="modal-close" onclick="closeModal('adminPanel')">✕</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body" style="display:flex;min-height:400px;">
|
|
|
|
|
<div id="adminSidebar" class="admin-sidebar"></div>
|
|
|
|
|
<div class="admin-content" style="flex:1;overflow-y:auto;padding:16px;">
|
|
|
|
|
{{/* Admin sections — dynamically shown/hidden by ui-admin.js */}}
|
|
|
|
|
<div id="adminStats" class="admin-section"></div>
|
|
|
|
|
<div id="adminModelList" class="admin-section" style="display:none;"></div>
|
|
|
|
|
<div id="adminProviderList" class="admin-section" style="display:none;"></div>
|
|
|
|
|
<div id="adminUserList" class="admin-section" style="display:none;"></div>
|
|
|
|
|
<div id="adminTeamList" class="admin-section" style="display:none;"></div>
|
|
|
|
|
<div id="adminHealthContent" class="admin-section" style="display:none;">
|
|
|
|
|
<button id="adminHealthRefreshBtn" class="btn-small">Refresh</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="adminRolesContent" class="admin-section" style="display:none;"></div>
|
|
|
|
|
<div id="adminCapabilityList" class="admin-section" style="display:none;"></div>
|
|
|
|
|
<div id="adminExtensionsList" class="admin-section" style="display:none;"></div>
|
|
|
|
|
<div id="adminPricingTable" class="admin-section" style="display:none;"></div>
|
|
|
|
|
<div id="adminAuditList" class="admin-section" style="display:none;">
|
|
|
|
|
<div style="display:flex;gap:8px;margin-bottom:8px;">
|
|
|
|
|
<select id="auditFilterAction"><option value="">All actions</option></select>
|
|
|
|
|
<select id="auditFilterResource"><option value="">All resources</option></select>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="auditPagination" style="display:flex;gap:8px;align-items:center;">
|
|
|
|
|
<button id="auditPrevBtn" class="btn-small" disabled>← Prev</button>
|
|
|
|
|
<span id="auditPageInfo"></span>
|
|
|
|
|
<button id="auditNextBtn" class="btn-small">Next →</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="adminStorageContent" class="admin-section" style="display:none;"></div>
|
|
|
|
|
<div id="adminRoutingPolicyList" class="admin-section" style="display:none;">
|
|
|
|
|
<button id="adminAddRoutingPolicyBtn" class="btn-small">+ Add Policy</button>
|
|
|
|
|
<div id="adminRoutingForm" style="display:none;"></div>
|
|
|
|
|
<div style="margin-top:16px;border-top:1px solid var(--border);padding-top:16px;">
|
|
|
|
|
<h4>Test Routing</h4>
|
|
|
|
|
<div style="display:flex;gap:8px;align-items:center;flex-wrap:wrap;">
|
|
|
|
|
<input type="text" id="routingTestModel" placeholder="Model ID">
|
|
|
|
|
<input type="text" id="routingTestUser" placeholder="User ID (optional)">
|
|
|
|
|
<button id="routingTestBtn" class="btn-small">Test</button>
|
|
|
|
|
</div>
|
|
|
|
|
<pre id="routingTestResult" style="margin-top:8px;font-size:12px;"></pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="adminUsageResults" class="admin-section" style="display:none;">
|
|
|
|
|
<div id="adminUsageTotals"></div>
|
|
|
|
|
<div id="_adminUsageContainer"></div>
|
|
|
|
|
</div>
|
|
|
|
|
{{/* Settings admin section */}}
|
|
|
|
|
<div class="admin-section" style="display:none;">
|
|
|
|
|
<div class="form-group"><label><input type="checkbox" id="adminRegToggle"> Registration Enabled</label></div>
|
|
|
|
|
<div class="form-group"><label>Default User State</label><select id="adminRegDefaultState"><option value="active">Active</option><option value="pending">Pending Approval</option></select></div>
|
|
|
|
|
<div class="form-group"><label><input type="checkbox" id="adminUserProvidersToggle"> Allow User BYOK</label></div>
|
|
|
|
|
<div class="form-group"><label><input type="checkbox" id="adminUserPresetsToggle"> Allow User Presets</label></div>
|
|
|
|
|
<div class="form-group"><label><input type="checkbox" id="adminKBDirectAccessToggle"> KB Direct Access</label></div>
|
|
|
|
|
<div class="form-group"><label>Default Model</label><select id="adminDefaultModel"></select></div>
|
|
|
|
|
<div class="form-group"><label>System Prompt</label><textarea id="adminSystemPrompt" rows="4"></textarea></div>
|
|
|
|
|
<div class="form-group"><label><input type="checkbox" id="adminBannerEnabled"> Banner</label></div>
|
|
|
|
|
<div id="bannerConfigFields" style="display:none;">
|
|
|
|
|
<input type="text" id="adminBannerText" placeholder="Banner text">
|
|
|
|
|
<div style="display:flex;gap:8px;margin-top:6px;">
|
|
|
|
|
<select id="adminBannerPreset"><option value="">Custom colors</option></select>
|
|
|
|
|
<select id="adminBannerPosition"><option value="both">Both</option><option value="top">Top</option><option value="bottom">Bottom</option></select>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display:flex;gap:8px;margin-top:6px;">
|
|
|
|
|
<input type="color" id="adminBannerBg" value="#007a33"><input type="text" id="adminBannerBgHex" value="#007a33" style="width:80px;">
|
|
|
|
|
<input type="color" id="adminBannerFg" value="#ffffff"><input type="text" id="adminBannerFgHex" value="#ffffff" style="width:80px;">
|
|
|
|
|
</div>
|
|
|
|
|
<div id="bannerPreview" class="banner-preview" style="margin-top:8px;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group"><label><input type="checkbox" id="adminMemoryExtractionEnabled"> Memory Extraction</label></div>
|
|
|
|
|
<div id="memoryExtractionConfigFields" style="display:none;">
|
|
|
|
|
<label><input type="checkbox" id="adminMemoryAutoApprove"> Auto-approve</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group"><label><input type="checkbox" id="adminCompactionEnabled"> Auto-Compaction</label></div>
|
|
|
|
|
<div id="compactionConfigFields" style="display:none;">
|
|
|
|
|
<label>Threshold <input type="number" id="adminCompactionThreshold" value="100000"></label>
|
|
|
|
|
<label>Cooldown <input type="number" id="adminCompactionCooldown" value="3600"></label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label>Web Search</label>
|
|
|
|
|
<select id="adminSearchProvider"><option value="">Disabled</option><option value="searxng">SearXNG</option></select>
|
|
|
|
|
<div id="searxngConfigFields" style="display:none;">
|
|
|
|
|
<input type="text" id="adminSearchEndpoint" placeholder="SearXNG URL">
|
|
|
|
|
<input type="text" id="adminSearchApiKey" placeholder="API key (optional)">
|
|
|
|
|
<input type="number" id="adminSearchMaxResults" placeholder="Max results" value="5">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<button id="adminRunCleanup" class="btn-small btn-danger" style="margin-top:12px;">Run Cleanup</button>
|
|
|
|
|
<div id="adminVaultStatus" style="margin-top:12px;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* ── Team Admin Modal ────────────────────── */}}
|
|
|
|
|
<div id="teamAdminModal" class="modal-overlay">
|
|
|
|
|
<div class="modal-content modal-lg">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<h2 id="teamAdminTitle">Team Admin</h2>
|
|
|
|
|
<button id="teamAdminCloseBtn" class="modal-close">✕</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body" style="display:flex;min-height:300px;">
|
|
|
|
|
<div id="teamAdminPicker" class="admin-sidebar">
|
|
|
|
|
<div id="teamAdminPickerList"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="teamAdminContent" style="flex:1;overflow-y:auto;padding:16px;">
|
|
|
|
|
<div id="adminCurrentUser" style="display:none;"></div>
|
|
|
|
|
<div id="adminTeamDetail" style="display:none;">
|
|
|
|
|
<h3 id="adminTeamDetailName"></h3>
|
|
|
|
|
<div id="adminMemberList"></div>
|
|
|
|
|
<div id="adminAddMemberForm" style="display:none;">
|
|
|
|
|
<select id="adminMemberUser"></select>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="adminTeamAllowProviders" style="display:none;"></div>
|
|
|
|
|
<div id="adminTeamPrivatePolicy" style="display:none;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="adminGroupDetail" style="display:none;">
|
|
|
|
|
<div id="adminGroupDetailMeta"></div>
|
|
|
|
|
<h3 id="adminGroupDetailName"></h3>
|
|
|
|
|
<div id="adminGroupList" style="display:none;"></div>
|
|
|
|
|
<div id="adminGroupMemberList"></div>
|
|
|
|
|
<div id="adminAddGroupMemberForm" style="display:none;">
|
|
|
|
|
<select id="adminGroupMemberUser"></select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="adminAddTeamForm" style="display:none;"></div>
|
|
|
|
|
<div id="adminAddGroupForm" style="display:none;"></div>
|
|
|
|
|
<div id="adminAddProviderForm" style="display:none;"></div>
|
|
|
|
|
{{/* Team audit (inside team admin modal) */}}
|
|
|
|
|
<div id="teamKBContent" style="display:none;"></div>
|
|
|
|
|
<div style="display:none;">
|
|
|
|
|
<select id="teamAuditFilterAction"><option value="">All</option></select>
|
|
|
|
|
<div id="teamAuditPagination" style="display:flex;gap:8px;align-items:center;">
|
|
|
|
|
<button id="teamAuditPrevBtn" class="btn-small" disabled>←</button>
|
|
|
|
|
<span id="teamAuditPageInfo"></span>
|
|
|
|
|
<button id="teamAuditNextBtn" class="btn-small">→</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{{/* Team preset model select */}}
|
|
|
|
|
<div style="display:none;"><select id="teamPreset_model"></select></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* ── Debug Modal ─────────────────────────── */}}
|
|
|
|
|
<div id="debugModal" class="modal-overlay">
|
|
|
|
|
<div class="modal-content modal-lg">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<h2>Debug Console</h2>
|
|
|
|
|
<button class="modal-close" onclick="closeModal('debugModal')">✕</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-tabs">
|
|
|
|
|
<button class="debug-tab active" data-dtab="console" onclick="switchDebugTab('console')">Console</button>
|
|
|
|
|
<button class="debug-tab" data-dtab="network" onclick="switchDebugTab('network')">Network</button>
|
|
|
|
|
<button class="debug-tab" data-dtab="state" onclick="switchDebugTab('state')">State</button>
|
|
|
|
|
<button class="debug-tab" data-dtab="repl" onclick="switchDebugTab('repl')">REPL</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body" style="padding:0;height:400px;overflow:hidden;">
|
|
|
|
|
<div id="debugConsoleTab" class="debug-tab-content" style="display:block;height:100%;overflow-y:auto;">
|
|
|
|
|
<div style="padding:8px;display:flex;gap:8px;align-items:center;">
|
|
|
|
|
<label><input type="checkbox" id="debugAutoScroll" checked> Auto-scroll</label>
|
|
|
|
|
<label><input type="checkbox" id="debugFilterErrors"> Errors only</label>
|
|
|
|
|
<span id="debugConsoleCount" class="badge">0</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="debugConsoleContent" class="debug-content" style="font-family:monospace;font-size:12px;padding:8px;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="debugNetworkTab" class="debug-tab-content" style="display:none;height:100%;overflow-y:auto;">
|
|
|
|
|
<div style="padding:8px;"><span id="debugNetworkCount" class="badge">0</span> requests</div>
|
|
|
|
|
<div id="debugNetworkContent" class="debug-content" style="font-family:monospace;font-size:12px;padding:8px;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="debugStateTab" class="debug-tab-content" style="display:none;height:100%;overflow-y:auto;">
|
|
|
|
|
<div id="debugStateContent" class="debug-content" style="font-family:monospace;font-size:12px;padding:8px;white-space:pre-wrap;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="debugReplTab" class="debug-tab-content" style="display:none;height:100%;display:flex;flex-direction:column;">
|
|
|
|
|
<div id="replOutput" style="flex:1;overflow-y:auto;font-family:monospace;font-size:12px;padding:8px;"></div>
|
|
|
|
|
<div style="border-top:1px solid var(--border);padding:8px;">
|
|
|
|
|
<input type="text" id="replInput" placeholder="Type expression…" style="width:100%;font-family:monospace;font-size:12px;">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* ── Notification Bell ───────────────────── */}}
|
|
|
|
|
<div id="notifWrap" class="notif-wrap" style="position:fixed;top:8px;right:12px;z-index:100;">
|
|
|
|
|
<button class="notif-btn" onclick="Notifications.toggleDropdown()">
|
|
|
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg>
|
|
|
|
|
<span id="notifBadge" class="notif-badge" style="display:none;">0</span>
|
|
|
|
|
</button>
|
|
|
|
|
<div id="notifDropdown" class="notif-dropdown" style="display:none;">
|
|
|
|
|
<div id="notifPanelList"></div>
|
|
|
|
|
<div id="notifPanelMore" style="text-align:center;padding:8px;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* ── Routing Policy Form (shared) ────────── */}}
|
|
|
|
|
<div id="routingPolicyForm" style="display:none;">
|
|
|
|
|
<input type="hidden" id="rpId">
|
|
|
|
|
<div class="form-group"><label>Name</label><input type="text" id="rpName"></div>
|
|
|
|
|
<div class="form-group"><label>Priority</label><input type="number" id="rpPriority" value="100"></div>
|
|
|
|
|
<div class="form-group"><label>Type</label><select id="rpType"><option value="weighted">Weighted</option><option value="failover">Failover</option><option value="round_robin">Round Robin</option></select></div>
|
|
|
|
|
<div class="form-group"><label>Scope</label><select id="rpScope" onchange="Pages.routingScopeChanged(this)"><option value="global">Global</option><option value="team">Team</option></select></div>
|
|
|
|
|
<div id="rpTeamGroup" class="form-group" style="display:none;"><label>Team</label><select id="rpTeamId"></select></div>
|
|
|
|
|
<div class="form-group"><label>Config (JSON)</label><textarea id="rpConfig" rows="4">{}</textarea></div>
|
|
|
|
|
<div class="form-group"><label><input type="checkbox" id="rpActive" checked> Active</label></div>
|
|
|
|
|
<div style="display:flex;gap:8px;">
|
|
|
|
|
<button id="rpSaveBtn" class="btn-primary" onclick="Pages.saveRoutingPolicy()">Save</button>
|
|
|
|
|
<button id="rpCancelBtn" class="btn-secondary" onclick="Pages.hideRoutingForm()">Cancel</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* ── Auto-Compact Toggle (chat header option) */}}
|
|
|
|
|
<div id="autoCompactToggle" style="display:none;">
|
|
|
|
|
<label><input type="checkbox" id="autoCompactCheck"> Auto-compact</label>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{/* ── Fetch Models Button (admin) ─────────── */}}
|
|
|
|
|
<button id="fetchModelsBtn" style="display:none;"></button>
|
|
|
|
|
|
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
|
|
{{define "css-chat"}}
|
|
|
|
|
@@ -29,7 +646,6 @@
|
|
|
|
|
{{/* App JS — order matches index.html (minus api/events/ui-primitives already in base) */}}
|
|
|
|
|
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/debug.js?v={{$.Version}}"></script>
|
|
|
|
|
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/repl.js?v={{$.Version}}"></script>
|
|
|
|
|
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/surfaces.js?v={{$.Version}}"></script>
|
|
|
|
|
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/extensions.js?v={{$.Version}}"></script>
|
|
|
|
|
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/panels.js?v={{$.Version}}"></script>
|
|
|
|
|
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/ui-format.js?v={{$.Version}}"></script>
|
|
|
|
|
@@ -52,6 +668,5 @@
|
|
|
|
|
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/settings-handlers.js?v={{$.Version}}"></script>
|
|
|
|
|
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/admin-handlers.js?v={{$.Version}}"></script>
|
|
|
|
|
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/editor-mode.js?v={{$.Version}}"></script>
|
|
|
|
|
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/router.js?v={{$.Version}}"></script>
|
|
|
|
|
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/app.js?v={{$.Version}}"></script>
|
|
|
|
|
{{end}}
|
|
|
|
|
|