feat: 更新页面语言为中文并添加评论功能的 HTML 模板

This commit is contained in:
2026-02-20 04:02:53 +08:00
parent 6750a8858d
commit a934a7620d
5 changed files with 128 additions and 39 deletions

25
public/comments.html Normal file
View File

@@ -0,0 +1,25 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="https://kevisual.xiongxiao.me/root/center/panda.jpg" />
<title>Comments</title>
</head>
<body>
<script
src="https://commit.cool/client.js"
repo="kevisual/kevisual"
issue-term="custom"
issue-id="comments"
theme="light"
layout="classic"
crossorigin="anonymous"
async
></script>
</body>
</html>

View File

@@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />

View File

@@ -4,6 +4,8 @@ import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label'; import { Label } from '@/components/ui/label';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { Checkbox } from '@/components/ui/checkbox'; 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 { configSchema } from './store/schema';
import { toast } from 'sonner'; import { toast } from 'sonner';
@@ -28,6 +30,7 @@ export const ConfigPage = () => {
}; };
return ( return (
<TooltipProvider>
<div className="container mx-auto max-w-2xl py-8"> <div className="container mx-auto max-w-2xl py-8">
<Card> <Card>
<CardHeader> <CardHeader>
@@ -39,7 +42,27 @@ export const ConfigPage = () => {
<CardContent> <CardContent>
<form onSubmit={handleSubmit} className="space-y-6"> <form onSubmit={handleSubmit} className="space-y-6">
<div className="space-y-2"> <div className="space-y-2">
<div className="flex items-center gap-2">
<Label htmlFor="api-key">API </Label> <Label htmlFor="api-key">API </Label>
<Tooltip>
<TooltipTrigger>
<Info className="h-4 w-4 text-muted-foreground cursor-help" />
</TooltipTrigger>
<TooltipContent>
<p>
访 CNB API
<a
href="https://cnb.cool/profile/token"
target="_blank"
rel="noopener noreferrer"
className="underline ml-1 hover:text-blue-400"
>
</a>
</p>
</TooltipContent>
</Tooltip>
</div>
<Input <Input
id="api-key" id="api-key"
type="text" type="text"
@@ -50,7 +73,27 @@ export const ConfigPage = () => {
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<div className="flex items-center gap-2">
<Label htmlFor="cookie">Cookie</Label> <Label htmlFor="cookie">Cookie</Label>
<Tooltip>
<TooltipTrigger>
<Info className="h-4 w-4 text-muted-foreground cursor-help" />
</TooltipTrigger>
<TooltipContent>
<p>
Cookie
<a
href="https://cnb.cool/kevisual/cnb-live-extension"
target="_blank"
rel="noopener noreferrer"
className="underline ml-1 hover:text-blue-400"
>
</a>
</p>
</TooltipContent>
</Tooltip>
</div>
<Input <Input
id="cookie" id="cookie"
type="text" type="text"
@@ -105,7 +148,19 @@ export const ConfigPage = () => {
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<div className="flex items-center gap-2">
<Label htmlFor="ai-api-key">AI </Label> <Label htmlFor="ai-api-key">AI </Label>
<Tooltip>
<TooltipTrigger>
<Info className="h-4 w-4 text-muted-foreground cursor-help" />
</TooltipTrigger>
<TooltipContent>
<p>
使 CNB AI API
</p>
</TooltipContent>
</Tooltip>
</div>
<Input <Input
id="ai-api-key" id="ai-api-key"
type="password" type="password"
@@ -125,6 +180,7 @@ export const ConfigPage = () => {
</CardContent> </CardContent>
</Card> </Card>
</div> </div>
</TooltipProvider>
); );
}; };

View File

@@ -262,7 +262,6 @@ export const useRepoStore = create<State>((set, get) => {
} }
const res = await checkOpen() const res = await checkOpen()
if (res.code === 300) { if (res.code === 300) {
toast.success(`新创建了一个工作区sn: ${res.data?.sn}`)
if (params.open) { if (params.open) {
const loadingToastId = toast.loading('正在启动工作区...') const loadingToastId = toast.loading('正在启动工作区...')
const interval = setInterval(async () => { const interval = setInterval(async () => {
@@ -311,7 +310,7 @@ export const useRepoStore = create<State>((set, get) => {
toast.success('工作区已停止'); toast.success('工作区已停止');
// 停止成功后关闭弹窗 // 停止成功后关闭弹窗
set({ showWorkspaceDialog: false }); set({ showWorkspaceDialog: false });
get().getList(true) get().refresh({ showTips: false });
} else { } else {
toast.error(res.message || '停止失败'); toast.error(res.message || '停止失败');
} }

View File

@@ -3,6 +3,7 @@ import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import { Toaster } from '@/components/ui/sonner' import { Toaster } from '@/components/ui/sonner'
import { useConfigStore } from '@/app/config/store' import { useConfigStore } from '@/app/config/store'
import { useEffect } from 'react' import { useEffect } from 'react'
import { Settings } from 'lucide-react'
export const Route = createRootRoute({ export const Route = createRootRoute({
component: RootComponent, component: RootComponent,
}) })
@@ -20,18 +21,26 @@ function RootComponent() {
return ( return (
<div className='h-full overflow-hidden'> <div className='h-full overflow-hidden'>
<div className="p-2 flex gap-2 text-lg"> <div className="p-2 flex gap-2 text-lg items-center">
<Link <Link
to="/" to="/"
activeProps={{ activeProps={{
className: 'font-bold', className: 'text-gray-800',
}}
inactiveProps={{
className: 'text-gray-500',
}} }}
activeOptions={{ exact: true }}
> >
</Link> </Link>
<Link to='/config'> <Link to='/config' activeProps={{
className: 'text-gray-800',
}}
inactiveProps={{
className: 'text-gray-500',
}}
>
<Settings className="h-5 w-5" />
</Link> </Link>
</div> </div>
<hr /> <hr />