From db80aebadca466302976fa3f34b3efbe0b9a7a21 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 1 Feb 2026 20:32:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(webui):=20=E6=B7=BB=E5=8A=A0=20API=20?= =?UTF-8?q?=E5=AF=86=E9=92=A5=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E5=92=8C?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加密钥弹窗增加「生成」按钮,自动生成 sk-xxx 格式随机密钥 - 密钥列表添加复制按钮,点击复制完整密钥到剪贴板 - 复制成功显示内联 toast 提示 --- webui/src/components/AccountManager.jsx | 66 ++++++++++++++++++------- 1 file changed, 49 insertions(+), 17 deletions(-) diff --git a/webui/src/components/AccountManager.jsx b/webui/src/components/AccountManager.jsx index 54f669e..66658a0 100644 --- a/webui/src/components/AccountManager.jsx +++ b/webui/src/components/AccountManager.jsx @@ -10,7 +10,9 @@ import { MoreHorizontal, X, Server, - ShieldCheck + ShieldCheck, + Copy, + Check } from 'lucide-react' import clsx from 'clsx' @@ -18,6 +20,7 @@ export default function AccountManager({ config, onRefresh, onMessage, authFetch const [showAddKey, setShowAddKey] = useState(false) const [showAddAccount, setShowAddAccount] = useState(false) const [newKey, setNewKey] = useState('') + const [copiedKey, setCopiedKey] = useState(null) const [newAccount, setNewAccount] = useState({ email: '', mobile: '', password: '' }) const [loading, setLoading] = useState(false) const [validating, setValidating] = useState({}) @@ -298,15 +301,34 @@ export default function AccountManager({ config, onRefresh, onMessage, authFetch {config.keys?.length > 0 ? ( config.keys.map((key, i) => (
-
- {key.slice(0, 16)}**** +
+
+ {key.slice(0, 16)}**** +
+ {copiedKey === key && ( + 已复制 + )} +
+
+ +
-
)) ) : ( @@ -445,14 +467,24 @@ export default function AccountManager({ config, onRefresh, onMessage, authFetch
- setNewKey(e.target.value)} - autoFocus - /> +
+ setNewKey(e.target.value)} + autoFocus + /> + +
+

点击「生成」自动创建随机密钥