- /image and /video pages (a3/a4): three-column layout — params (connection, workflow, upload slots driven by declared inputs, prompt/negative/seed/ size/duration fields, dynamic params), current-task card with live SSE progress + cancel, result grid with zoom/send-to-img2img/download, video player with custom amber controls + first/last-frame strip, right history with retry/delete and failure reasons - /tasks page: both task classes summarized with source labels (独立生图/独立生视频/Playground/创作流程), filters, retry/cancel/delete - nav: 生图/生视频/生成任务 real pages with active-jobs badge (进行数徽章) - playground generate accepts source (studio-image/studio-video) for origin labeling; api.ts types follow - parseDbTs helper: UTC-naive backend timestamps parse as UTC so elapsed/ ETA/duration math is offset-correct - backend tests: full-chain fake-ComfyUI server — image chain, video chain with frame uploads, retry-after-failure, delete-removes-outputs, tasks listing; i18n zh/en/es/fr/de/ja/ko complete Co-authored-by: multica-agent <github@multica.ai>
13 lines
546 B
TypeScript
13 lines
546 B
TypeScript
/**
|
|
* Backend timestamps are SQLite UTC-naive strings ("2026-09-28 01:44:28").
|
|
* `Date.parse` treats those as LOCAL time, shifting every elapsed/duration
|
|
* computation by the local UTC offset. Parse them as UTC instead; strings
|
|
* that already carry a timezone marker pass through unchanged.
|
|
*/
|
|
export function parseDbTs(raw: string | null | undefined): number {
|
|
if (!raw) return NaN;
|
|
const s = raw.trim();
|
|
if (/[zZ]$|[+-]\d{2}:?\d{2}$/.test(s)) return Date.parse(s);
|
|
return Date.parse(s.endsWith('Z') ? s : `${s.replace(' ', 'T')}Z`);
|
|
}
|