diff --git a/frontend/public/help/asset-management.png b/frontend/public/help/asset-management.png index d2f5195..af3d5fd 100644 Binary files a/frontend/public/help/asset-management.png and b/frontend/public/help/asset-management.png differ diff --git a/frontend/public/help/dashboard.png b/frontend/public/help/dashboard.png index 0f83497..61e568c 100644 Binary files a/frontend/public/help/dashboard.png and b/frontend/public/help/dashboard.png differ diff --git a/frontend/public/help/delivery.png b/frontend/public/help/delivery.png index a37cf07..dff6025 100644 Binary files a/frontend/public/help/delivery.png and b/frontend/public/help/delivery.png differ diff --git a/frontend/public/help/dispatch.png b/frontend/public/help/dispatch.png index a6bbe33..70cd07e 100644 Binary files a/frontend/public/help/dispatch.png and b/frontend/public/help/dispatch.png differ diff --git a/frontend/public/help/model-center.png b/frontend/public/help/model-center.png index e675330..f6684ae 100644 Binary files a/frontend/public/help/model-center.png and b/frontend/public/help/model-center.png differ diff --git a/frontend/public/help/overview.png b/frontend/public/help/overview.png index 054fdba..b8346cd 100644 Binary files a/frontend/public/help/overview.png and b/frontend/public/help/overview.png differ diff --git a/frontend/public/help/review.png b/frontend/public/help/review.png index 52e5983..45c8282 100644 Binary files a/frontend/public/help/review.png and b/frontend/public/help/review.png differ diff --git a/frontend/public/help/scene-assets.png b/frontend/public/help/scene-assets.png index 944325e..7bb6506 100644 Binary files a/frontend/public/help/scene-assets.png and b/frontend/public/help/scene-assets.png differ diff --git a/frontend/public/help/storyboard-inspector.png b/frontend/public/help/storyboard-inspector.png index 975ed01..36b541b 100644 Binary files a/frontend/public/help/storyboard-inspector.png and b/frontend/public/help/storyboard-inspector.png differ diff --git a/frontend/public/help/storyboard.png b/frontend/public/help/storyboard.png index 8aec661..11bb0d1 100644 Binary files a/frontend/public/help/storyboard.png and b/frontend/public/help/storyboard.png differ diff --git a/frontend/public/help/timeline.png b/frontend/public/help/timeline.png index dce93b0..4305808 100644 Binary files a/frontend/public/help/timeline.png and b/frontend/public/help/timeline.png differ diff --git a/frontend/public/help/voice-assets.png b/frontend/public/help/voice-assets.png index eef4303..f017df2 100644 Binary files a/frontend/public/help/voice-assets.png and b/frontend/public/help/voice-assets.png differ diff --git a/frontend/src/pages/Account.tsx b/frontend/src/pages/Account.tsx index e5a37e0..ba55812 100644 --- a/frontend/src/pages/Account.tsx +++ b/frontend/src/pages/Account.tsx @@ -13,6 +13,7 @@ import { useAutoRefresh } from '../hooks/use-auto-refresh' import { SecretInput } from '../components/forms' import { Actions, Button, CardRow, Empty, ErrorText, Field, FormGrid, FormRow, Input, Layout, Notice, PageHead, Panel, PanelHead, Stack, Tag } from '../components/ui' import { login, roleLabel, setUser, useAuthStore } from '../stores/auth' +import { IconCheck, IconKey, IconLogout, IconUser } from '../components/icons' const RULES_HINT = '至少 8 位,字母 / 数字 / 符号至少两种' @@ -119,7 +120,7 @@ export default function Account() { - + @@ -143,11 +144,11 @@ export default function Account() { - - @@ -169,8 +170,8 @@ export default function Account() { {row.current ? '当前会话' : describeUserAgent(row.label)}} right={row.current - ? 使用中 - : }> + ? 使用中 + : }>

{row.ip || '未知 IP'} · 活跃于 {fmtAgo(row.last_seen_at)} · {fmtTime(row.expires_at)} 过期

))} diff --git a/frontend/src/pages/AssetLibrary.tsx b/frontend/src/pages/AssetLibrary.tsx index da3e354..ff3de92 100644 --- a/frontend/src/pages/AssetLibrary.tsx +++ b/frontend/src/pages/AssetLibrary.tsx @@ -41,8 +41,8 @@ import { MediaPick, MediaRemove, MediaThumb, type MediaRadius } from '../compone import { RecordAudio, type RecordPickMeta } from '../components/media/RecordAudio' import { useAutoRefresh } from '../hooks' import { useRecordingBusy } from '../stores/recording' -import { BarRight, Between, Button, CardActions, Check, Checkbox, Chip, ChipBar, Ctlbar, Drawer, Empty, ErrorText, Field, FieldBlock, FilePick, FormGrid, FormRow, Grid, Input, LINK_CLS, MONO, MUTED, MUTED_MONO, Modal, Notice, NumberInput, PageHead, Pager, Panel, PanelHead, Row, SearchInput, SectionTitle, Spinner, Tabs, Tag, TagGroup, TextArea, ViewSwitch, Stat, StatGrid } from '../components/ui' -import { IconAdd, IconBlocks, IconBolt, IconClose, IconDelete, IconGrid, IconImage, IconList, IconRobot, IconSound, IconUser, IconVoice } from '../components/icons' +import { ActionGroup, BarRight, Between, Block, Button, CardActions, Check, Checkbox, Chip, ChipBar, Ctlbar, Drawer, Empty, ErrorText, Field, FieldBlock, FilePick, FormGrid, FormRow, Grid, Input, LINK_CLS, MONO, MUTED, MUTED_MONO, Modal, Notice, NumberInput, PageHead, Pager, Panel, PanelHead, Row, SearchInput, SectionTitle, Spinner, Stat, StatGrid, Tabs, Tag, TagGroup, TextArea, Tile, Value, ViewSwitch } from '../components/ui' +import { IconAdd, IconBlocks, IconBolt, IconCheck, IconUpload, IconClose, IconDelete, IconEdit, IconGrid, IconImage, IconLibrary, IconList, IconRobot, IconSound, IconTag, IconUser, IconVoice } from '../components/icons' type AssetType = 'human' | 'scene' | 'voice' type ViewMode = 'grid' | 'list' | 'media' @@ -1033,8 +1033,10 @@ export default function AssetLibrary() { hint: `${TYPE_META[key].hint}。资产在此管理母版,进入项目后仍可独立改版` }))} /> -
- + {/* 一张卡装下「卡头 + 筛选 + 标签 + 列表 + 分页」: + 以前外面套一层什么都不管的
,卡自己又写 p-4(antd 的卡身内边距 + 于是变成两层),筛选条再自己描一次边——卡里套盒子,盒子里再套盒子。 */} + } /> - {/* 筛选栏:只有皮肤,布局(等高 / 折行 / 行内标签)全部来自 Ctlbar。 + {/* 筛选栏:坐在卡正文里,不再自己描边(站内有边框的横块只有 Card 一种)。 「每页」不在这里——分页条是 page_size 唯一的家(UI规范 §5)。 */} - - + + setSearch(e.target.value)} aria-label="搜索平台资产" placeholder="名称 / 代号 / 设定 / 提示词 / 标签(跨字段)" /> - - patchFilters({ kind: String(next) })} options={[{ value: '', label: '全部类型' }, ...kindOptions.map((entry) => ({ @@ -1065,14 +1067,14 @@ export default function AssetLibrary() { {view !== 'media' ? ( <> - - patchFilters({ has_media: String(next) })} options={[{ value: '', label: '全部情况' }, { value: 'with', label: '已有素材' }, { value: 'without', label: '待补素材' }]} /> - - patchFilters({ status: String(next) })} options={[{ value: '', label: '全部状态' }, { value: 'active', label: '启用中' }, { value: 'inactive', label: '已停用' }]} /> @@ -1083,8 +1085,8 @@ export default function AssetLibrary() { 仅多版本素材 )} - - (view === 'media' ? patchWall({ sort: String(next) }) @@ -1125,27 +1127,27 @@ export default function AssetLibrary() { {/* AS-10:勾选后先摊开影响面(素材量 / 体积 / 谁在引用),再给动作 */} {view !== 'media' && selected.size > 0 && ( -
+ 已选 {selected.size} 个{typeMeta.label}母版 - {selectedSummary} - - - - + + - -
+ + )} {view === 'media' && selectedMedia.size > 0 && ( -
+ 已选 {selectedMedia.size} 个素材 - - -
+ + )} {view === 'media' ? ( @@ -1153,15 +1155,17 @@ export default function AssetLibrary() { /* AS-9:「筛不出东西」和「本来就空的」是两件事,出口也不同 */ {filtersActive - ? <>没有符合条件的素材。 + ? <>没有符合条件的素材。 : <>当前类型还没有登记任何素材。切回母版视图,用卡片上的「AI 生成」或「上传」补素材。} ) : ( -
+ /* 【全站唯一保留的私有栅格】素材墙按**容器**宽度铺满缩略图: + antd 的 Row/Col 断点看的是视口,抽屉与两栏里会算错列数, + auto-fill + minmax 才是这一族该有的行为。 */ +
{wall.items.map((media: any, idx: number) => ( -
+ { e.stopPropagation(); toggleMedia(media, idx, e.shiftKey) }} /> @@ -1182,7 +1186,7 @@ export default function AssetLibrary() { {media.version_count > 1 && `(共 ${media.version_count} 版)`}
-
+ ))}
) @@ -1190,11 +1194,11 @@ export default function AssetLibrary() { {filtersActive ? ( <>没有符合当前筛选条件的{typeMeta.label}母版。 - + ) : ( <>还没有{typeMeta.label}母版。 - + ,或到项目资产库把已有资产「上架到平台」。 )} @@ -1203,23 +1207,24 @@ export default function AssetLibrary() { /* 列表视图:一行一个母版,专为批量勾选与巡检设计 */
{rows.map((row: any, idx: number) => ( -
- + /* 一行母版 = 整块热区那一族(Tile pick)。 + 症状:这一行自己写了五轨道 grid(含 minmax(200px,1fr))+ 私有断点 max-lg + + 一层 145° 渐变底——同一屏里卡片按 antd 栅格降列、列表按私有轨道降列, + 两套尺子各排各的,选中态还得再手写一遍 box-shadow。 + 做法:皮肤交给 Tile(描边 / 圆角 / 底色 / 命中态都在 kit 里), + 分区交给会折行的 Flex:窄屏时素材条自己隐藏,不需要再改轨道。 */ + + { e.stopPropagation(); toggleSelect(row, idx, e.shiftKey) }} />
{row.name} {row.code || `${type}-${row.id}`} - {!!row.is_default && 默认声线} + {!!row.is_default && 默认声线} {row.is_active === false && 停用} {!!row.duplicate_of?.length && ( {row.style_version || row.version || 'v1'} · {fmtAgo(row.updated_at)}
-
+
{stripOf(row, 5).map((media: any) => ( 暂无素材}
-
- label="上传" title="选完即作为新版本登记到这个母版下" onFiles={(files) => files.forEach((file) => void uploadFile(row, file, uploadKindFor(row)))} /> - +
- - + +
-
+ ))}
) : ( @@ -1281,11 +1286,9 @@ export default function AssetLibrary() { {rows.map((row: any, idx: number) => { const audios = (row.assets || []).filter(isAudio) return ( -
+ { e.stopPropagation(); toggleSelect(row, idx, e.shiftKey) }} /> @@ -1294,8 +1297,8 @@ export default function AssetLibrary() {
-

{row.name}

- {!!row.is_default && 默认声线} + {row.name} + {!!row.is_default && 默认声线} {row.is_active === false && 停用} {!!row.duplicate_of?.length && (
{row.code || `${type}-${row.id}`}
- +

@@ -1381,11 +1384,13 @@ export default function AssetLibrary() { + {/* 「传成哪一类」和「上传」是同一个动作的两半,拆到两行就读不出主谓 */} + setForm({ name: e.target.value })} /> @@ -404,8 +400,8 @@ export default function Dashboard() { {modelWarnings.map((w, i) => {w})} - - + + @@ -420,76 +416,88 @@ export default function Dashboard() { - - - setKeyword(e.target.value)} /> - - - ({ value: st, label: statusLabel(st) }))]} /> + + {keyword || statusFilter + ? ( + + ) + : null} + {loading ? 正在读取项目… : !filtered.length ? 还没有项目。点击右上角「新建长视频项目」开始。 : ( <> - - - - - - - - - - - - {filtered.map((p) => ( - - - - - - - - - - - ))} - -
项目状态流程节点镜头进度时长成本操作
-
-
- {p.cover_url - ? - : - {p.shot_count ? : } - } -
-
- {p.name} -
{p.aspect_ratio} · {p.resolution} · {p.fps}fps - {p.genre ? ` · ${p.genre}` : ''} -
-
-
-
{stageNote(p)}{p.stats?.shots || 0} - / 合格 {p.stats?.shots_approved || 0} - - - {pct(p.stats?.progress_ratio)} - {(p.stats?.planned_duration || 0).toFixed(0)}s{fmtMoney(p.stats?.cost?.total_cost)} - - 进入 - - -
-
+ ( +
+
+ {p.cover_url + ? + : + {p.shot_count ? : } + } +
+
+ {p.name} +
{p.aspect_ratio} · {p.resolution} · {p.fps}fps + {p.genre ? ` · ${p.genre}` : ''} +
+
+
+ ) }, + { title: '状态', key: 'status', width: 104, className: NOWRAP, render: (_: any, p: any) => }, + { title: '流程节点', key: 'stage', width: 172, className: cellWrap, render: (_: any, p: any) => stageNote(p) }, + { title: '镜头', key: 'shots', width: 112, align: 'right', className: NOWRAP, render: (_: any, p: any) => ( + <>{p.stats?.shots || 0} / 合格 {p.stats?.shots_approved || 0} + ) }, + { title: '进度', key: 'progress', width: 118, align: 'right', className: NOWRAP, render: (_: any, p: any) => ( + <> + + {pct(p.stats?.progress_ratio)} + + ) }, + { title: '时长', key: 'duration', width: 78, align: 'right', className: `${NOWRAP} ${MONO}`, + render: (_: any, p: any) => `${(p.stats?.planned_duration || 0).toFixed(0)}s` }, + { title: '成本', key: 'cost', width: 96, align: 'right', className: `${NOWRAP} ${MONO}`, + render: (_: any, p: any) => fmtMoney(p.stats?.cost?.total_cost) }, + { title: '操作', key: 'actions', width: 128, align: 'right', className: NOWRAP, render: (_: any, p: any) => ( + + 进入 + + )} @@ -586,12 +594,12 @@ function LibraryPicker({ open, type, onType, query, onQuery, rows, loading, erro {open ? '收起资源库' : (pickedRows.length ? `已选 ${pickedRows.length} 个资源` : '从资源库引入人物 / 场景 / 声线')} - {pickedRows.length > 0 && 创建时自动引入 {pickedRows.length} 个母版} + {pickedRows.length > 0 && 创建时自动引入 {pickedRows.length} 个母版} {open && ( -
-
+ +
{LIB_TYPES.map((t) => ( onType(t.value)}> {t.label} @@ -599,10 +607,10 @@ function LibraryPicker({ open, type, onType, query, onQuery, rows, loading, erro ? {pickedByType[t.value].length} : null} ))} - - onQuery(e.target.value)} /> + + onQuery(e.target.value)} /> - +
{error} @@ -613,6 +621,7 @@ function LibraryPicker({ open, type, onType, query, onQuery, rows, loading, erro
)} {!empty && ( + /* 按容器铺满的资源墙:格子宽度由容器算,antd 百分比栅格做不到,全站少数几处之一 */
{rows.map((row) => ( onPick(row)} /> @@ -621,8 +630,8 @@ function LibraryPicker({ open, type, onType, query, onQuery, rows, loading, erro )} {pickedRows.length > 0 && ( -
- 将引入 +
+ 将引入 {pickedRows.map((row: any) => ( )} -
+ )}
) @@ -663,7 +672,7 @@ function LibCard({ row, on, onToggle }: { row: any; on: boolean; onToggle: () => /** 窄屏项目卡:表格里那些列,在手机上换成一张卡逐项列出 */ function ProjectCard({ p, onRemove }: { p: any; onRemove: (p: any) => void }) { return ( -
+
{p.cover_url && } @@ -686,9 +695,9 @@ function ProjectCard({ p, onRemove }: { p: any; onRemove: (p: any) => void }) {
- 进入项目 - + }>进入项目 +
-
+ ) } diff --git a/frontend/src/pages/Help.tsx b/frontend/src/pages/Help.tsx index ef94463..d83250a 100644 --- a/frontend/src/pages/Help.tsx +++ b/frontend/src/pages/Help.tsx @@ -10,63 +10,127 @@ * 锚点滚动自己实现(React Router 只改 location,不会替 `#id` 滚动)。 * · 截图仍在 `frontend/public/help/`,构建后由 `/help/*.png` 直出:文件命中优先, * 未命中才回落路由,所以图片路径和路由 `/help` 同前缀但不冲突。 - * · 这些排版类是**页面私有**的(只有手册用),因此写成文件里的类名常量, - * 不占用 `components/ui/`——按 UI规范,被第二个页面用到才提上去。 + * · 版面全部走 kit(Panel / Heading / Paragraph / Code / CodeBlock / Grid / Notice / + * Block / TagGroup),页面只剩 `SHELL`、两条列表皮肤和一个 `DocCard` 是私有的: + * 手册的「图标 + 标题 + 两句说明」小卡站内只此一页在用,按 UI规范 + * 被第二个页面用到才提到 `components/ui/`。 */ -import { type MouseEvent } from 'react' -import { Link } from 'react-router-dom' -import { ExtLink } from '../components/ui' +import { type MouseEvent, type ReactNode } from 'react' +import { + Block, Chip, ChipBar, Code, CodeBlock, Divider, ExtLink, Grid, Heading, LinkButton, + Notice, Panel, Paragraph, Table, Tag, TagGroup, Value, type Columns, cellWrap +} from '../components/ui' import { IconApi, IconBolt, IconDashboard, IconImage, IconPlayCircle, IconVoice } from '../components/icons' -/** 页面外壳:行内强调、代码、链接的皮肤统一给一次,正文不重复贴类名 */ -const SHELL = 'min-w-0 [&_b]:font-semibold [&_b]:text-text [&_a_code]:text-primary [&_pre]:m-0' -const PRE = 'mt-4 overflow-x-auto rounded-lg border border-border-secondary bg-bg-layout p-3 text-xs leading-loose text-text-secondary font-mono' -const TOC_NAV = 'sticky top-[8px] z-[5] mb-7 flex flex-wrap items-center gap-2 rounded-lg ' - + 'border border-border-secondary bg-bg-container p-3 backdrop-blur' -const TOC_LINK = 'rounded-sm border border-border bg-bg-layout px-3 py-1 ' - + 'text-xs text-text-secondary no-underline hover:bg-fill-tertiary hover:border-border hover:text-text' -const SIDE = 'mt-6 flex flex-wrap items-center gap-2 rounded-lg border border-border-secondary bg-bg-container p-3' -const SIDE_LABEL = 'mr-1 text-xs font-bold text-text-tertiary' +/** 正文皮肤:只在手册根上贴一次(行内加粗、链接里的代码色),段落不再各带一套 */ +const SHELL = 'min-w-0 [&_b]:font-semibold [&_b]:text-text [&_a_code]:text-primary' +/** 章节:锚点要躲开常驻顶栏(kit 的 HEADER_HEIGHT=56),滚动定位留两档余量 */ +const SECTION = 'scroll-mt-24 mt-12 min-w-0 first:mt-0' +/** 故障排查的三列内容(现象 / 优先检查 / 处理方式):手册里唯一一张表,改成数据源 + 列定义 */ +const TROUBLE_ROWS = [ + { + key: 't00', + issue: '前后端服务未启动', + check: (<> + ./scripts/dev.sh status + ), + fix: (<> + 运行 ./scripts/dev.sh restart --no-install,再查看 .local/logs/。 + ) + }, + { + key: 't01', + issue: '启动时报 unbound variable', + check: (<> + 脚本是否将变量写作 {"${VAR}"} + ), + fix: 'Bash 3.2 下变量紧邻中文或全角符号时必须使用花括号形式。' + }, + { + key: 't02', + issue: '模型下拉框为空', + check: '模型管理中心是否启用对应媒体类型', + fix: '启用并设置默认模型;资产页加载完成后会自动同步默认值。' + }, + { + key: 't03', + issue: '资产显示被 0 个镜头使用', + check: '分镜“资产绑定”页', + fix: '逐镜头绑定人物、场景或声音;预检会提示缺失绑定。' + }, + { + key: 't04', + issue: '派发被拒或镜头被跳过', + check: '预检问题与镜头状态', + fix: '优先补齐阻塞项;只有确认需要重做时才开启强制重建。' + }, + { + key: 't05', + issue: '任务超时或进程重启', + check: '任务心跳和检查点', + fix: '使用断点续跑,保留已成功镜头,避免重复调用模型。' + }, + { + key: 't06', + issue: '时间线为空', + check: '是否存在已审核合格镜头', + fix: '先完成质检与人工审核,再重建时间线。' + }, + { + key: 't07', + issue: '字幕烧录失败', + check: (<> + /health 中的 ffmpeg_capabilities.subtitle_burn + ), + fix: '改为外挂 SRT,或安装带 libass / subtitles 滤镜的 ffmpeg。' + }, + { + key: 't08', + issue: '真实模型连接不可达', + check: '模型中心的探测结果(含中文结论)', + fix: (<> + 按探测提示确认那台机器上的 ComfyUI 进程与端口是否还在。平台直连 ComfyUI,不走系统代理,因此本机开了 Clash / VPN 也不影响出片,排查时不必检查代理设置。 + ) + }, + { + key: 't09', + issue: '点录音没有弹授权框,或提示打不开麦克风', + check: '页面会先体检麦克风:设备数、系统权限、当前地址是否 https', + fix: (<> + 按提示逐条处理:系统设置 → 隐私与安全性 → 麦克风里放开浏览器;地址栏左侧图标把麦克风改回「允许」;用 IP + http 从别的机器访问时浏览器根本没有录音接口,请改用 localhost 或 https。急着出片可先在外部录好再走「上传文件」。 + ) + }, + { + key: 't10', + issue: '点了「开始录制」一直转圈,系统授权框始终没出现(macOS)', + check: (<> + macOS 的麦克风授权框出现在屏幕左下角(不是窗口正中),很容易被忽略;一旦误点「不允许」,Chrome 会记住结论,之后不再弹框,页面只会收到一句 Requested device not found + ), + fix: (<> + 录音面板顶部有一行麦克风自检:麦克风已就绪:设备名 表示可以直接录;出现告警图标时按下面的说明逐条走,需要重置系统权限时点「复制修复命令」,粘到终端执行 tccutil reset Microphone com.google.Chrome 后回到面板点「重新检测」即可,不用重启浏览器。换了麦克风或改了系统权限也不用刷新:面板会自动重新体检。 + ) + }, + { + key: 't11', + issue: '录到一半录音面板自己消失了', + check: '是否正好切走了类型 / 筛选(母版列表换了内容,卡片上的面板随之关闭)', + fix: '录音期间平台的自动刷新会主动让路(不重建列表),录完或关掉面板后下一轮自动恢复;切换类型、翻页会离开当前母版,请先停止录制并保存这段录音。' + }, +] -/** 标签级皮肤:同一标签在手册里出现几十次,样式只在这一处定义 */ -const TAG_H1 = 'text-4xl font-bold mt-0 mb-2 text-text tracking-tight' -const TAG_P = 'text-sm text-text-quaternary leading-loose max-w-[76ch] m-0 mt-2' -const TAG_SECTION = 'scroll-mt-[88px] mt-12 min-w-0 first:mt-0' -const TAG_H2 = 'text-lg font-bold mt-1 mb-0 text-text tracking-tight' -const TAG_CODE = 'rounded-sm border border-border-secondary bg-bg-layout px-1 py-px text-xs text-primary-hover ' - + 'font-mono' -const TAG_A = 'text-primary no-underline hover:underline' -const TAG_IMG = 'block w-full rounded-lg border border-border' -const TAG_FIGCAPTION = 'flex justify-between gap-3 flex-wrap text-xs text-text-quaternary leading-loose pt-2 px-1 ' - + '[&>span]:min-w-0 [&>span+span]:shrink-0 [&>span+span]:text-primary' -const TAG_H3 = 'text-base font-bold mt-6 mb-2 text-text' -const TAG_TABLE = 'w-full border-collapse text-xs min-w-[680px]' -const TAG_TR = '[&:last-child>td]:border-b-0' -const TAG_TH = 'text-left px-3 py-3 bg-bg-layout text-text-quaternary font-bold border-b border-border ' - + 'whitespace-nowrap text-xs' -const TAG_TD = 'px-3 py-3 border-b border-border-secondary align-top text-text-secondary leading-loose last:border-b-0' -const TAG_FOOTER = 'text-xs text-text-quaternary mt-12 border-t border-border-secondary pt-5 leading-loose' +/** + * 故障排查表:前两列定宽、末列吃满剩余。 + * antd 的 Table 自己管横向滚动与单元格折行,所以表外不再套 overflow div, + * 单元格里也不再手写 border-b——TAG_TH / TAG_TD 那一族是表格自绘时代的皮肤。 + */ +const TROUBLE_COLS: Columns<(typeof TROUBLE_ROWS)[number]> = [ + { title: '现象', dataIndex: 'issue', width: '26%', className: cellWrap }, + { title: '优先检查', dataIndex: 'check', width: '30%', className: cellWrap }, + { title: '处理方式', dataIndex: 'fix', className: cellWrap } +] +/** 正文里的裸链接:段落内一个词的下划线链,Typography.Link 会把段落撑成块 */ +const LINK = 'text-primary no-underline hover:underline' -/** 版块皮肤:卡片、网格、提示条、流程节点(一一对应旧 help.html 的 class) */ -const HERO = 'relative overflow-hidden rounded-lg border border-primary-border p-6 mb-7 shadow-card ' - + 'bg-primary-bg min-w-0' -const PILLS = 'flex items-center gap-2 flex-wrap mt-4' -const PILL = 'rounded-full border border-border bg-bg-layout px-3 py-1 text-xs text-text-secondary' -const SECTION_HEAD = 'flex items-end justify-between gap-5 flex-wrap border-b border-border-secondary pb-3 mb-5 ' - + 'min-w-0' -const STEP_NO = 'block text-xs tracking-wider font-bold text-primary' -const GRID_3 = 'grid gap-4 mt-4 grid-cols-3 max-xl:grid-cols-2 max-md:grid-cols-1' -const CARD = 'min-w-0 rounded-lg border border-border-secondary bg-bg-container p-4 shadow-card [&>b]:block ' - + '[&>b]:text-sm [&>b]:font-bold [&>b]:text-text [&>b]:mb-1 [&>p]:m-0 [&>p]:text-sm ' - + '[&>p]:text-text-quaternary [&>p]:leading-loose' -const ICON = 'block text-base text-primary mb-1' -const CALLOUT_INFO = 'mt-4 rounded-lg border p-3 text-xs leading-loose min-w-0 break-words ' - + 'border-info-border bg-info-bg text-text-secondary' -const SCREENSHOT = 'mt-4 min-w-0 rounded-lg border border-border-secondary bg-bg-layout p-2 overflow-hidden ' - + '[&>img]:rounded-lg [&>figcaption]:mt-2' -const CALLOUT = 'mt-4 rounded-lg border p-3 text-xs leading-loose min-w-0 break-words ' - + 'border-primary-border bg-primary-bg' -const FLOW = 'grid gap-2 mt-4 grid-cols-4 max-xl:grid-cols-3 max-xl:grid-cols-2 max-md:grid-cols-1' -const GRID_4 = 'grid gap-4 mt-4 grid-cols-4 max-xl:grid-cols-2 max-md:grid-cols-1' +/** 操作清单 / 勾选清单:antd 没有对应列表组件,保留语义标签,尺子全部走 token */ const STEPS = 'm-0 mt-3 p-0 list-none space-y-2 min-w-0 [counter-reset:steps] [&>li]:relative [&>li]:min-w-0 ' + '[&>li]:rounded-md [&>li]:border [&>li]:border-border-secondary [&>li]:bg-bg-container [&>li]:py-2 ' + '[&>li]:pr-3 [&>li]:pl-10 [&>li]:text-sm [&>li]:text-text-secondary [&>li]:leading-loose ' @@ -75,18 +139,29 @@ const STEPS = 'm-0 mt-3 p-0 list-none space-y-2 min-w-0 [counter-reset:steps] [& + '[&>li]:before:place-items-center [&>li]:before:rounded-sm [&>li]:before:bg-primary-bg ' + '[&>li]:before:text-primary [&>li]:before:font-mono [&>li]:before:text-xs ' + '[&>li]:before:content-[counter(steps)]' -const CALLOUT_WARN = 'mt-4 rounded-lg border p-3 text-xs leading-loose min-w-0 break-words ' - + 'border-warning-border bg-warning-bg text-text-secondary' const CHECKS = "m-0 mt-3 p-0 list-none space-y-2 min-w-0 [&>li]:text-sm [&>li]:text-text-secondary " + "[&>li]:leading-loose [&>li]:pl-6 [&>li]:before:float-left [&>li]:before:-ml-6 " + "[&>li]:before:mr-2 [&>li]:before:text-primary [&>li]:before:content-['✓']" -const GRID_2 = 'grid gap-4 mt-4 grid-cols-2 max-md:grid-cols-1' -const SHOT_GRID = 'grid gap-4 mt-4 grid-cols-2 max-xl:grid-cols-1' -const TABLE_WRAP = 'mt-4 overflow-x-auto rounded-lg border border-border-secondary min-w-0' -const FLOW_NODE = 'min-w-0 rounded-md border border-border-secondary bg-bg-container p-3 text-xs text-text-quaternary ' - + 'leading-relaxed [&>b]:block [&>b]:text-sm [&>b]:font-bold [&>b]:text-text [&>b]:mb-1' -const HEAD_WRAP = 'min-w-0' +/** + * 说明卡(旧 `
` 与流程节点两种自绘壳合并成一个)。 + * + * 症状:「图标 + 标题 + 两句说明」这种卡在手册里写了 31 遍,靠自绘 + * `rounded-lg border p-4 shadow-card` 加 `[&_b]:…` `[&>p]:…` 撑起来, + * 字号、圆角、间距跟站内其它卡片不是一个族,深色下描边还偏亮一档。 + * 做法:卡=antd Card(`Panel size="small"`)、标题=Typography.Title、 + * 说明=Typography.Paragraph;页面只描述「图标 + 标题 + 正文」这一层语义。 + * 为什么留在本页:目前只有手册用(规范:被第二个页面用到才提上 components/ui)。 + */ +function DocCard({ icon, title, children }: { icon?: ReactNode; title: ReactNode; children?: ReactNode }) { + return ( + + {icon && {icon}} + {title} + {children} + + ) +} /** 手册目录:`id` 与节号一改,这里跟着正文一起变 */ const TOC = [ @@ -103,190 +178,145 @@ const TOC = [ ] as [string, string, string][] /** 点目录只滚本页,不把浏览器历史堆满(返回键应该离开手册,不是退回上一个锚点) */ -function jumpTo(event: MouseEvent, id: string) { - event.preventDefault() - document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' }) - window.history.replaceState(null, '', '#' + id) +function jumpTo(id: string) { + return (event?: MouseEvent) => { + event?.preventDefault() + document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' }) + window.history.replaceState(null, '', '#' + id) + } } export default function Help() { return (
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
现象优先检查处理方式
前后端服务未启动./scripts/dev.sh status运行 ./scripts/dev.sh restart --no-install,再查看 .local/logs/。
启动时报 unbound variable脚本是否将变量写作 {"${VAR}"}Bash 3.2 下变量紧邻中文或全角符号时必须使用花括号形式。
模型下拉框为空模型管理中心是否启用对应媒体类型启用并设置默认模型;资产页加载完成后会自动同步默认值。
资产显示被 0 个镜头使用分镜“资产绑定”页逐镜头绑定人物、场景或声音;预检会提示缺失绑定。
派发被拒或镜头被跳过预检问题与镜头状态优先补齐阻塞项;只有确认需要重做时才开启强制重建。
任务超时或进程重启任务心跳和检查点使用断点续跑,保留已成功镜头,避免重复调用模型。
时间线为空是否存在已审核合格镜头先完成质检与人工审核,再重建时间线。
字幕烧录失败/health 中的 ffmpeg_capabilities.subtitle_burn改为外挂 SRT,或安装带 libass / subtitles 滤镜的 ffmpeg。
真实模型连接不可达模型中心的探测结果(含中文结论)按探测提示确认那台机器上的 ComfyUI 进程与端口是否还在。平台直连 ComfyUI,不走系统代理,因此本机开了 Clash / VPN 也不影响出片,排查时不必检查代理设置。
点录音没有弹授权框,或提示打不开麦克风页面会先体检麦克风:设备数、系统权限、当前地址是否 https按提示逐条处理:系统设置 → 隐私与安全性 → 麦克风里放开浏览器;地址栏左侧图标把麦克风改回「允许」;用 IP + http 从别的机器访问时浏览器根本没有录音接口,请改用 localhost 或 https。急着出片可先在外部录好再走「上传文件」。
点了「开始录制」一直转圈,系统授权框始终没出现(macOS)macOS 的麦克风授权框出现在屏幕左下角(不是窗口正中),很容易被忽略;一旦误点「不允许」,Chrome 会记住结论,之后不再弹框,页面只会收到一句 Requested device not found录音面板顶部有一行麦克风自检:麦克风已就绪:设备名 表示可以直接录;出现告警图标时按下面的说明逐条走,需要重置系统权限时点「复制修复命令」,粘到终端执行 tccutil reset Microphone com.google.Chrome 后回到面板点「重新检测」即可,不用重启浏览器。换了麦克风或改了系统权限也不用刷新:面板会自动重新体检。
录到一半录音面板自己消失了是否正好切走了类型 / 筛选(母版列表换了内容,卡片上的面板随之关闭)录音期间平台的自动刷新会主动让路(不重建列表),录完或关掉面板后下一轮自动恢复;切换类型、翻页会离开当前母版,请先停止录制并保存这段录音。
- -

-          {`# 快速收集运行时信息
+      
+ 08 · 故障排查 + 先看页面错误和任务错误历史,再看后端健康状态与日志;不要在未确认原因时反复重烧真实模型。 + + {`# 快速收集运行时信息 ./scripts/dev.sh status curl -fsS http://127.0.0.1:8000/health tail -n 200 .local/logs/backend.log -tail -n 200 .local/logs/frontend.log`} - +tail -n 200 .local/logs/frontend.log`} -
-
-
- 09 -

- 接口文档 -

-
-

- 所有前后端操作都通过同一组 REST 接口完成,便于脚本化、自动测试和后续接入其他客户端。 -

-
-
-
- Swagger UI -

- /docs:浏览并直接调用全部接口。 -

-
-
- OpenAPI JSON -

- /openapi.json:供代码生成与自动化测试使用。 -

-
-
- 健康检查 -

- /health:执行器、数据库、ffmpeg、守护调度器与模型数量。 -

-
-
-
- 常用接口包括 GET /api/providers、{"POST /api/projects/{id}/assets/generate"}、 {"POST /api/projects/{id}/assets/text-assist"}、{"GET /api/projects/{id}/assets/usage"}、 {"POST /api/projects/{id}/dispatch"} 与 {"POST /api/projects/{id}/compose"}。 -
+
+ 09 · 接口文档 + 所有前后端操作都通过同一组 REST 接口完成,便于脚本化、自动测试和后续接入其他客户端。 + + + /docs:浏览并直接调用全部接口。 + + + /openapi.json:供代码生成与自动化测试使用。 + + + /health:执行器、数据库、ffmpeg、守护调度器与模型数量。 + + + 常用接口包括 GET /api/providers、{"POST /api/projects/{id}/assets/generate"}、 {"POST /api/projects/{id}/assets/text-assist"}、{"GET /api/projects/{id}/assets/usage"}、 {"POST /api/projects/{id}/dispatch"} 与 {"POST /api/projects/{id}/compose"}。
-
+ + Nex Animation Studio · 本手册随平台代码维护。截图来自项目《铁血战士的猎人晚宴》的实际运行状态。 -
-
- 相关入口 - 进入工作台 - 模型管理中心 - FastAPI 接口文档 - 系统健康检查 -
+ + + 相关入口 + } type="link" to="/">进入工作台 + } type="link" to="/models">模型管理中心 + FastAPI 接口文档 + 系统健康检查 + ) } diff --git a/frontend/src/pages/Login.tsx b/frontend/src/pages/Login.tsx index 23d7e06..638bd2e 100644 --- a/frontend/src/pages/Login.tsx +++ b/frontend/src/pages/Login.tsx @@ -7,10 +7,10 @@ import { useEffect, useRef, useState, type FormEvent } from 'react' import { useNavigate, useSearchParams } from 'react-router-dom' import { SecretInput } from '../components/forms' -import { Button, FieldBlock, Input, Notice } from '../components/ui' +import { Button, FieldBlock, Heading, Input, Mark, Notice, Panel, Row, Value } from '../components/ui' import { login, useAuthStore } from '../stores/auth' import { setTheme, useAppliedTheme } from '../stores/theme' -import { IconMoon, IconSun } from '../components/icons' +import { IconMoon, IconSun, IconUser } from '../components/icons' export default function Login() { const navigate = useNavigate() @@ -57,23 +57,35 @@ export default function Login() { } return ( -
+ /* + * 症状(用户截图 2 那一类病灶):登录卡是页面自己画的——`rounded-lg border` 的盒子 + * 叠一层 `shadow-[0_24px_60px…]` 重投影,品牌行 37px 方牌、大标题裸

各写 + * 一把尺子,和站内其它所有卡(antd Card)不是同一种东西。 + * 做法:外壳=Panel(antd Card);品牌方牌用 kit 的 (与顶栏、项目总控台同一颗 N); + * 标题=Heading level={3};底注=Value。页面底色退回 antd 的 colorBgLayout, + * 那层 radial 渐变和 60px 投影整层删掉——登录页不该比产品页更花。 + * 为什么还留着原生
:Enter 提交和浏览器的密码自动填充都挂在 form 上, + * antd Card 只是 div,所以表单语义包在卡外面,而不是反过来把卡换成 form。 + */ +
{/* 和顶栏那颗是同一个动作、同一颗控件:antd 的 type="text" 图标按钮 (悬停底、按压、焦点环、图标尺寸全部来自 Button token), 页面只负责把它钉在右上角。以前这里是一颗自绘胶囊,和顶栏长得不一样。 */} -

忘记密码请联系平台管理员在「用户管理」里重置。

+ 忘记密码请联系平台管理员在「用户管理」里重置。 +
) diff --git a/frontend/src/pages/ModelCenter.tsx b/frontend/src/pages/ModelCenter.tsx index 3674e69..654704b 100644 --- a/frontend/src/pages/ModelCenter.tsx +++ b/frontend/src/pages/ModelCenter.tsx @@ -18,10 +18,10 @@ import { fmtAgo, fmtSeconds } from '../lib/format' import { useAutoRefresh } from '../hooks' import { cn } from '../lib/cn' import { EyeIcon, SecretInput, Select } from '../components/forms' -import { Between, Button, CardActions, Check, Chip, ChipBar, Ctlbar, Drawer, Empty, Field, FieldBlock, FormGrid, FormRow, Grid, IconText, Input, LinkButton, MONO, MUTED, Notice, NumberInput, PageHead, Panel, PanelHead, Row, SectionTitle, Slider, Spinner, Stat, StatGrid, Tabs, Tag, TagGroup, TextArea } from '../components/ui' +import { Between, Block, Button, CardActions, Check, Chip, ChipBar, Ctlbar, Dense, Drawer, Empty, Field, FieldBlock, FormGrid, FormRow, Grid, IconText, Input, Layout, LinkButton, MONO, MUTED, Notice, NumberInput, PageHead, Panel, PanelHead, Row, SearchInput, SectionTitle, Slider, Spinner, Stat, StatGrid, Tabs, Tag, TagGroup, TextArea, Tile, Value } from '../components/ui' import { useAuthStore } from '../stores/auth' import { useProjectStore } from '../stores/project' -import { IconAdd, IconBolt, IconChart, IconCheck, IconClose, IconGrid, IconImage, IconPlayCircle, IconVoice, IconWarn } from '../components/icons' +import { IconAdd, IconBolt, IconChart, IconCheck, IconChevronUp, IconClose, IconDelete, IconGrid, IconImage, IconNodeIndex, IconParams, IconPlayCircle, IconReload, IconVoice, IconWarn } from '../components/icons' /** /api/providers 还没回来(或后端挂了这个接口)时左栏仍要能渲染 */ const FALLBACK_TYPES = ['llm', 'video', 'image', 'tts'] @@ -515,7 +515,7 @@ export default function ModelCenter() { title={模型控制台} actions={<> {dispatchLink && ( - 任务调度 + } to={dispatchLink}>任务调度 )} } @@ -569,15 +569,15 @@ export default function ModelCenter() {
+ {/* 同项目总览:卡头右端只放计数,筛选条放正文(见 Dashboard 同处注释) */} {selectedMeta?.label}} - right={ - - - setKeyword(e.target.value)} /> - - - } /> + right={{currentRows.length} / {countOf(selectedType)} 个配置} /> + + + setKeyword(e.target.value)} /> + + {!currentRows.length ? 当前能力还没有配置。添加后即可在资产生成、分镜与调度中选择。 @@ -595,7 +595,7 @@ export default function ModelCenter() { )} {probe && ( -
+ @@ -605,9 +605,9 @@ export default function ModelCenter() { {probe.model.display_name || probe.model.model} - + -

{probe.message || '—'}

+ {probe.message || '—'} {probe.queue && ( 运行 {probe.queue.running} @@ -624,16 +624,16 @@ export default function ModelCenter() { {probe.files && (
{Object.entries(probe.files).map(([kind, items]) => ( -
- {kind} + + {kind} {((items as any[]) || []).slice(0, 8).join(' · ') || '—'} -
+ ))}
)} -
+ )}
@@ -643,8 +643,8 @@ export default function ModelCenter() { actions={<> {/* 浮层底部口径:辅助提示(mr-auto) → 取消 → 主行动。见 Overlay.DRAWER_ACTIONS 注释。 */} {busy && {busy}…} - - + }> @@ -831,20 +831,20 @@ export default function ModelCenter() {