diff --git a/frontend/src/pages/Account.tsx b/frontend/src/pages/Account.tsx index ba55812..c010bc2 100644 --- a/frontend/src/pages/Account.tsx +++ b/frontend/src/pages/Account.tsx @@ -11,7 +11,7 @@ import * as api from '../api/client' import { describeUserAgent, fmtAgo, fmtTime } from '../lib/format' 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 { Actions, Button, CardRow, Empty, ErrorText, Field, FormGrid, FormRow, Info, Input, Mono, Layout, Notice, PageHead, PageStack, Panel, PanelHead, Stack, Tag } from '../components/ui' import { login, roleLabel, setUser, useAuthStore } from '../stores/auth' import { IconCheck, IconKey, IconLogout, IconUser } from '../components/icons' @@ -96,28 +96,32 @@ export default function Account() { useAutoRefresh(() => void load(), 45000, !!busy, !!busy || formTouched) return ( -
+ {role}} /> {mustChange && 这个账号还在使用初始密码,请先修改密码再开始制作。} setNotice('')}>{notice} - {error} + {error} +{/* 只读身份项(登录名 / 角色)不再伪装成禁用输入框:灰盒会让人以为能改, + 可编辑的显示名与邮箱才留在表单里。(R16.3 只读回显一律 Info) */} + {auth.user?.username || '—'} }, + { label: '角色', value: `${role}(由管理员分配)` }, + ]} /> - setProfile((p) => ({ ...p, display_name: e.target.value }))} /> setProfile((p) => ({ ...p, email: e.target.value }))} /> - @@ -180,6 +184,6 @@ export default function Account() { -
+ ) } diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index 0437625..3ea9e84 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -19,7 +19,7 @@ import { useAutoRefresh } from '../hooks' import { Select } from '../components/forms' import { MediaThumb } from '../components/media/MediaThumb' import { WorkflowBar } from '../components/media/WorkflowBar' -import { Actions, Block, Button, Chip, ChipBar, Ctlbar, Divider, Empty, ErrorText, Field, FieldBlock, FormGrid, FormRow, Grid, Input, LINK_CLS, SearchInput, LinkButton, Loading, LogBox, LogRow, MONO, MUTED, NumberInput, PageHead, Panel, PanelHead, ProgressBar, Row, SectionTitle, Stat, StatGrid, Status, PageStack, Tile, Table, Tag, TagChip, TagGroup, TextArea, Value, cellWrap } from '../components/ui' +import { Actions, Block, Button, Chip, ChipBar, Ctlbar, Empty, ErrorText, Field, FieldBlock, FormGrid, FormRow, Grid, Input, LINK_CLS, SearchInput, LinkButton, Loading, LogBox, LogRow, MONO, MUTED, NumberInput, PageHead, Panel, PanelHead, ProgressBar, Row, SectionTitle, Stat, StatGrid, Status, PageStack, Tile, Table, Tag, TagChip, TagGroup, TextArea, Value, Clamp } from '../components/ui' import { capabilityHint, capsOf, defaultFor, deliveryResolutions, fpsChoices, isMock, loadModels, @@ -27,7 +27,7 @@ import { } from '../stores/models' import { useSystemStore } from '../stores/system' import { notify } from '../stores/notice' -import { IconAdd, IconCheck, IconChevronUp, IconClose, IconDelete, IconFolder, IconImage, IconPlayCircle, IconReload, IconSound } from '../components/icons' +import { IconAdd, IconChart, IconCheck, IconChevronUp, IconClose, IconDelete, IconFolder, IconImage, IconPlay, IconPlayCircle, IconProjects, IconReload, IconSound } from '../components/icons' /** 新建项目表单:字段名与后端 POST /api/projects 一致,提交时直接展开 */ type NewProjectForm = { name: string @@ -408,11 +408,11 @@ export default function Dashboard() { )} - - - - - + + } label="项目总数" value={totals.all} /> + } label="制作中" value={totals.active} /> + } label="已交付" value={totals.delivered} /> + } label="累计成本" value={fmtMoney(totals.cost, totals.currency)} /> @@ -456,7 +456,9 @@ export default function Dashboard() { ( + /* 第 28 轮:这一列原本 3 行(片名 + 折行的规格行)= 79px 行高。 + 片名与规格行各封顶一行、全文挂 title,封面 32px 成了唯一的高度来源。 */ + { title: '项目', key: 'project', render: (_: any, p: any) => (
{p.cover_url @@ -467,15 +469,20 @@ export default function Dashboard() { }
- {p.name} -
{p.aspect_ratio} · {p.resolution} · {p.fps}fps - {p.genre ? ` · ${p.genre}` : ''} -
+ + {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: 'stage', width: 200, 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} ) }, @@ -514,7 +521,6 @@ export default function Dashboard() { 流程节点 } /> - 示例项目流程 {filtered[0]?.name || '暂无项目'} diff --git a/frontend/src/pages/Help.tsx b/frontend/src/pages/Help.tsx index d83250a..067eef4 100644 --- a/frontend/src/pages/Help.tsx +++ b/frontend/src/pages/Help.tsx @@ -18,7 +18,7 @@ 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 + Notice, PageHead, Panel, Paragraph, Table, Tag, TagGroup, Value, type Columns, cellWrap } from '../components/ui' import { IconApi, IconBolt, IconDashboard, IconImage, IconPlayCircle, IconVoice } from '../components/icons' /** 正文皮肤:只在手册根上贴一次(行内加粗、链接里的代码色),段落不再各带一套 */ @@ -189,6 +189,21 @@ function jumpTo(id: string) { export default function Help() { return (
+ {/* 页头(第 1 条):手册也是内容页——标题与「这一页管什么」写在 PageHead 里, + 和另外 11 个页面同一把尺子(24px 标题 + 12px 说明)。 + 原先是一整块 primary 底纹的封面卡:整页只有它是彩色的,读者以为那是个提示条; + 四张能力标签改成页头眉标,封面卡的底纹与描边一起删掉(§1 一屏最多一个语义底块, + 本页后面还有 Notice 在用底纹,封面没有资格再占一次)。 */} + + 四类模型统一管理 + 资产独立生成与镜头关联 + 队列入队 / 重试 / 断点续跑 + 质检、时间线与完整导出 + } + /> - - 长视频编导平台使用手册 - 从模型配置、资产管理、脚本导入,到分镜生成、自动质检、人工审核与长视频合成, 本手册按实际业务流程说明每个页面的用途与关键操作。所有截图均来自正在运行的系统。 - - 四类模型统一管理 - 资产独立生成与镜头关联 - 队列入队 / 重试 / 断点续跑 - 质检、时间线与完整导出 - -
00 · 快速开始 建议先确认模型可用,再创建项目并导入分镜。单机模式下默认使用 SQLite 与进程内任务执行器。 diff --git a/frontend/src/pages/ProjectDetail.tsx b/frontend/src/pages/ProjectDetail.tsx index 602b254..c7b9637 100644 --- a/frontend/src/pages/ProjectDetail.tsx +++ b/frontend/src/pages/ProjectDetail.tsx @@ -3,26 +3,27 @@ * 「页签」这个词从本轮起只指页面内部页签(UI规范 §6.4),路由级子页不叫页签—— * 内容页没有外壳级页签条(§6.1)。 * - * 症状(本轮):这一层是全站唯一还留着裸
/

和自绘折叠 Tile 的地方—— - * 八个项目子页共用它,于是每一页首屏都是「一段不属于任何卡片的横条 + 一屏概览」, - * 正文被顶到折叠线以下,看着就是「这页没跟着改版」。 - * 做法:页头交还 kit 的 (Typography.Title + Flex),折叠条交还 - * (只有卡头的 Card),指标数字交还 kit 的 + 分母约定。 + * 症状(本轮 · 用户第 8 条):这一层的页头写着「← 项目总览 + 已交付 + 全部 12 个节点已完成」 + * 再加一行 24px 的项目名,而这四样在应用顶栏的流程控制台里全都有—— + * 同一屏两遍项目信息,八个子页每一页都要先读一遍重复的标题行。 + * 做法:外壳这一层压成**一条面包屑工具条**(Toolbar = 只有卡头的 Card): + * 左端 `项目总览 / 项目名` 只回答「我在哪个项目里」;右端放这一层仅有的两个动作 + * (展开概况、删除项目);状态、进度、当前节点交还顶栏,这里不再重复。 + * 环节名(资产管理 / 分镜与脚本…)与各页的主按钮由**子页自己的 PageHead** 负责(第 1 条)。 * * GL-1:项目概况(4 张指标卡 + 12 节点流程条)在桌面端同样要能收起。 * 以前只有 ≤900px 才折叠,正文被顶出首屏 ≈470px,每个子页都要先滚一屏废话。 - * 折叠状态记在 project.ts(useBriefStore):分镜工作台也要能收起这块概况, - * 两处按钮共用同一份偏好,不会各说各话。 + * 折叠状态记在 project.ts(useBriefStore):分镜工作台共用同一份偏好,不会各说各话。 + * 折叠以后这一行仍然带着概览摘要(镜头/合格/任务/成本——顶栏没有的四项,状态不重复)。 */ import { useEffect, useState } from 'react' import { Link, Outlet, useNavigate, useParams } from 'react-router-dom' import * as api from '../api/client' -import { allNodesDone, stageNote } from '../lib/pipeline' import { fmtMoney, pct, statusLabel } from '../lib/format' -import { Button, Empty, ErrorText, IconText, LINK_CLS, Loading, Notice, PageHead, PageStack, Panel, PanelHead, Stat, StatGrid, Status, Tag, Toolbar, Value } from '../components/ui' +import { Breadcrumb, Button, Empty, ErrorText, LINK_CLS, Loading, Notice, PageStack, Panel, PanelHead, Stat, StatGrid, Toolbar, Value } from '../components/ui' import { WorkflowBar } from '../components/media/WorkflowBar' import { loadProject, startPolling, stopPolling, useBriefStore, useProjectStore } from '../stores/project' -import { IconArrowBack, IconChevronDown, IconChevronUp, IconClose, IconDelete } from '../components/icons' +import { IconBolt, IconChart, IconChevronDown, IconChevronUp, IconClock, IconClose, IconDelete, IconTracks } from '../components/icons' export default function ProjectDetail() { const { id: idParam } = useParams() @@ -35,9 +36,6 @@ export default function ProjectDetail() { const { project, workflow, stats, loading, error: storeError } = useProjectStore() const nextStep = workflow.find((s: any) => s.state === 'active' || s.state === 'failed') - /** 流程走完的项目不再报「当前节点:导出完整视频」,否则和旁边的「已交付」自相矛盾 */ - const flowDone = allNodesDone(workflow) - const flowNote = stageNote(project, workflow) const taskHint = Object.entries(stats?.task_status || {}).map(([k, v]) => `${statusLabel(k)} ${v}`).join(' · ') /* 切项目:重新拉一次详情,并让轮询跟着新 id 走(卸载时一定停掉, @@ -66,35 +64,38 @@ export default function ProjectDetail() { return ( 未找到项目 #{id},可能已被删除。{' '} - 返回项目总览 + 返回项目总览 ) } const st = stats || {} - /* 折叠状态下这一行就是全部信息,所以它必须一直在:展开时是概览的摘要, - 收起时它就是那条紧凑横条(旧站用一个自绘 Tile 假扮卡头,见 K1/Toolbar)。 */ - const briefLine = `${statusLabel(project.status)} · 镜头 ${st.shots_approved || 0}/${st.shots || 0}` + /* 这一行只在**概况折叠时**出现:收起后它就是那条紧凑横条,是这一层唯一的信息源。 + 展开时下面四张 Stat 卡已经逐字给出了同样四个数字(镜头/合格/任务/成本), + 横条再重复一遍就是第 8 条要清掉的重复;项目状态、轨道进度、当前节点在顶栏 + 流程控制台上也有,同样不写。 */ + const briefLine = `镜头 ${st.shots_approved || 0}/${st.shots || 0}` + ` · 合格 ${pct(st.progress_ratio)} · 任务 ${st.tasks_active || 0}/${st.tasks || 0}` + ` · 成本 ${fmtMoney(st.cost?.total_cost, st.cost?.currency)}` return ( - - }>项目总览 - - {flowDone - ? {flowNote} - : 当前节点:{flowNote || project.stage_label}} - } - /* 项目状态由 project.ts 每 6 秒轮询,页面无需再单独刷新 */ - actions={ + {/* 一条面包屑代替原来的「返回 + 状态 Tag + 节点 Tag + 24px 项目名」: + 右端两个动作就是这一层的全部职责(收放概况、删除项目)。 + 项目状态由 project.ts 每 6 秒轮询,页面无需再单独刷新。 */} + } + sub={summaryOpen ? undefined : briefLine} + actions={<> + - } + } /> {error || storeError} @@ -111,36 +112,22 @@ export default function ProjectDetail() { )} - {/* 折叠条在所有断点都可用:收起后这一行本身就是紧凑摘要,正文直接顶到首屏。 - 它是「一行卡头」,所以就是 Toolbar(antd Card 的 title/extra),不再用自绘 Tile。 */} - - 项目概况 - {briefLine} - } - actions={ - - } - /> - + {/* 展开后的概览:指标卡 + 12 节点流程条。折叠入口只有面包屑那一颗按钮。 */} {summaryOpen && ( <> - + {/* 「主数字 + 灰分母」走 kit Stat 的 约定(字号/颜色只定义一次), 页面不再自己写 text-base text-text-quaternary 这套私有度量。 */} - } label="镜头(合格/总数)" value={<>{st.shots_approved || 0}/ {st.shots || 0}} hint={`${statusLabel('failed')} ${st.shots_failed || 0} · ${st.shots_rejected || 0} 驳回`} /> - } label="时长(计划/已生成)" value={<>{(st.planned_duration || 0).toFixed(1)}s/ {(st.generated_duration || 0).toFixed(1)}s} hint={`镜头合格进度 ${pct(st.progress_ratio)}`} /> - } label="任务(活跃/总数)" value={<>{st.tasks_active || 0}/ {st.tasks || 0}} hint={taskHint || '暂无任务'} /> - } label="成本 / 成片" value={fmtMoney(st.cost?.total_cost, st.cost?.currency)} hint={`${(st.exports || []).length} 个导出记录`} /> diff --git a/frontend/src/pages/UserAdmin.tsx b/frontend/src/pages/UserAdmin.tsx index 438a006..947811e 100644 --- a/frontend/src/pages/UserAdmin.tsx +++ b/frontend/src/pages/UserAdmin.tsx @@ -10,10 +10,10 @@ import * as api from '../api/client' import { fmtAgo, fmtTime } from '../lib/format' import { useAutoRefresh } from '../hooks' import { SecretInput, Select } from '../components/forms' -import { ActionGroup, Actions, Badge, Button, Check, Ctlbar, Empty, ErrorText, Field, FieldBlock, FormRow, Heading, Input, Layout, MUTED, MUTED_MONO, Mono, PageHead, Panel, PanelHead, SearchInput, Stack, Stat, StatGrid, Sub, Table, Tag, TextArea } from '../components/ui' +import { ActionGroup, Actions, Badge, Button, Check, Ctlbar, Empty, ErrorText, Field, FieldBlock, FormRow, Heading, Input, Layout, MUTED, MUTED_MONO, Mono, PageHead, PageStack, Panel, PanelHead, SearchInput, Stack, Stat, StatGrid, Sub, Table, Tag, TextArea } from '../components/ui' import { notify, notifyBad } from '../stores/notice' import { roleLabel, useAuthStore } from '../stores/auth' -import { IconAdd, IconCheck, IconKey, IconLogout, IconStop } from '../components/icons' +import { IconAdd, IconCheck, IconClock, IconKey, IconLogout, IconStop, IconTeam, IconUser } from '../components/icons' const FALLBACK_ROLES = ['admin', 'editor', 'viewer'].map((v) => ({ value: v, label: roleLabel(v) })) @@ -155,20 +155,21 @@ export default function UserAdmin() { } return ( -
+ - {error} + {error} {/* 统计卡一共 5 项:给 5 列,别让第 5 张孤零零掉到第二行 */} {/* 症状:档位写成「≤1600 三列」,而 1440 正是最常见的宽度——5 张卡排成 3+2, 右下角留一个空位,看着像少了一张卡。5 这一档本来就排得下(每张 ~214px, 标签最长 6 个字),宽屏一列铺满,窄下去才降列。 */} - - - - - - + {/* 五张统计卡:≥1200 就一排放完(列宽换算见 grid.tsx 的 flex 档,不再取整掉行) */} + + } label="账号总数" value={counts.total ?? users.length} /> + } label="管理员" value={counts.admins ?? 0} /> + } label="已停用" value={counts.disabled ?? 0} /> + } label="待改初始密码" value={counts.pending_password ?? 0} /> + } label="活跃会话" value={counts.sessions ?? 0} /> @@ -316,6 +317,6 @@ export default function UserAdmin() { )} -
+
) }