From a934a7620d4285baadaf17aa30336689111539eb Mon Sep 17 00:00:00 2001 From: abearxiong Date: Fri, 20 Feb 2026 04:02:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E4=B8=BA=E4=B8=AD=E6=96=87=E5=B9=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AF=84=E8=AE=BA=E5=8A=9F=E8=83=BD=E7=9A=84=20HTML?= =?UTF-8?q?=20=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/comments.html | 25 ++++++++ public/demo.html | 2 +- src/app/config/page.tsx | 118 ++++++++++++++++++++++++++---------- src/app/repo/store/index.ts | 3 +- src/routes/__root.tsx | 19 ++++-- 5 files changed, 128 insertions(+), 39 deletions(-) create mode 100644 public/comments.html diff --git a/public/comments.html b/public/comments.html new file mode 100644 index 0000000..53f932e --- /dev/null +++ b/public/comments.html @@ -0,0 +1,25 @@ + + + + + + + + Comments + + + + + + + + \ No newline at end of file diff --git a/public/demo.html b/public/demo.html index 263fc86..f98d409 100644 --- a/public/demo.html +++ b/public/demo.html @@ -1,5 +1,5 @@ - + diff --git a/src/app/config/page.tsx b/src/app/config/page.tsx index 74e642c..e00a110 100644 --- a/src/app/config/page.tsx +++ b/src/app/config/page.tsx @@ -4,6 +4,8 @@ import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Button } from '@/components/ui/button'; import { Checkbox } from '@/components/ui/checkbox'; +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; +import { Info } from 'lucide-react'; import { configSchema } from './store/schema'; import { toast } from 'sonner'; @@ -28,37 +30,78 @@ export const ConfigPage = () => { }; return ( -
- - - CNB 配置 - - 配置您的 CNB API 设置。这些设置会保存在浏览器的本地存储中。 - - - -
-
- - handleChange('CNB_API_KEY', e.target.value)} - placeholder="请输入您的 CNB API 密钥" - /> -
+ +
+ + + CNB 配置 + + 配置您的 CNB API 设置。这些设置会保存在浏览器的本地存储中。 + + + + +
+
+ + + + + + +

+ 用于访问 CNB API 的密钥。 + + 点击获取 + +

+
+
+
+ handleChange('CNB_API_KEY', e.target.value)} + placeholder="请输入您的 CNB API 密钥" + /> +
-
- - handleChange('CNB_COOKIE', e.target.value)} - placeholder="请输入您的 CNB Cookie" - /> -
+
+
+ + + + + + +

+ 用于身份验证的 Cookie 信息。 + + 前往获取 + +

+
+
+
+ handleChange('CNB_COOKIE', e.target.value)} + placeholder="请输入您的 CNB Cookie" + /> +
@@ -105,7 +148,19 @@ export const ConfigPage = () => {
- +
+ + + + + + +

+ 如果使用 CNB 的 AI,密钥和 API 密钥一样即可 +

+
+
+
{
+ ); }; diff --git a/src/app/repo/store/index.ts b/src/app/repo/store/index.ts index e0b98c1..e54f360 100644 --- a/src/app/repo/store/index.ts +++ b/src/app/repo/store/index.ts @@ -262,7 +262,6 @@ export const useRepoStore = create((set, get) => { } const res = await checkOpen() if (res.code === 300) { - toast.success(`新创建了一个工作区,sn: ${res.data?.sn}`) if (params.open) { const loadingToastId = toast.loading('正在启动工作区...') const interval = setInterval(async () => { @@ -311,7 +310,7 @@ export const useRepoStore = create((set, get) => { toast.success('工作区已停止'); // 停止成功后关闭弹窗 set({ showWorkspaceDialog: false }); - get().getList(true) + get().refresh({ showTips: false }); } else { toast.error(res.message || '停止失败'); } diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index f570f97..79778b0 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -3,6 +3,7 @@ import { TanStackRouterDevtools } from '@tanstack/react-router-devtools' import { Toaster } from '@/components/ui/sonner' import { useConfigStore } from '@/app/config/store' import { useEffect } from 'react' +import { Settings } from 'lucide-react' export const Route = createRootRoute({ component: RootComponent, }) @@ -20,18 +21,26 @@ function RootComponent() { return (
-
+
仓库列表 - - 配置项 + +