mirror of
https://github.com/chenyme/grok2api.git
synced 2026-12-05 16:02:12 +00:00
feat: update chat UI with multi-session management and improved layout
This commit is contained in:
1 parent
e3b864c87b
commit
4fbf192cbd
13 files changed
+114
-81
No files matched your search
@@ -9,8 +9,8 @@
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-sans/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-mono/style.css" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/admin/css/cache.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/admin/css/cache.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/common/css/toast.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
@@ -196,12 +196,12 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/batch-sse.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/header.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/batch-sse.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/header.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/toast.js"></script>
|
||||
<script src="/static/admin/js/cache.js?v=1.5.2"></script>
|
||||
<script src="/static/admin/js/cache.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/draggable.js"></script>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-sans/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-mono/style.css" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/admin/css/config.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/admin/css/config.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/common/css/toast.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
@@ -46,11 +46,11 @@
|
||||
</main>
|
||||
<div id="app-footer"></div>
|
||||
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/header.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/header.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/toast.js"></script>
|
||||
<script src="/static/admin/js/config.js?v=1.5.2"></script>
|
||||
<script src="/static/admin/js/config.js?v=1.5.3"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -24,8 +24,8 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<link href="/static/common/css/common.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/common/css/login.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/common/css/login.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/common/css/toast.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
@@ -55,10 +55,10 @@
|
||||
|
||||
<div id="app-footer"></div>
|
||||
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/toast.js"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.2"></script>
|
||||
<script src="/static/admin/js/login.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.3"></script>
|
||||
<script src="/static/admin/js/login.js?v=1.5.3"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -9,8 +9,8 @@
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-sans/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-mono/style.css" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/admin/css/token.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/admin/css/token.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/common/css/toast.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
@@ -295,12 +295,12 @@
|
||||
</div>
|
||||
|
||||
<script src="/static/common/js/draggable.js"></script>
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/batch-sse.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/header.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/batch-sse.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/header.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/toast.js"></script>
|
||||
<script src="/static/admin/js/token.js?v=1.5.2"></script>
|
||||
<script src="/static/admin/js/token.js?v=1.5.3"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -2,7 +2,7 @@ async function loadAdminFooter() {
|
||||
const container = document.getElementById('app-footer');
|
||||
if (!container) return;
|
||||
try {
|
||||
const res = await fetch('/static/common/html/footer.html?v=1.5.2');
|
||||
const res = await fetch('/static/common/html/footer.html?v=1.5.3');
|
||||
if (!res.ok) return;
|
||||
container.innerHTML = await res.text();
|
||||
} catch (e) {
|
||||
|
||||
@@ -2,7 +2,7 @@ async function loadAdminHeader() {
|
||||
const container = document.getElementById('app-header');
|
||||
if (!container) return;
|
||||
try {
|
||||
const res = await fetch('/static/common/html/header.html?v=1.5.2');
|
||||
const res = await fetch('/static/common/html/header.html?v=1.5.3');
|
||||
if (!res.ok) return;
|
||||
container.innerHTML = await res.text();
|
||||
const path = window.location.pathname;
|
||||
|
||||
@@ -2,7 +2,7 @@ async function loadPublicHeader() {
|
||||
const container = document.getElementById('app-header');
|
||||
if (!container) return;
|
||||
try {
|
||||
const res = await fetch('/static/common/html/public-header.html?v=1.5.2');
|
||||
const res = await fetch('/static/common/html/public-header.html?v=1.5.3');
|
||||
if (!res.ok) return;
|
||||
container.innerHTML = await res.text();
|
||||
const logoutBtn = container.querySelector('#public-logout-btn');
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-sans/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-mono/style.css" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/public/css/chat.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/public/css/chat.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/common/css/toast.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
@@ -19,14 +19,52 @@
|
||||
<div id="app-header"></div>
|
||||
|
||||
<main class="flex-1 container mx-auto max-w-5xl px-6 py-8 fade-in chat-main">
|
||||
<div class="chat-shell">
|
||||
<div class="chat-title">
|
||||
<div>
|
||||
<h2 class="chat-title-text">Chat 聊天</h2>
|
||||
<p class="chat-subtitle">通过 chat 接口与 Grok 进行会话聊天</p>
|
||||
<div class="chat-layout">
|
||||
<aside class="chat-sidebar" id="chatSidebar">
|
||||
<div class="sidebar-header">
|
||||
<span class="sidebar-title">会话</span>
|
||||
<div class="sidebar-actions">
|
||||
<button id="newChatBtn" class="sidebar-action-btn icon-btn" type="button" title="新增">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<line x1="12" y1="5" x2="12" y2="19"></line>
|
||||
<line x1="5" y1="12" x2="19" y2="12"></line>
|
||||
</svg>
|
||||
</button>
|
||||
<button id="collapseSidebarBtn" class="sidebar-action-btn icon-btn" type="button" title="折叠">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="15 6 9 12 15 18"></polyline>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar-list" id="sessionList"></div>
|
||||
</aside>
|
||||
<div class="sidebar-overlay" id="sidebarOverlay"></div>
|
||||
<button id="sidebarExpandBtn" class="sidebar-expand-btn icon-btn" type="button" title="展开">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="9 6 15 12 9 18"></polyline>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="chat-shell">
|
||||
<div class="chat-title">
|
||||
<div style="display:flex;align-items:center;gap:10px;">
|
||||
<button id="sidebarToggle" class="sidebar-toggle" type="button" title="会话列表">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<line x1="3" y1="6" x2="21" y2="6"></line>
|
||||
<line x1="3" y1="12" x2="21" y2="12"></line>
|
||||
<line x1="3" y1="18" x2="21" y2="18"></line>
|
||||
</svg>
|
||||
</button>
|
||||
<div>
|
||||
<h2 class="chat-title-text">Chat 聊天</h2>
|
||||
<p class="chat-subtitle">通过 chat 接口与 Grok 进行会话聊天</p>
|
||||
</div>
|
||||
</div>
|
||||
<span id="statusText" class="status-text">就绪</span>
|
||||
</div>
|
||||
<span id="statusText" class="status-text">就绪</span>
|
||||
</div>
|
||||
|
||||
<div id="chatLog" class="chat-thread">
|
||||
<div id="emptyState" class="chat-empty">输入一条消息开始对话。</div>
|
||||
@@ -47,12 +85,18 @@
|
||||
</div>
|
||||
<textarea id="promptInput" class="composer-textarea" placeholder="询问任何内容"></textarea>
|
||||
<div class="composer-actions">
|
||||
<div class="model-chip">
|
||||
<select id="modelSelect" class="model-select"></select>
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
<div class="model-chip" id="modelChip">
|
||||
<svg class="model-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
||||
<rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect>
|
||||
<line x1="8" y1="21" x2="16" y2="21"></line>
|
||||
<line x1="12" y1="17" x2="12" y2="21"></line>
|
||||
</svg>
|
||||
<span class="model-label" id="modelLabel">grok-4.20-beta</span>
|
||||
<svg class="model-chevron" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
<div class="model-dropdown hidden" id="modelDropdown"></div>
|
||||
</div>
|
||||
<div class="popover hidden">
|
||||
<button id="settingsToggle" class="icon-btn" type="button" title="设置">
|
||||
@@ -66,18 +110,6 @@
|
||||
</button>
|
||||
<div id="settingsPanel" class="settings-panel hidden">
|
||||
<div class="settings-grid">
|
||||
<div class="settings-block">
|
||||
<label class="field-label" for="reasoningSelect">推理强度</label>
|
||||
<select id="reasoningSelect" class="geist-input">
|
||||
<option value="">跟随配置</option>
|
||||
<option value="none">关闭</option>
|
||||
<option value="minimal">Minimal</option>
|
||||
<option value="low">Low</option>
|
||||
<option value="medium">Medium</option>
|
||||
<option value="high">High</option>
|
||||
<option value="xhigh">XHigh</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="settings-block">
|
||||
<label class="field-label" for="tempRange">温度</label>
|
||||
<div class="range-row">
|
||||
@@ -99,7 +131,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button id="sendBtn" class="send-btn" type="button" aria-label="Send">
|
||||
<button id="sendBtn" class="send-btn" type="button" aria-label="Send" title="发送">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M22 2L11 13"></path>
|
||||
@@ -109,16 +141,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div id="app-footer"></div>
|
||||
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/public-header.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/public-header.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/toast.js"></script>
|
||||
<script src="/static/public/js/chat.js?v=1.5.2"></script>
|
||||
<script src="/static/public/js/chat.js?v=1.5.3"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -9,8 +9,8 @@
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-sans/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-mono/style.css" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/public/css/imagine.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/public/css/imagine.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/common/css/toast.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
@@ -237,12 +237,12 @@
|
||||
|
||||
<div id="app-footer"></div>
|
||||
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/public-header.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/public-header.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/toast.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
|
||||
<script src="/static/public/js/imagine.js?v=1.5.2"></script>
|
||||
<script src="/static/public/js/imagine.js?v=1.5.3"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -24,8 +24,8 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<link href="/static/common/css/common.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/common/css/login.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/common/css/login.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/common/css/toast.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
@@ -59,10 +59,10 @@
|
||||
|
||||
<div id="app-footer"></div>
|
||||
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/toast.js"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.2"></script>
|
||||
<script src="/static/public/js/login.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.3"></script>
|
||||
<script src="/static/public/js/login.js?v=1.5.3"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -9,8 +9,8 @@
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-sans/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-mono/style.css" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/public/css/video.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/public/css/video.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/common/css/toast.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
@@ -158,11 +158,11 @@
|
||||
|
||||
<div id="app-footer"></div>
|
||||
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/public-header.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/public-header.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/toast.js"></script>
|
||||
<script src="/static/public/js/video.js?v=1.5.2"></script>
|
||||
<script src="/static/public/js/video.js?v=1.5.3"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -9,8 +9,8 @@
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-sans/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-mono/style.css" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/public/css/voice.css?v=1.5.2" rel="stylesheet">
|
||||
<link href="/static/common/css/common.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/public/css/voice.css?v=1.5.3" rel="stylesheet">
|
||||
<link href="/static/common/css/toast.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/livekit-client@2.7.3/dist/livekit-client.umd.min.js"></script>
|
||||
</head>
|
||||
@@ -147,11 +147,11 @@
|
||||
|
||||
<div id="app-footer"></div>
|
||||
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/public-header.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.2"></script>
|
||||
<script src="/static/common/js/admin-auth.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/public-header.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/footer.js?v=1.5.3"></script>
|
||||
<script src="/static/common/js/toast.js"></script>
|
||||
<script src="/static/public/js/voice.js?v=1.5.2"></script>
|
||||
<script src="/static/public/js/voice.js?v=1.5.3"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in new issue
Block a user