fix(scheduler): читать снимки JSONB и показывать недоступные результаты
This commit is contained in:
1 parent
63b2f75012
commit
92b7399ddb
8 files changed
+102
-9
No files matched your search
@@ -432,7 +432,11 @@ function SnapshotTables({ snap }: { snap: SchedulerRunSnapshot }) {
|
||||
function RunRowDetail({ r }: { r: SchedulerRunRowDto }) {
|
||||
const jobTitle = SCHEDULER_JOB_LABELS[r.jobKey] ?? r.jobKey
|
||||
const jobDesc = SCHEDULER_JOB_DESCRIPTIONS[r.jobKey] ?? "—"
|
||||
const snapshot = useMemo(() => parseSchedulerRunSnapshot(r.resultJson ?? null), [r.resultJson])
|
||||
const snapshot = useMemo(() => {
|
||||
const parsed = parseSchedulerRunSnapshot(r.resultJson)
|
||||
return parsed?.job === r.jobKey ? parsed : null
|
||||
}, [r.resultJson, r.jobKey])
|
||||
const hasSnapshot = r.resultJson != null && (typeof r.resultJson !== "string" || r.resultJson.trim() !== "")
|
||||
return (
|
||||
<div className="flex flex-col gap-4 text-sm">
|
||||
<dl className="grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-3">
|
||||
@@ -501,6 +505,12 @@ function RunRowDetail({ r }: { r: SchedulerRunRowDto }) {
|
||||
<p className="text-xs font-medium text-muted-foreground uppercase tracking-wide">Результаты измерений</p>
|
||||
{snapshot ? (
|
||||
<SnapshotTables snap={snapshot} />
|
||||
) : hasSnapshot ? (
|
||||
<Alert variant="warning">
|
||||
<AlertCircleIcon />
|
||||
<AlertTitle>Снимок недоступен</AlertTitle>
|
||||
<AlertDescription>Сохранённые результаты имеют неподдерживаемый формат или относятся к другой задаче.</AlertDescription>
|
||||
</Alert>
|
||||
) : (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Снимок отсутствует (запись до обновления бекенда или задача без детализации).
|
||||
|
||||
Reference in new issue
Block a user