From ad3262dd5c91fc6b19f71d45d736132c505891a6 Mon Sep 17 00:00:00 2001 From: ViperEkura <3081035982@qq.com> Date: Wed, 15 Apr 2026 10:27:56 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=AE=80=E5=8C=96=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/src/style.css | 39 ++++++++++++++++++++++++++++ dashboard/src/views/SettingsView.vue | 8 +----- dashboard/src/views/ToolsView.vue | 7 +---- luxx/routes/messages.py | 3 +-- luxx/routes/tools.py | 1 - 5 files changed, 42 insertions(+), 16 deletions(-) diff --git a/dashboard/src/style.css b/dashboard/src/style.css index e83f74d..f0df474 100644 --- a/dashboard/src/style.css +++ b/dashboard/src/style.css @@ -601,3 +601,42 @@ select[aria-expanded="true"] { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; } + +/* ============ Switch Toggle ============ */ +.switch { + position: relative; + display: inline-block; + width: 40px; + height: 22px; + flex-shrink: 0; +} +.switch input { + opacity: 0; + width: 0; + height: 0; +} +.slider { + position: absolute; + cursor: pointer; + inset: 0; + background-color: #ccc; + transition: 0.3s; + border-radius: 22px; +} +.slider:before { + position: absolute; + content: ""; + height: 16px; + width: 16px; + left: 3px; + bottom: 3px; + background-color: white; + transition: 0.3s; + border-radius: 50%; +} +input:checked + .slider { + background-color: var(--accent-primary); +} +input:checked + .slider:before { + transform: translateX(18px); +} diff --git a/dashboard/src/views/SettingsView.vue b/dashboard/src/views/SettingsView.vue index 1cafb86..e4674dc 100644 --- a/dashboard/src/views/SettingsView.vue +++ b/dashboard/src/views/SettingsView.vue @@ -561,13 +561,7 @@ textarea { width: 100%; padding: 0.75rem; border: 1px solid var(--border-input); .info-item { font-size: 0.8rem; color: var(--text-primary); word-break: break-all; } .info-item.sub { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.2rem; } -/* 开关 */ -.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; } -.switch input { opacity: 0; width: 0; height: 0; } -.slider { position: absolute; cursor: pointer; inset: 0; background-color: #ccc; transition: 0.3s; border-radius: 22px; } -.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: 0.3s; border-radius: 50%; } -input:checked + .slider { background-color: var(--accent-primary); } -input:checked + .slider:before { transform: translateX(18px); } +/* 开关样式已移至全局 style.css */ /* 操作按钮 */ .ops-buttons { display: flex; flex-wrap: nowrap; gap: 0.5rem; } diff --git a/dashboard/src/views/ToolsView.vue b/dashboard/src/views/ToolsView.vue index 3e9e93d..2740c27 100644 --- a/dashboard/src/views/ToolsView.vue +++ b/dashboard/src/views/ToolsView.vue @@ -110,12 +110,7 @@ onMounted(fetchData) .params-col { width: 30%; } .param-tag { display: inline-block; padding: 0.2rem 0.5rem; background: var(--bg-code); border-radius: 4px; font-size: 0.75rem; color: var(--text-secondary); margin: 0.15rem; } .switch-col { text-align: center; } -.switch { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; } -.switch input { opacity: 0; width: 0; height: 0; } -.slider { position: absolute; cursor: pointer; inset: 0; background-color: #ccc; transition: 0.3s; border-radius: 24px; } -.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: 0.3s; border-radius: 50%; } -input:checked + .slider { background-color: #16a34a; } -input:checked + .slider:before { transform: translateX(20px); } +/* switch 样式已移至全局 style.css */ .loading { text-align: center; padding: 4rem; } .error-msg { text-align: center; padding: 2rem; color: var(--accent-primary); background: var(--accent-primary-light); border-radius: 12px; } .spinner { width: 40px; height: 40px; border: 3px solid var(--border-light); border-top-color: var(--accent-primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem; } diff --git a/luxx/routes/messages.py b/luxx/routes/messages.py index abd6e3e..9381c3e 100644 --- a/luxx/routes/messages.py +++ b/luxx/routes/messages.py @@ -83,8 +83,7 @@ def send_message( ) db.add(user_message) - from datetime import datetime, timezone, timedelta - conversation.updated_at = datetime.now(timezone(timedelta(hours=8))) + conversation.updated_at = datetime.now() response = chat_service.non_stream_response( conversation=conversation, diff --git a/luxx/routes/tools.py b/luxx/routes/tools.py index 7f8e27f..cfadf64 100644 --- a/luxx/routes/tools.py +++ b/luxx/routes/tools.py @@ -20,7 +20,6 @@ def list_tools( ): """Get available tools list""" # Get tool definitions directly from registry to access category - from luxx.tools.core import ToolDefinition if category: all_tools = [t for t in registry._tools.values() if t.category == category]