From 99e7de9efd969cef7fc12482f5e3b02ff1a6c246 Mon Sep 17 00:00:00 2001 From: ViperEkura <3081035982@qq.com> Date: Wed, 15 Apr 2026 20:42:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.yaml | 4 + dashboard/src/style.css | 8 +- dashboard/src/utils/api.js | 4 +- dashboard/src/views/ConversationView.vue | 5 +- dashboard/src/views/SettingsView.vue | 98 +++++- luxx/__init__.py | 4 +- luxx/config.py | 9 + luxx/models.py | 4 + luxx/routes/auth.py | 37 ++ luxx/routes/messages.py | 8 +- luxx/services/chat.py | 14 +- luxx/tools/builtin/__init__.py | 3 +- luxx/tools/builtin/file.py | 413 +++++++++++++++++++++++ luxx/tools/core.py | 38 ++- luxx/tools/executor.py | 55 ++- luxx/tools/factory.py | 19 +- 16 files changed, 684 insertions(+), 39 deletions(-) create mode 100644 luxx/tools/builtin/file.py diff --git a/config.yaml b/config.yaml index fc17190..8e636e1 100644 --- a/config.yaml +++ b/config.yaml @@ -9,6 +9,10 @@ database: type: sqlite url: sqlite:///./chat.db +workspace: + root: ./workspaces + auto_create: true + llm: provider: deepseek api_key: ${DEEPSEEK_API_KEY} diff --git a/dashboard/src/style.css b/dashboard/src/style.css index f0df474..da40f43 100644 --- a/dashboard/src/style.css +++ b/dashboard/src/style.css @@ -336,14 +336,14 @@ body { .message-bubble.user .message-container { align-items: flex-end; width: fit-content; - max-width: 70%; + max-width: 80%; } .message-bubble.assistant .message-container { align-items: flex-start; flex: 1 1 auto; - width: 90%; - max-width: 90%; + width: 80%; + max-width: 80%; min-width: 0; } @@ -354,7 +354,7 @@ body { .avatar { width: 32px; height: 32px; - border-radius: 8px; + border-radius: 50%; display: flex; align-items: center; justify-content: center; diff --git a/dashboard/src/utils/api.js b/dashboard/src/utils/api.js index 12029cf..b703224 100644 --- a/dashboard/src/utils/api.js +++ b/dashboard/src/utils/api.js @@ -157,7 +157,9 @@ export const authAPI = { login: (data) => api.post('/auth/login', data), register: (data) => api.post('/auth/register', data), logout: () => api.post('/auth/logout'), - getMe: () => api.get('/auth/me') + getMe: () => api.get('/auth/me'), + listUsers: () => api.get('/auth/users'), + updateUserPermission: (userId, data) => api.put(`/auth/users/${userId}`, data) } // ============ 会话接口 ============ diff --git a/dashboard/src/views/ConversationView.vue b/dashboard/src/views/ConversationView.vue index 7978734..4e5f41f 100644 --- a/dashboard/src/views/ConversationView.vue +++ b/dashboard/src/views/ConversationView.vue @@ -80,7 +80,7 @@ />
-
Luxx
+
Luxx
{ .chat-message { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; } .chat-message.user { flex-direction: row-reverse; } .chat-message.streaming { opacity: 0.9; } -.chat-message.streaming .message-avatar { animation: pulse 1.5s ease-in-out infinite; } +.chat-message.streaming .avatar { animation: pulse 1.5s ease-in-out infinite; } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } } -.message-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; } .message-content { max-width: 80%; width: 80%; } .chat-message.user .message-content { max-width: 80%; width: auto; } .message-text { padding: 0.65rem 0.9rem; border-radius: 12px; font-size: 0.9rem; line-height: 1.5; background: var(--bg-secondary); color: var(--text-primary); word-break: break-word; } diff --git a/dashboard/src/views/SettingsView.vue b/dashboard/src/views/SettingsView.vue index f3004cd..ad11807 100644 --- a/dashboard/src/views/SettingsView.vue +++ b/dashboard/src/views/SettingsView.vue @@ -185,6 +185,49 @@
+ +
+
+ 👥 + 用户管理 +
+ +
加载中...
+
{{ usersError }}
+
+ + + + + + + + + + + + + + + + + + + +
用户名邮箱角色权限级别操作
{{ u.username }}{{ u.email || '-' }}{{ u.role }} + + + {{ getPermissionName(u.permission_level) }} +
+
+
暂无用户
+
+