some fixes
This commit is contained in:
@@ -44,6 +44,8 @@ export interface Data {
|
|||||||
runByAPI?: boolean;
|
runByAPI?: boolean;
|
||||||
log: string;
|
log: string;
|
||||||
runId: string;
|
runId: string;
|
||||||
|
robotId: string;
|
||||||
|
robotMetaId: string;
|
||||||
interpreterSettings: RunSettings;
|
interpreterSettings: RunSettings;
|
||||||
serializableOutput: any;
|
serializableOutput: any;
|
||||||
binaryOutput: any;
|
binaryOutput: any;
|
||||||
@@ -63,8 +65,6 @@ export const RunsTable = (
|
|||||||
const [rows, setRows] = useState<Data[]>([]);
|
const [rows, setRows] = useState<Data[]>([]);
|
||||||
const [searchTerm, setSearchTerm] = useState('');
|
const [searchTerm, setSearchTerm] = useState('');
|
||||||
|
|
||||||
console.log(`rows runs: ${JSON.stringify(rows)}`);
|
|
||||||
|
|
||||||
const { notify, rerenderRuns, setRerenderRuns } = useGlobalInfoStore();
|
const { notify, rerenderRuns, setRerenderRuns } = useGlobalInfoStore();
|
||||||
|
|
||||||
const handleChangePage = (event: unknown, newPage: number) => {
|
const handleChangePage = (event: unknown, newPage: number) => {
|
||||||
@@ -115,12 +115,12 @@ export const RunsTable = (
|
|||||||
row.name.toLowerCase().includes(searchTerm.toLowerCase())
|
row.name.toLowerCase().includes(searchTerm.toLowerCase())
|
||||||
);
|
);
|
||||||
|
|
||||||
// Group filtered runs by recording name
|
// Group filtered rows by robot meta id
|
||||||
const groupedRows = filteredRows.reduce((acc, row) => {
|
const groupedRows = filteredRows.reduce((acc, row) => {
|
||||||
if (!acc[row.name]) {
|
if (!acc[row.robotMetaId]) {
|
||||||
acc[row.name] = [];
|
acc[row.robotMetaId] = [];
|
||||||
}
|
}
|
||||||
acc[row.name].push(row);
|
acc[row.robotMetaId].push(row);
|
||||||
return acc;
|
return acc;
|
||||||
}, {} as Record<string, Data[]>);
|
}, {} as Record<string, Data[]>);
|
||||||
|
|
||||||
@@ -142,10 +142,10 @@ export const RunsTable = (
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
<TableContainer component={Paper} sx={{ width: '100%', overflow: 'hidden' }}>
|
<TableContainer component={Paper} sx={{ width: '100%', overflow: 'hidden' }}>
|
||||||
{Object.entries(groupedRows).map(([name, group]) => (
|
{Object.entries(groupedRows).map(([id, data]) => (
|
||||||
<Accordion key={name}>
|
<Accordion key={id}>
|
||||||
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
||||||
<Typography variant="h6">{name}</Typography>
|
<Typography variant="h6">{data[data.length - 1].name}</Typography>
|
||||||
</AccordionSummary>
|
</AccordionSummary>
|
||||||
<AccordionDetails>
|
<AccordionDetails>
|
||||||
<Table stickyHeader aria-label="sticky table">
|
<Table stickyHeader aria-label="sticky table">
|
||||||
@@ -164,17 +164,19 @@ export const RunsTable = (
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{group.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row) => (
|
{data
|
||||||
<CollapsibleRow
|
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
||||||
row={row}
|
.map((row) => (
|
||||||
handleDelete={handleDelete}
|
<CollapsibleRow
|
||||||
key={`row-${row.id}`}
|
row={row}
|
||||||
isOpen={runId === row.runId && runningRecordingName === row.name}
|
handleDelete={handleDelete}
|
||||||
currentLog={currentInterpretationLog}
|
key={`row-${row.id}`}
|
||||||
abortRunHandler={abortRunHandler}
|
isOpen={runId === row.runId && runningRecordingName === row.name}
|
||||||
runningRecordingName={runningRecordingName}
|
currentLog={currentInterpretationLog}
|
||||||
/>
|
abortRunHandler={abortRunHandler}
|
||||||
))}
|
runningRecordingName={runningRecordingName}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
</AccordionDetails>
|
</AccordionDetails>
|
||||||
@@ -192,4 +194,4 @@ export const RunsTable = (
|
|||||||
/>
|
/>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user