|
|
@@ -19,6 +19,22 @@ function statusLabel(value?: string | null): string {
|
|
|
return value ? labels[value] || "状态待确认" : "状态待确认";
|
|
|
}
|
|
|
|
|
|
+function formatBeijingTime(value?: string | null): string {
|
|
|
+ if (!value) return "未记录开始时间";
|
|
|
+ const iso = /z$|[+-]\d{2}:\d{2}$/i.test(value) ? value : `${value}Z`;
|
|
|
+ const date = new Date(iso);
|
|
|
+ if (Number.isNaN(date.getTime())) return "开始时间待确认";
|
|
|
+ return `北京时间 ${new Intl.DateTimeFormat("zh-CN", {
|
|
|
+ timeZone: "Asia/Shanghai",
|
|
|
+ year: "numeric",
|
|
|
+ month: "2-digit",
|
|
|
+ day: "2-digit",
|
|
|
+ hour: "2-digit",
|
|
|
+ minute: "2-digit",
|
|
|
+ hour12: false
|
|
|
+ }).format(date)}`;
|
|
|
+}
|
|
|
+
|
|
|
export function RunListPage() {
|
|
|
const [runs, setRuns] = useState<RunListItem[]>([]);
|
|
|
const [loading, setLoading] = useState(true);
|
|
|
@@ -53,13 +69,13 @@ export function RunListPage() {
|
|
|
{runs.map((run) => (
|
|
|
<Link className="run-row" href={`/runs/${encodeURIComponent(run.run_id)}`} key={run.run_id}>
|
|
|
<div>
|
|
|
- <strong>{run.demand_name || "未命名任务"}</strong>
|
|
|
- <span>{run.demand_desc || "暂无任务说明"}</span>
|
|
|
+ <strong>{run.demand_name || run.run_id}</strong>
|
|
|
+ <span>{run.demand_desc || `任务编号 ${run.run_id}`}</span>
|
|
|
</div>
|
|
|
<div className="run-row-meta">
|
|
|
<span className="chip">{platformLabel(run.platform)}</span>
|
|
|
<span className="chip blue">{statusLabel(run.status)}</span>
|
|
|
- <span>{run.started_at ? `开始时间 ${run.started_at}` : "未记录开始时间"}</span>
|
|
|
+ <span>{formatBeijingTime(run.started_at)}</span>
|
|
|
</div>
|
|
|
</Link>
|
|
|
))}
|