Skip to content

Commit 6720bec

Browse files
committed
feat(ui): 新增设置页——9 个设置面板迁出课堂助手(模型/音频/AI/数据/词表分组)
1 parent d6af0af commit 6720bec

3 files changed

Lines changed: 100 additions & 55 deletions

File tree

‎app/src/App.tsx‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@ import { getCurrentWindow } from "@tauri-apps/api/window";
1616
import ClassroomPage from "./pages/ClassroomPage";
1717
import NotesPage from "./pages/NotesPage";
1818
import SessionsPage from "./pages/SessionsPage";
19+
// 2026-08-21 用户需求:设置页(课堂助手设置类面板迁出,单页滚动+分组)
20+
import SettingsPage from "./pages/SettingsPage";
1921
import AppErrorBoundary from "./components/AppErrorBoundary";
2022
import type { AiTaskState } from "./types";
2123

22-
type Page = "classroom" | "sessions" | "notes";
24+
type Page = "classroom" | "sessions" | "notes" | "settings";
2325

2426
const NAV_ITEMS: { key: Page; label: string }[] = [
2527
{ key: "classroom", label: "📡 课堂助手" },
2628
{ key: "sessions", label: "🗂 会话" },
2729
{ key: "notes", label: "📝 笔记" },
30+
{ key: "settings", label: "⚙ 设置" },
2831
];
2932

3033
function App() {
@@ -248,6 +251,10 @@ function App() {
248251
}}
249252
/>
250253
</div>
254+
<div style={{ flex: 1, display: page === "settings" ? "block" : "none", overflow: "hidden" }}>
255+
{/* 2026-08-21:设置页(保留挂载——面板状态不因切页重置;TD-004 同模式) */}
256+
<SettingsPage />
257+
</div>
251258
</main>
252259
</div>
253260
</AppErrorBoundary>

‎app/src/pages/ClassroomPage.tsx‎

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,12 @@ import { invoke } from "@tauri-apps/api/core";
1414
import { listen } from "@tauri-apps/api/event";
1515
import { WindowSelectCard } from "../components/WindowSelectCard";
1616
import VideoImportPanel from "../components/VideoImportPanel";
17-
import { OcrDeviceSetting } from "../components/OcrDeviceSetting";
18-
// TD-2026-08-19-E 清偿:模型磁盘占用面板(REQ-131 命令前端接入)
19-
import ModelDiskPanel from "../components/ModelDiskPanel";
20-
// TD-2026-08-20-H 清偿:音频落盘状态与清理入口
21-
import AudioStoragePanel from "../components/AudioStoragePanel";
22-
// TD-2026-08-20-G 清偿:数据备份/恢复(REQ-107 TRUST-1)
23-
import BackupPanel from "../components/BackupPanel";
24-
// v0.7.0 M1(REQ-101):音频预处理链开关(CER 微基准定默认后的用户通道)
25-
import { AudioPreprocSetting } from "../components/AudioPreprocSetting";
17+
// 2026-08-21 用户需求:设置类面板迁出至设置页(模型/音频/AI/数据/词表)
2618
// 2026-08 A2:实时音频电平条(VU 表——试听自检实时化)
2719
import AudioLevelMeter from "../components/AudioLevelMeter";
2820
// 2026-08 C1:引擎与模型就绪清单(开始前准备流——聚合现有只读命令)
2921
import ReadyCheckCard from "../components/ReadyCheckCard";
30-
import { VocabManager } from "../components/VocabManager";
3122
import { SystemStatusBadge } from "../components/SystemStatusBadge";
32-
// 2026-08-20 用户需求:模型管理面板(原结构分析模型改名,覆盖全部模型)
33-
import ModelManagementPanel from "../components/ModelManagementPanel";
34-
import AiServicePanel from "../components/AiServicePanel";
35-
// v0.8.0 F2(2026-08-21):AI 任务中心面板(历史/恢复/采纳复核)
36-
import AiTaskPanel from "../components/AiTaskPanel";
3723
// 2026-08 审查硬拆:右栏内容区 / 文件素材输入与提取
3824
import ClassroomRightPane from "../components/ClassroomRightPane";
3925
import MaterialInputPanel from "../components/MaterialInputPanel";
@@ -527,45 +513,8 @@ export default function ClassroomPage({ onOpenSessions }: { onOpenSessions?: (se
527513
{/* 视频文件导入(v0.3.0:REQ-015 第二入口,字幕优先 + ASR fallback) */}
528514
<VideoImportPanel />
529515

530-
{/* OCR 推理设备(v0.4.0 M1:REQ-036,ADR-009:CUDA 卸载/回退可观测/重新检测) */}
531-
<div style={panel}>
532-
<OcrDeviceSetting />
533-
</div>
534-
535-
{/* 音频预处理链(v0.7.0 M1:REQ-101——CER 微基准定默认后的用户开关) */}
536-
<div style={panel}>
537-
<AudioPreprocSetting />
538-
{/* TD-2026-08-20-H 清偿:音频落盘状态与清理入口(REQ-068 承诺兑现) */}
539-
<AudioStoragePanel />
540-
</div>
541-
542-
{/* TD-2026-08-20-G 清偿:数据备份/恢复(REQ-107 TRUST-1 能力可达化) */}
543-
<div style={panel}>
544-
<BackupPanel />
545-
</div>
546-
547-
{/* v0.8.0 M1(REQ-138/139/140):AI 服务使能层——密钥管理(DPAPI 安全
548-
存储)/余额查询/授权默认关+审计可见化 */}
549-
<div style={panel}>
550-
<AiServicePanel />
551-
{/* v0.8.0 F2(2026-08-21):AI 任务中心——历史持久化/重启恢复/采纳复核 */}
552-
<div style={{ marginTop: 8 }}>
553-
<AiTaskPanel />
554-
</div>
555-
</div>
556-
557-
{/* 词表管理(v0.4.0 M5:REQ-040:热词/替换词闭环 + 课件预热) */}
558-
<div style={panel}>
559-
<VocabManager />
560-
</div>
561-
562-
{/* 模型管理(2026-08-20 用户需求:原结构分析模型面板改名并覆盖全部模型——
563-
转写/说话人/标点/OCR/结构,按需下载、未下载自动降级) */}
564-
<div style={panel}>
565-
<ModelManagementPanel />
566-
{/* TD-2026-08-19-E 清偿:模型磁盘占用面板(REQ-131 命令前端接入) */}
567-
<ModelDiskPanel />
568-
</div>
516+
{/* 2026-08-21 用户需求:OCR 设备/音频预处理/备份/AI 服务/词表/模型管理等
517+
设置类面板已迁出至「⚙ 设置」页——课堂助手左栏仅保留采集动线 */}
569518

570519
{/* 素材输入 + 提取按钮(v0.1.0 文件流水线;审查硬拆——MaterialInputPanel) */}
571520
<MaterialInputPanel

‎app/src/pages/SettingsPage.tsx‎

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/**
2+
* SettingsPage — 设置页(2026-08-21 用户需求:课堂助手设置类面板迁出,与课堂助手同级导航)。
3+
*
4+
* @ai-context: 布局定稿(市场调研 + 用户裁决)= 单页滚动 + 分组标题(方案 A):
5+
* 模型 / 音频 / AI 服务 / 数据 / 词表 五组,共 9 个面板;
6+
* 组标题仅视觉分组,面板均为自包含组件(各自 invoke 后端配置)。
7+
* @ai-context: 状态联动设计——设置页改动后端配置(OCR 设备/预处理链/密钥/模型下载)后,
8+
* 课堂助手下次 invoke 自然读取最新值,无需共享前端状态;
9+
* 模型下载等全局事件(model:download-*)由 ClassroomPage 保留挂载的
10+
* 监听器接收(TD-004:display:none 不卸载),开始按钮就绪状态自动刷新。
11+
* @ai-context: 升级路径预留——面板数 >15 时组标题行可平滑改为左侧导航键(数据模型不变)。
12+
*/
13+
import { OcrDeviceSetting } from "../components/OcrDeviceSetting";
14+
import { AudioPreprocSetting } from "../components/AudioPreprocSetting";
15+
import AudioStoragePanel from "../components/AudioStoragePanel";
16+
import BackupPanel from "../components/BackupPanel";
17+
import { VocabManager } from "../components/VocabManager";
18+
import ModelManagementPanel from "../components/ModelManagementPanel";
19+
import ModelDiskPanel from "../components/ModelDiskPanel";
20+
import AiServicePanel from "../components/AiServicePanel";
21+
import AiTaskPanel from "../components/AiTaskPanel";
22+
23+
const panel: React.CSSProperties = { border: "1px solid #e5e7eb", borderRadius: 8, padding: 12 };
24+
const groupTitle: React.CSSProperties = {
25+
fontSize: 12,
26+
fontWeight: 600,
27+
color: "#6b7280",
28+
margin: "14px 0 8px",
29+
letterSpacing: 0.5,
30+
};
31+
32+
/** 组标题(视觉分组;面板自包含,无组级状态) */
33+
function GroupTitle({ children }: { children: React.ReactNode }) {
34+
return <div style={groupTitle}>{children}</div>;
35+
}
36+
37+
export default function SettingsPage() {
38+
return (
39+
<div style={{ height: "calc(100vh - 56px)", overflowY: "auto" }}>
40+
<div style={{ maxWidth: 720, padding: "12px 16px 24px" }}>
41+
<div style={{ fontSize: 13, color: "#6b7280", marginBottom: 4 }}>
42+
应用配置与管理。改动即时生效,课堂助手下次使用时读取最新值。
43+
</div>
44+
45+
{/* ── 模型(下载/磁盘/OCR 设备) ── */}
46+
<GroupTitle>模型</GroupTitle>
47+
<div style={{ ...panel, marginBottom: 4 }}>
48+
<ModelManagementPanel />
49+
<div style={{ marginTop: 8 }}>
50+
<ModelDiskPanel />
51+
</div>
52+
<div style={{ marginTop: 8 }}>
53+
<OcrDeviceSetting />
54+
</div>
55+
</div>
56+
57+
{/* ── 音频(预处理链/落盘管理) ── */}
58+
<GroupTitle>音频</GroupTitle>
59+
<div style={{ ...panel, marginBottom: 4 }}>
60+
<AudioPreprocSetting />
61+
<div style={{ marginTop: 8 }}>
62+
<AudioStoragePanel />
63+
</div>
64+
</div>
65+
66+
{/* ── AI 服务(密钥授权/任务中心) ── */}
67+
<GroupTitle>AI 服务</GroupTitle>
68+
<div style={{ ...panel, marginBottom: 4 }}>
69+
<AiServicePanel />
70+
<div style={{ marginTop: 8 }}>
71+
<AiTaskPanel />
72+
</div>
73+
</div>
74+
75+
{/* ── 数据(备份/恢复) ── */}
76+
<GroupTitle>数据</GroupTitle>
77+
<div style={{ ...panel, marginBottom: 4 }}>
78+
<BackupPanel />
79+
</div>
80+
81+
{/* ── 词表(热词/替换词闭环) ── */}
82+
<GroupTitle>词表</GroupTitle>
83+
<div style={{ ...panel, marginBottom: 4 }}>
84+
<VocabManager />
85+
</div>
86+
</div>
87+
</div>
88+
);
89+
}

0 commit comments

Comments
 (0)