使用openai对UI进行了重构
This commit is contained in:
+20
-20
@@ -66,12 +66,12 @@ export default function SettingsPage() {
|
||||
<ResizableSidebar />
|
||||
<main className="flex-1 h-full overflow-y-auto p-4 md:p-10">
|
||||
<div className="mx-auto max-w-3xl space-y-8 pb-16">
|
||||
<header className="space-y-2">
|
||||
<header className="ui-enter space-y-2">
|
||||
<h1 className="text-3xl font-bold tracking-tight">设置</h1>
|
||||
<p className="text-muted-foreground">管理外观、AI、安全与备份。</p>
|
||||
</header>
|
||||
|
||||
<section className="rounded-xl border bg-card p-6 space-y-5">
|
||||
<section className="ui-card ui-enter-delayed p-6 space-y-5">
|
||||
<div className="flex items-center gap-2 border-b pb-2">
|
||||
<Type size={18} className="text-primary" />
|
||||
<h2 className="text-xl font-semibold">外观设置</h2>
|
||||
@@ -83,7 +83,7 @@ export default function SettingsPage() {
|
||||
<select
|
||||
value={fontFamily}
|
||||
onChange={(e) => setFontFamily(e.target.value)}
|
||||
className="w-full rounded-lg border bg-muted/40 px-3 py-2"
|
||||
className="ui-select"
|
||||
>
|
||||
{fontOptions.map((opt) => (
|
||||
<option key={opt.value} value={opt.value}>
|
||||
@@ -102,7 +102,7 @@ export default function SettingsPage() {
|
||||
step="1"
|
||||
value={fontSize}
|
||||
onChange={(e) => setFontSize(parseInt(e.target.value, 10))}
|
||||
className="w-full"
|
||||
className="w-full accent-primary"
|
||||
/>
|
||||
</label>
|
||||
|
||||
@@ -115,7 +115,7 @@ export default function SettingsPage() {
|
||||
step="0.1"
|
||||
value={lineHeight}
|
||||
onChange={(e) => setLineHeight(parseFloat(e.target.value))}
|
||||
className="w-full"
|
||||
className="w-full accent-primary"
|
||||
/>
|
||||
</label>
|
||||
|
||||
@@ -128,7 +128,7 @@ export default function SettingsPage() {
|
||||
step="0.1"
|
||||
value={tableLineHeight}
|
||||
onChange={(e) => setTableLineHeight(parseFloat(e.target.value))}
|
||||
className="w-full"
|
||||
className="w-full accent-primary"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
@@ -138,7 +138,7 @@ export default function SettingsPage() {
|
||||
<select
|
||||
value={timezone}
|
||||
onChange={(e) => setTimezone(e.target.value)}
|
||||
className="w-full rounded-lg border bg-muted/40 px-3 py-2"
|
||||
className="ui-select"
|
||||
>
|
||||
{timezoneOptions.map((opt) => (
|
||||
<option key={opt.value} value={opt.value}>
|
||||
@@ -149,7 +149,7 @@ export default function SettingsPage() {
|
||||
</label>
|
||||
</section>
|
||||
|
||||
<section className="rounded-xl border bg-card p-6 space-y-5">
|
||||
<section className="ui-card ui-enter-delayed p-6 space-y-5">
|
||||
<div className="flex items-center gap-2 border-b pb-2">
|
||||
<Sparkles size={18} className="text-primary" />
|
||||
<h2 className="text-xl font-semibold">AI 配置</h2>
|
||||
@@ -162,7 +162,7 @@ export default function SettingsPage() {
|
||||
type="text"
|
||||
value={aiConfig.baseURL}
|
||||
onChange={(e) => setAIConfig({ baseURL: e.target.value })}
|
||||
className="w-full rounded-lg border bg-muted/40 px-3 py-2"
|
||||
className="ui-input"
|
||||
placeholder="https://api.openai.com/v1"
|
||||
/>
|
||||
</label>
|
||||
@@ -173,7 +173,7 @@ export default function SettingsPage() {
|
||||
type="password"
|
||||
value={aiConfig.apiKey}
|
||||
onChange={(e) => setAIConfig({ apiKey: e.target.value })}
|
||||
className="w-full rounded-lg border bg-muted/40 px-3 py-2"
|
||||
className="ui-input"
|
||||
placeholder="sk-..."
|
||||
/>
|
||||
</label>
|
||||
@@ -184,18 +184,18 @@ export default function SettingsPage() {
|
||||
type="text"
|
||||
value={aiConfig.model}
|
||||
onChange={(e) => setAIConfig({ model: e.target.value })}
|
||||
className="w-full rounded-lg border bg-muted/40 px-3 py-2"
|
||||
className="ui-input"
|
||||
placeholder="gpt-4o-mini"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="rounded-xl border bg-card p-6">
|
||||
<section className="ui-card ui-enter-delayed p-6">
|
||||
<PromptManagement />
|
||||
</section>
|
||||
|
||||
<section className="rounded-xl border bg-card p-6 space-y-5">
|
||||
<section className="ui-card ui-enter-delayed p-6 space-y-5">
|
||||
<div className="flex items-center gap-2 border-b pb-2">
|
||||
<Lock size={18} className="text-primary" />
|
||||
<h2 className="text-xl font-semibold">安全设置</h2>
|
||||
@@ -206,7 +206,7 @@ export default function SettingsPage() {
|
||||
type="password"
|
||||
value={currentPassword}
|
||||
onChange={(e) => setCurrentPassword(e.target.value)}
|
||||
className="w-full rounded-lg border bg-muted/40 px-3 py-2"
|
||||
className="ui-input"
|
||||
placeholder="当前密码"
|
||||
required
|
||||
/>
|
||||
@@ -214,7 +214,7 @@ export default function SettingsPage() {
|
||||
type="password"
|
||||
value={newPassword}
|
||||
onChange={(e) => setNewPassword(e.target.value)}
|
||||
className="w-full rounded-lg border bg-muted/40 px-3 py-2"
|
||||
className="ui-input"
|
||||
placeholder="新密码"
|
||||
required
|
||||
/>
|
||||
@@ -222,7 +222,7 @@ export default function SettingsPage() {
|
||||
type="password"
|
||||
value={confirmPassword}
|
||||
onChange={(e) => setConfirmPassword(e.target.value)}
|
||||
className="w-full rounded-lg border bg-muted/40 px-3 py-2"
|
||||
className="ui-input"
|
||||
placeholder="确认新密码"
|
||||
required
|
||||
/>
|
||||
@@ -235,7 +235,7 @@ export default function SettingsPage() {
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
className="inline-flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:opacity-90"
|
||||
className="ui-btn-primary"
|
||||
>
|
||||
<Save size={14} />
|
||||
保存密码
|
||||
@@ -243,7 +243,7 @@ export default function SettingsPage() {
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section className="rounded-xl border bg-card p-6 space-y-4">
|
||||
<section className="ui-card ui-enter-delayed p-6 space-y-4">
|
||||
<h2 className="text-xl font-semibold">备份与恢复</h2>
|
||||
<p className="text-sm text-muted-foreground">恢复会覆盖当前全部文档,请谨慎操作。</p>
|
||||
|
||||
@@ -254,13 +254,13 @@ export default function SettingsPage() {
|
||||
const { exportAllPagesAsZip } = await import("@/lib/export");
|
||||
await exportAllPagesAsZip(pages);
|
||||
}}
|
||||
className="inline-flex items-center justify-center gap-2 rounded-lg bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/80"
|
||||
className="ui-btn-secondary"
|
||||
>
|
||||
<Download size={14} />
|
||||
下载备份 (Zip)
|
||||
</button>
|
||||
|
||||
<label className="inline-flex cursor-pointer items-center justify-center gap-2 rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-2 text-sm font-medium text-destructive hover:bg-destructive/20">
|
||||
<label className="ui-btn inline-flex cursor-pointer border border-destructive/30 bg-destructive/10 text-destructive hover:bg-destructive/20">
|
||||
<Upload size={14} />
|
||||
上传备份并恢复
|
||||
<input
|
||||
|
||||
Reference in New Issue
Block a user