frontend: compact triage list in the Rugnux live tab
RugnuxTriage (self-contained, takes the status' triage array): conditions that fired one per line (red, then orange) with the report's words, the fine ones in packed green columns, the unmeasured ones named in one grey line; the report's warnings and codes on hover. Mounted under the probe alert in RugnuxPage; client regenerated from the API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK
This commit is contained in:
1 parent
dec5416a99
commit
e1226fc90e
5 files changed
+115
-2
No files matched your search
@@ -1,4 +1,4 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export { deleteConfigRugnuxModel, getConfigAzimInt, getConfigBraggIntegration, getConfigDarkMask, getConfigDetector, getConfigFileWriter, getConfigImageFormat, getConfigIndexing, getConfigInstrument, getConfigMask, getConfigMaskTiff, getConfigRoi, getConfigRugnux, getConfigSelectDetector, getConfigSpotFinding, getConfigUserMask, getConfigUserMaskTiff, getConfigZeromqMetadata, getConfigZeromqPreview, getDetectorStatus, getFpgaStatus, getImageBufferImageCbor, getImageBufferImageJpeg, getImageBufferImageTiff, getImageBufferStartCbor, getImageBufferStatus, getImagePusherStatus, getLiveEvents, getPreviewPedestalTiff, getPreviewPlot, getPreviewPlotBin, getResultScan, getRugnuxMapCcp4, getRugnuxModelCif, getRugnuxStatus, getStatistics, getStatisticsCalibration, getStatisticsDataCollection, getStatus, getVersion, getXfelEventCode, getXfelPulseId, type Options, postCancel, postConfigImageFormatConversion, postConfigImageFormatRaw, postDeactivate, postImageBufferClear, postInitialize, postPedestal, postStart, postTrigger, postWaitTillDone, postWaitUntilRunning, putConfigAzimInt, putConfigBraggIntegration, putConfigDarkMask, putConfigDetector, putConfigFileWriter, putConfigImageFormat, putConfigIndexing, putConfigInstrument, putConfigInternalGeneratorImage, putConfigInternalGeneratorImageTiff, putConfigRoi, putConfigRugnux, putConfigRugnuxModel, putConfigSelectDetector, putConfigSpotFinding, putConfigUserMask, putConfigUserMaskTiff, putConfigZeromqMetadata, putConfigZeromqPreview } from './sdk.gen';
|
||||
export { type azim_int_settings, azint_unit, type background, type binning, type bragg_integration_settings, type broker_status, type calibration_statistics, type ClientOptions, color_scale, type crystal_lattice, type dark_mask_settings, type dataset_settings, type dataset_settingsWritable, type deleteConfigRugnuxModelData, type deleteConfigRugnuxModelError, type deleteConfigRugnuxModelErrors, type deleteConfigRugnuxModelResponses, type detector, type detector_list, type detector_list_element, type detector_module, detector_module_direction, type detector_module_placement, detector_power_state, type detector_selection, type detector_settings, detector_state, type detector_status, detector_timing, detector_type, type error_message, type experimental_coord, file_writer_format, type file_writer_settings, type fill_value, type fpga_status, geom_refinement_algorithm, type getConfigAzimIntData, type getConfigAzimIntResponse, type getConfigAzimIntResponses, type getConfigBraggIntegrationData, type getConfigBraggIntegrationResponse, type getConfigBraggIntegrationResponses, type getConfigDarkMaskData, type getConfigDarkMaskResponse, type getConfigDarkMaskResponses, type getConfigDetectorData, type getConfigDetectorResponse, type getConfigDetectorResponses, type getConfigFileWriterData, type getConfigFileWriterResponse, type getConfigFileWriterResponses, type getConfigImageFormatData, type getConfigImageFormatResponse, type getConfigImageFormatResponses, type getConfigIndexingData, type getConfigIndexingResponse, type getConfigIndexingResponses, type getConfigInstrumentData, type getConfigInstrumentResponse, type getConfigInstrumentResponses, type getConfigMaskData, type getConfigMaskResponse, type getConfigMaskResponses, type getConfigMaskTiffData, type getConfigMaskTiffResponse, type getConfigMaskTiffResponses, type getConfigRoiData, type getConfigRoiResponse, type getConfigRoiResponses, type getConfigRugnuxData, type getConfigRugnuxResponse, type getConfigRugnuxResponses, type getConfigSelectDetectorData, type getConfigSelectDetectorResponse, type getConfigSelectDetectorResponses, type getConfigSpotFindingData, type getConfigSpotFindingResponse, type getConfigSpotFindingResponses, type getConfigUserMaskData, type getConfigUserMaskResponse, type getConfigUserMaskResponses, type getConfigUserMaskTiffData, type getConfigUserMaskTiffResponse, type getConfigUserMaskTiffResponses, type getConfigZeromqMetadataData, type getConfigZeromqMetadataResponse, type getConfigZeromqMetadataResponses, type getConfigZeromqPreviewData, type getConfigZeromqPreviewResponse, type getConfigZeromqPreviewResponses, type getDetectorStatusData, type getDetectorStatusError, type getDetectorStatusErrors, type getDetectorStatusResponse, type getDetectorStatusResponses, type getFpgaStatusData, type getFpgaStatusResponse, type getFpgaStatusResponses, type getImageBufferImageCborData, type getImageBufferImageCborError, type getImageBufferImageCborErrors, type getImageBufferImageCborResponse, type getImageBufferImageCborResponses, type getImageBufferImageJpegData, type getImageBufferImageJpegError, type getImageBufferImageJpegErrors, type getImageBufferImageJpegResponse, type getImageBufferImageJpegResponses, type getImageBufferImageTiffData, type getImageBufferImageTiffError, type getImageBufferImageTiffErrors, type getImageBufferImageTiffResponse, type getImageBufferImageTiffResponses, type getImageBufferStartCborData, type getImageBufferStartCborError, type getImageBufferStartCborErrors, type getImageBufferStartCborResponse, type getImageBufferStartCborResponses, type getImageBufferStatusData, type getImageBufferStatusError, type getImageBufferStatusErrors, type getImageBufferStatusResponse, type getImageBufferStatusResponses, type getImagePusherStatusData, type getImagePusherStatusError, type getImagePusherStatusErrors, type getImagePusherStatusResponse, type getImagePusherStatusResponses, type getLiveEventsData, type getLiveEventsError, type getLiveEventsErrors, type getLiveEventsResponse, type getLiveEventsResponses, type getPreviewPedestalTiffData, type getPreviewPedestalTiffErrors, type getPreviewPedestalTiffResponse, type getPreviewPedestalTiffResponses, type getPreviewPlotBinData, type getPreviewPlotBinError, type getPreviewPlotBinErrors, type getPreviewPlotBinResponse, type getPreviewPlotBinResponses, type getPreviewPlotData, type getPreviewPlotError, type getPreviewPlotErrors, type getPreviewPlotResponse, type getPreviewPlotResponses, type getResultScanData, type getResultScanError, type getResultScanErrors, type getResultScanResponse, type getResultScanResponses, type getRugnuxMapCcp4Data, type getRugnuxMapCcp4Error, type getRugnuxMapCcp4Errors, type getRugnuxMapCcp4Response, type getRugnuxMapCcp4Responses, type getRugnuxModelCifData, type getRugnuxModelCifError, type getRugnuxModelCifErrors, type getRugnuxModelCifResponse, type getRugnuxModelCifResponses, type getRugnuxStatusData, type getRugnuxStatusError, type getRugnuxStatusErrorsLine truncated
|
||||
export { type azim_int_settings, azint_unit, type background, type binning, type bragg_integration_settings, type broker_status, type calibration_statistics, type ClientOptions, color_scale, type crystal_lattice, type dark_mask_settings, type dataset_settings, type dataset_settingsWritable, type deleteConfigRugnuxModelData, type deleteConfigRugnuxModelError, type deleteConfigRugnuxModelErrors, type deleteConfigRugnuxModelResponses, type detector, type detector_list, type detector_list_element, type detector_module, detector_module_direction, type detector_module_placement, detector_power_state, type detector_selection, type detector_settings, detector_state, type detector_status, detector_timing, detector_type, type error_message, type experimental_coord, file_writer_format, type file_writer_settings, type fill_value, type fpga_status, geom_refinement_algorithm, type getConfigAzimIntData, type getConfigAzimIntResponse, type getConfigAzimIntResponses, type getConfigBraggIntegrationData, type getConfigBraggIntegrationResponse, type getConfigBraggIntegrationResponses, type getConfigDarkMaskData, type getConfigDarkMaskResponse, type getConfigDarkMaskResponses, type getConfigDetectorData, type getConfigDetectorResponse, type getConfigDetectorResponses, type getConfigFileWriterData, type getConfigFileWriterResponse, type getConfigFileWriterResponses, type getConfigImageFormatData, type getConfigImageFormatResponse, type getConfigImageFormatResponses, type getConfigIndexingData, type getConfigIndexingResponse, type getConfigIndexingResponses, type getConfigInstrumentData, type getConfigInstrumentResponse, type getConfigInstrumentResponses, type getConfigMaskData, type getConfigMaskResponse, type getConfigMaskResponses, type getConfigMaskTiffData, type getConfigMaskTiffResponse, type getConfigMaskTiffResponses, type getConfigRoiData, type getConfigRoiResponse, type getConfigRoiResponses, type getConfigRugnuxData, type getConfigRugnuxResponse, type getConfigRugnuxResponses, type getConfigSelectDetectorData, type getConfigSelectDetectorResponse, type getConfigSelectDetectorResponses, type getConfigSpotFindingData, type getConfigSpotFindingResponse, type getConfigSpotFindingResponses, type getConfigUserMaskData, type getConfigUserMaskResponse, type getConfigUserMaskResponses, type getConfigUserMaskTiffData, type getConfigUserMaskTiffResponse, type getConfigUserMaskTiffResponses, type getConfigZeromqMetadataData, type getConfigZeromqMetadataResponse, type getConfigZeromqMetadataResponses, type getConfigZeromqPreviewData, type getConfigZeromqPreviewResponse, type getConfigZeromqPreviewResponses, type getDetectorStatusData, type getDetectorStatusError, type getDetectorStatusErrors, type getDetectorStatusResponse, type getDetectorStatusResponses, type getFpgaStatusData, type getFpgaStatusResponse, type getFpgaStatusResponses, type getImageBufferImageCborData, type getImageBufferImageCborError, type getImageBufferImageCborErrors, type getImageBufferImageCborResponse, type getImageBufferImageCborResponses, type getImageBufferImageJpegData, type getImageBufferImageJpegError, type getImageBufferImageJpegErrors, type getImageBufferImageJpegResponse, type getImageBufferImageJpegResponses, type getImageBufferImageTiffData, type getImageBufferImageTiffError, type getImageBufferImageTiffErrors, type getImageBufferImageTiffResponse, type getImageBufferImageTiffResponses, type getImageBufferStartCborData, type getImageBufferStartCborError, type getImageBufferStartCborErrors, type getImageBufferStartCborResponse, type getImageBufferStartCborResponses, type getImageBufferStatusData, type getImageBufferStatusError, type getImageBufferStatusErrors, type getImageBufferStatusResponse, type getImageBufferStatusResponses, type getImagePusherStatusData, type getImagePusherStatusError, type getImagePusherStatusErrors, type getImagePusherStatusResponse, type getImagePusherStatusResponses, type getLiveEventsData, type getLiveEventsError, type getLiveEventsErrors, type getLiveEventsResponse, type getLiveEventsResponses, type getPreviewPedestalTiffData, type getPreviewPedestalTiffErrors, type getPreviewPedestalTiffResponse, type getPreviewPedestalTiffResponses, type getPreviewPlotBinData, type getPreviewPlotBinError, type getPreviewPlotBinErrors, type getPreviewPlotBinResponse, type getPreviewPlotBinResponses, type getPreviewPlotData, type getPreviewPlotError, type getPreviewPlotErrors, type getPreviewPlotResponse, type getPreviewPlotResponses, type getResultScanData, type getResultScanError, type getResultScanErrors, type getResultScanResponse, type getResultScanResponses, type getRugnuxMapCcp4Data, type getRugnuxMapCcp4Error, type getRugnuxMapCcp4Errors, type getRugnuxMapCcp4Response, type getRugnuxMapCcp4Responses, type getRugnuxModelCifData, type getRugnuxModelCifError, type getRugnuxModelCifErrors, type getRugnuxModelCifResponse, type getRugnuxModelCifResponses, type getRugnuxStatusData, type getRugnuxStatusError, type getRugnuxStatusErrorsLine truncated
|
||||
@@ -2073,6 +2073,33 @@ export type rugnux_summary_row = {
|
||||
value: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* A line of the pathology checklist of `_report.txt` (its SUMMARY), in the report's words.
|
||||
* `ok`: looked for and not found; `attention`: its warning fired (its codes are in the report's
|
||||
* PATHOLOGY_FLAGS); `serious`: a pathology that leaves no result to use - no lattice, or a merge without
|
||||
* signal (the report's verdict FAILED or UNUSABLE); `not_measured`: it could not be looked for on this run.
|
||||
*
|
||||
*/
|
||||
export type rugnux_triage_item = {
|
||||
/**
|
||||
* Name of the condition, e.g. "Twinning" - the summary row's label
|
||||
*/
|
||||
label: string;
|
||||
/**
|
||||
* The PATHOLOGY_FLAGS codes the line stands for, e.g. TWINNING
|
||||
*/
|
||||
codes: Array<string>;
|
||||
severity: 'ok' | 'attention' | 'serious' | 'not_measured';
|
||||
/**
|
||||
* The summary row's own words; empty where it has none
|
||||
*/
|
||||
text: string;
|
||||
/**
|
||||
* The report's warnings that fired for it, one per line; absent where none fired
|
||||
*/
|
||||
detail?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* What the run made of the model it was given, as the report's MODEL VALIDATION section states it. The
|
||||
* R-factors here are those of the placed model with its own coordinates and B factors; what refinement made
|
||||
@@ -2380,6 +2407,12 @@ export type rugnux_live_status = {
|
||||
verdict_text: string;
|
||||
summary: Array<rugnux_summary_row>;
|
||||
warnings: Array<string>;
|
||||
/**
|
||||
* The pathology checklist of the report, in its order. Rotation: once the run is over; serial: at each
|
||||
* provisional merge and at the end. Absent until there is one.
|
||||
*
|
||||
*/
|
||||
triage?: Array<rugnux_triage_item>;
|
||||
};
|
||||
|
||||
export type zeromq_metadata_settings = {
|
||||
|
||||
@@ -877,6 +877,26 @@ export const zRugnuxSummaryRow = z.object({
|
||||
value: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* A line of the pathology checklist of `_report.txt` (its SUMMARY), in the report's words.
|
||||
* `ok`: looked for and not found; `attention`: its warning fired (its codes are in the report's
|
||||
* PATHOLOGY_FLAGS); `serious`: a pathology that leaves no result to use - no lattice, or a merge without
|
||||
* signal (the report's verdict FAILED or UNUSABLE); `not_measured`: it could not be looked for on this run.
|
||||
*
|
||||
*/
|
||||
export const zRugnuxTriageItem = z.object({
|
||||
label: z.string(),
|
||||
codes: z.array(z.string()),
|
||||
severity: z.enum([
|
||||
'ok',
|
||||
'attention',
|
||||
'serious',
|
||||
'not_measured'
|
||||
]),
|
||||
text: z.string(),
|
||||
detail: z.string().optional()
|
||||
});
|
||||
|
||||
/**
|
||||
* A blob of positive mFo-DFc density the refined model leaves unexplained, with its likely reading: a rule on
|
||||
* what is measured, to point a person at the density - not an identification.
|
||||
@@ -1020,7 +1040,8 @@ export const zRugnuxLiveStatus = z.object({
|
||||
verdict: z.string(),
|
||||
verdict_text: z.string(),
|
||||
summary: z.array(zRugnuxSummaryRow),
|
||||
warnings: z.array(z.string())
|
||||
warnings: z.array(z.string()),
|
||||
triage: z.array(zRugnuxTriageItem).optional()
|
||||
});
|
||||
|
||||
export const zZeromqMetadataSettings = z.object({
|
||||
|
||||
@@ -5,6 +5,7 @@ import {getConfigRugnuxOptions, getRugnuxStatusOptions} from "../client/@tanstac
|
||||
import {rugnux_live_status} from "../client";
|
||||
import {useTokenRequired} from "../auth";
|
||||
import EmptyState from "./EmptyState";
|
||||
import RugnuxTriage from "./RugnuxTriage";
|
||||
import RugnuxTimeline from "./RugnuxTimeline";
|
||||
import RugnuxSettings from "./RugnuxSettings";
|
||||
import RugnuxHero from "./RugnuxHero";
|
||||
@@ -168,6 +169,7 @@ function RugnuxPage({measuring}: { measuring: boolean }) {
|
||||
: <RugnuxHero s={s} modelLoaded={settings?.model_loaded === true}/>}
|
||||
<CutAlert s={s}/>
|
||||
<ProbeAlert s={s} large/>
|
||||
{s.triage && s.triage.length > 0 && <Section title="Triage"><RugnuxTriage items={s.triage}/></Section>}
|
||||
<Section title="Timeline">
|
||||
<RugnuxTimeline s={s} deadline_s={settings?.deadline_s ?? 0}/>
|
||||
</Section>
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import {Box, Tooltip, Typography} from "@mui/material";
|
||||
import CheckCircleIcon from "@mui/icons-material/CheckCircle";
|
||||
import WarningIcon from "@mui/icons-material/Warning";
|
||||
import ErrorIcon from "@mui/icons-material/Error";
|
||||
import {rugnux_triage_item} from "../client";
|
||||
|
||||
// The pathology checklist of the rugnux report (the SUMMARY of _report.txt), one line per condition:
|
||||
// green - looked for and not found, orange - its warning fired, red - nothing usable came out.
|
||||
// What this run could not look for is named in one grey line at the end.
|
||||
|
||||
const ORDER: Record<string, number> = {serious: 0, attention: 1};
|
||||
|
||||
const ICON: Record<string, React.ReactNode> = {
|
||||
serious: <ErrorIcon color="error" sx={{fontSize: 18}}/>,
|
||||
attention: <WarningIcon color="warning" sx={{fontSize: 18}}/>,
|
||||
ok: <CheckCircleIcon color="success" sx={{fontSize: 18}}/>,
|
||||
};
|
||||
|
||||
function TriageLine({item}: { item: rugnux_triage_item }) {
|
||||
const tip = (
|
||||
<Box sx={{whiteSpace: "pre-line"}}>
|
||||
<b>{item.label}</b>{item.text && `: ${item.text}`}
|
||||
{item.detail && <Box sx={{mt: 1}}>{item.detail}</Box>}
|
||||
<Box sx={{mt: 1, opacity: 0.7}}>{item.codes.join(" ")}</Box>
|
||||
</Box>
|
||||
);
|
||||
return (
|
||||
<Tooltip title={tip} arrow placement="bottom-start">
|
||||
<Box sx={{display: "flex", alignItems: "center", gap: 0.75, minWidth: 0}}>
|
||||
{ICON[item.severity]}
|
||||
<Typography variant="body2" sx={{fontWeight: 600, whiteSpace: "nowrap"}}>{item.label}</Typography>
|
||||
<Typography variant="body2" color="text.secondary" noWrap sx={{minWidth: 0}}>{item.text}</Typography>
|
||||
</Box>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
// Problems one to a line, so their words have the width; the fine ones packed in columns.
|
||||
export default function RugnuxTriage({items}: { items: rugnux_triage_item[] }) {
|
||||
const problems = items.filter(i => i.severity === "serious" || i.severity === "attention")
|
||||
.sort((a, b) => ORDER[a.severity] - ORDER[b.severity]);
|
||||
const fine = items.filter(i => i.severity === "ok");
|
||||
const notMeasured = items.filter(i => i.severity === "not_measured");
|
||||
return (
|
||||
<Box>
|
||||
{problems.map(item => <TriageLine key={item.label} item={item}/>)}
|
||||
<Box sx={{display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", columnGap: 3,
|
||||
rowGap: 0.25, mt: problems.length > 0 ? 0.5 : 0}}>
|
||||
{fine.map(item => <TriageLine key={item.label} item={item}/>)}
|
||||
</Box>
|
||||
{notMeasured.length > 0 &&
|
||||
<Typography variant="caption" color="text.disabled" sx={{display: "block", mt: 0.5}}>
|
||||
Not measured: {notMeasured.map(i => i.label).join(", ")}
|
||||
</Typography>}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user