feat: 新增备课模块并修复全模块 P0/P1/P2 缺陷
Some checks failed
Security / deep-security-scan (push) Failing after 20m5s
DR Drill / dr-drill (push) Failing after 1m31s
CI / scheduled-backup (push) Failing after 1m31s
CI / backup-verify (push) Has been skipped
CI / weekly-dr-drill (push) Failing after 0s
CI / build-deploy (push) Has been cancelled
CI / security-scan (push) Has been cancelled
Some checks failed
Security / deep-security-scan (push) Failing after 20m5s
DR Drill / dr-drill (push) Failing after 1m31s
CI / scheduled-backup (push) Failing after 1m31s
CI / backup-verify (push) Has been skipped
CI / weekly-dr-drill (push) Failing after 0s
CI / build-deploy (push) Has been cancelled
CI / security-scan (push) Has been cancelled
主要变更: - 新增 lesson-preparation 模块: 备课编辑器、节点编辑、AI 建议、知识点选择、版本历史、作业发布 - 新增 shared 通用组件: charts/question-bank-filters/schedule-list/ui (chip-nav/filter-bar/page-header/stat-card/stat-item) - 新增 student/admin 端 loading.tsx 与 error.tsx, 优化加载与错误态体验 - 新增 teacher/lesson-plans 页面 (列表/新建/编辑) - 新增 drizzle 迁移 0002_tiny_lionheart 及 snapshot - 新增 textbooks/schema.ts 与 exams/utils/normalize-structure.ts - 修复 Tiptap v3 SSR hydration 崩溃 (rich-text-block immediatelyRender: false) - 重构多模块 data-access/actions/组件, 修复权限校验与类型规范 - 同步架构文档 004/005 反映新增模块、导出、依赖关系 - 归档 bugs/* 测试报告与 e2e 测试脚本 (admin/parent/student/teacher web_test)
This commit is contained in:
@@ -43,7 +43,7 @@ const AiProviderFormSchema = z.object({
|
||||
type AiProviderFormValues = z.infer<typeof AiProviderFormSchema>
|
||||
|
||||
const providerLabels: Record<z.infer<typeof ProviderSchema>, string> = {
|
||||
zhipu: "智谱",
|
||||
zhipu: "Zhipu",
|
||||
openai: "OpenAI",
|
||||
gemini: "Gemini",
|
||||
custom: "Custom",
|
||||
@@ -110,7 +110,12 @@ export function AiProviderSettingsCard({
|
||||
loadedRef.current = true
|
||||
startTransition(async () => {
|
||||
try {
|
||||
const rows = await getAiProviderSummaries()
|
||||
const result = await getAiProviderSummaries()
|
||||
if (!result.success || !result.data) {
|
||||
toast.error(result.message ?? "Failed to load AI providers")
|
||||
return
|
||||
}
|
||||
const rows = result.data
|
||||
setProviders(rows)
|
||||
onProvidersChanged?.(rows)
|
||||
if (initialMode === "new") {
|
||||
@@ -215,7 +220,12 @@ export function AiProviderSettingsCard({
|
||||
toast.success(result.message ?? "Saved")
|
||||
setTestStatus("idle")
|
||||
setLastTestedSignature("")
|
||||
const rows = await getAiProviderSummaries()
|
||||
const summariesResult = await getAiProviderSummaries()
|
||||
if (!summariesResult.success || !summariesResult.data) {
|
||||
toast.error(summariesResult.message ?? "Failed to load AI providers")
|
||||
return
|
||||
}
|
||||
const rows = summariesResult.data
|
||||
setProviders(rows)
|
||||
onProvidersChanged?.(rows)
|
||||
const nextId = result.data ?? payload.id ?? ""
|
||||
@@ -295,7 +305,7 @@ export function AiProviderSettingsCard({
|
||||
name="provider"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>品牌方</FormLabel>
|
||||
<FormLabel>Provider</FormLabel>
|
||||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
<FormControl>
|
||||
<SelectTrigger>
|
||||
@@ -303,7 +313,7 @@ export function AiProviderSettingsCard({
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="zhipu">智谱</SelectItem>
|
||||
<SelectItem value="zhipu">Zhipu</SelectItem>
|
||||
<SelectItem value="openai">OpenAI</SelectItem>
|
||||
<SelectItem value="gemini">Gemini</SelectItem>
|
||||
<SelectItem value="custom">Custom</SelectItem>
|
||||
@@ -322,7 +332,7 @@ export function AiProviderSettingsCard({
|
||||
<FormControl>
|
||||
<Input {...field} placeholder="https://open.bigmodel.cn/api/paas/v4" />
|
||||
</FormControl>
|
||||
<FormDescription>填写基础地址,不要包含 /chat/completions。</FormDescription>
|
||||
<FormDescription>Enter base URL without /chat/completions suffix.</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
@@ -349,7 +359,7 @@ export function AiProviderSettingsCard({
|
||||
<FormControl>
|
||||
<Input type="password" {...field} placeholder="Paste new key to replace" />
|
||||
</FormControl>
|
||||
<FormDescription>不会回显历史 Key,留空表示不更新。</FormDescription>
|
||||
<FormDescription>Existing key won't be displayed. Leave blank to keep current.</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
@@ -364,7 +374,7 @@ export function AiProviderSettingsCard({
|
||||
<FormControl>
|
||||
<Checkbox checked={!!field.value} onCheckedChange={(value) => field.onChange(value === true)} />
|
||||
</FormControl>
|
||||
<FormLabel>设为默认</FormLabel>
|
||||
<FormLabel>Set as default</FormLabel>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user