fix frontend bug
This commit is contained in:
1 parent
a18f7a5c8b
commit
9bb46f7004
10 files changed
+83
-21
No files matched your search
@@ -5,7 +5,7 @@ import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import StageStepper, { stageProgress } from "@/components/stage-stepper";
|
||||
import MetadataCard from "@/components/metadata-card";
|
||||
import { apiFetch, useJob } from "@/lib/api";
|
||||
import { apiFetch, useJob, type Job } from "@/lib/api";
|
||||
|
||||
const SUBTITLES: Record<string, string> = {
|
||||
queued: "대기 중입니다. 앞선 작업이 끝나면 자동으로 시작됩니다",
|
||||
@@ -115,6 +115,12 @@ export default function JobPage({ params }: { params: Promise<{ id: string }> })
|
||||
});
|
||||
refresh();
|
||||
} catch (e) {
|
||||
// 실패 화면을 띄워둔 사이에 끝났을 수 있다. 그때는 에러 대신 결과를 보여준다
|
||||
const latest = await apiFetch<Job>(`/api/f1/jobs/${id}`).catch(() => null);
|
||||
if (latest?.status === "done") {
|
||||
refresh();
|
||||
return;
|
||||
}
|
||||
setActionError((e as Error).message);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
@@ -316,10 +322,12 @@ export default function JobPage({ params }: { params: Promise<{ id: string }> })
|
||||
</div>
|
||||
)}
|
||||
<div style={{ marginTop: "auto", paddingTop: "1.5rem", display: "grid", gridTemplateColumns: "1fr 1fr", gap: "0.75rem" }}>
|
||||
{/* blob에 Content-Disposition이 박혀 있어 주소만 열면 내려받기가 된다.
|
||||
<a download>은 다른 출처에 안 먹으므로 이 속성에 기대지 않는다 */}
|
||||
{job.artifacts.thumbnail ? (
|
||||
<a href={job.artifacts.thumbnail} download className="btn-tonal-mint">정지 컷 JPG</a>
|
||||
<a href={job.artifacts.thumbnail} className="btn-tonal-mint">정지 컷 JPG</a>
|
||||
) : <span />}
|
||||
<a href={job.artifacts.video} download className="btn-cta"
|
||||
<a href={job.artifacts.video} className="btn-cta"
|
||||
style={{ padding: "0.75rem 1rem", fontSize: "var(--text-base)", borderRadius: "var(--radius-xl)", textDecoration: "none" }}>
|
||||
MP4 다운로드
|
||||
</a>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useRouter, useSearchParams } from "next/navigation";
|
||||
import StageStepper, { stageProgress } from "@/components/stage-stepper";
|
||||
import { GateBody, GateShell } from "@/components/gate-card";
|
||||
import { apiFetch } from "@/lib/api";
|
||||
import { GATE_META, PLAYREEL_STAGE_LABELS, usePlayreelJob } from "@/lib/playreel";
|
||||
import { GATE_META, PLAYREEL_STAGE_LABELS, usePlayreelJob, type PlayreelJob } from "@/lib/playreel";
|
||||
import { useAutoApprove } from "@/lib/prefs";
|
||||
import { isAutoApprovable } from "@/components/auto-approve";
|
||||
|
||||
@@ -70,6 +70,12 @@ export default function PlayreelJobPage({ params }: { params: Promise<{ id: stri
|
||||
edits.current = null;
|
||||
refresh();
|
||||
} catch (e) {
|
||||
// 실패 화면을 띄워둔 사이에 끝났을 수 있다. 그때는 에러 대신 결과를 보여준다
|
||||
const latest = await apiFetch<PlayreelJob>(`/api/playreel/jobs/${id}`).catch(() => null);
|
||||
if (latest?.status === "done") {
|
||||
refresh();
|
||||
return;
|
||||
}
|
||||
setActionError((e as Error).message);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
@@ -170,7 +176,9 @@ export default function PlayreelJobPage({ params }: { params: Promise<{ id: stri
|
||||
<p style={{ margin: 0, fontSize: "var(--text-sm)", color: "var(--color-text-gray-400)" }}>출처 · <a href={job.source.url} target="_blank" rel="noreferrer" style={{ color: "var(--color-mint)" }}>공연 상품페이지 열기 →</a></p>
|
||||
<div className="result-actions">
|
||||
<Link href="/" className="btn-tonal-mint" style={{ textDecoration: "none", textAlign: "center" }}>새 버전 만들기</Link>
|
||||
<a href={job.artifacts.video} download className="btn-cta" style={{ padding: "0.75rem 1rem", fontSize: "var(--text-base)", borderRadius: "var(--radius-xl)", textDecoration: "none" }}>MP4 다운로드</a>
|
||||
{/* blob에 Content-Disposition이 박혀 있어 주소만 열면 내려받기가 된다.
|
||||
<a download>은 다른 출처에 안 먹으므로 이 속성에 기대지 않는다 */}
|
||||
<a href={job.artifacts.video} className="btn-cta" style={{ padding: "0.75rem 1rem", fontSize: "var(--text-base)", borderRadius: "var(--radius-xl)", textDecoration: "none" }}>MP4 다운로드</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user