chore: lint
This commit is contained in:
@@ -200,107 +200,107 @@ export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handl
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
{rows.length === 0 ? (
|
{rows.length === 0 ? (
|
||||||
<Box display="flex" justifyContent="center" alignItems="center" height="50%">
|
<Box display="flex" justifyContent="center" alignItems="center" height="50%">
|
||||||
<CircularProgress />
|
<CircularProgress />
|
||||||
</Box>
|
</Box>
|
||||||
) : (
|
) : (
|
||||||
<TableContainer component={Paper} sx={{ width: '100%', overflow: 'hidden', marginTop: '15px' }}>
|
<TableContainer component={Paper} sx={{ width: '100%', overflow: 'hidden', marginTop: '15px' }}>
|
||||||
<Table stickyHeader aria-label="sticky table">
|
<Table stickyHeader aria-label="sticky table">
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
{columns.map((column) => (
|
{columns.map((column) => (
|
||||||
<TableCell
|
<TableCell
|
||||||
key={column.id}
|
key={column.id}
|
||||||
align={column.align}
|
align={column.align}
|
||||||
style={{ minWidth: column.minWidth }}
|
style={{ minWidth: column.minWidth }}
|
||||||
>
|
>
|
||||||
{column.label}
|
{column.label}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
))}
|
))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{filteredRows.length !== 0 ? filteredRows
|
{filteredRows.length !== 0 ? filteredRows
|
||||||
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
||||||
.map((row) => {
|
.map((row) => {
|
||||||
return (
|
return (
|
||||||
<TableRow hover role="checkbox" tabIndex={-1} key={row.id}>
|
<TableRow hover role="checkbox" tabIndex={-1} key={row.id}>
|
||||||
{columns.map((column) => {
|
{columns.map((column) => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const value: any = row[column.id];
|
const value: any = row[column.id];
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
return (
|
return (
|
||||||
<TableCell key={column.id} align={column.align}>
|
<TableCell key={column.id} align={column.align}>
|
||||||
{value}
|
{value}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
switch (column.id) {
|
switch (column.id) {
|
||||||
case 'interpret':
|
case 'interpret':
|
||||||
return (
|
return (
|
||||||
<TableCell key={column.id} align={column.align}>
|
<TableCell key={column.id} align={column.align}>
|
||||||
<InterpretButton handleInterpret={() => handleRunRecording(row.id, row.name, row.params || [])} />
|
<InterpretButton handleInterpret={() => handleRunRecording(row.id, row.name, row.params || [])} />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
);
|
);
|
||||||
case 'schedule':
|
case 'schedule':
|
||||||
return (
|
return (
|
||||||
<TableCell key={column.id} align={column.align}>
|
<TableCell key={column.id} align={column.align}>
|
||||||
<ScheduleButton handleSchedule={() => handleScheduleRecording(row.id, row.name, row.params || [])} />
|
<ScheduleButton handleSchedule={() => handleScheduleRecording(row.id, row.name, row.params || [])} />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
);
|
);
|
||||||
case 'integrate':
|
case 'integrate':
|
||||||
return (
|
return (
|
||||||
<TableCell key={column.id} align={column.align}>
|
<TableCell key={column.id} align={column.align}>
|
||||||
<IntegrateButton handleIntegrate={() => handleIntegrateRecording(row.id, row.name, row.params || [])} />
|
<IntegrateButton handleIntegrate={() => handleIntegrateRecording(row.id, row.name, row.params || [])} />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
);
|
);
|
||||||
case 'options':
|
case 'options':
|
||||||
return (
|
return (
|
||||||
<TableCell key={column.id} align={column.align}>
|
<TableCell key={column.id} align={column.align}>
|
||||||
<OptionsButton
|
<OptionsButton
|
||||||
handleEdit={() => handleEditRobot(row.id, row.name, row.params || [])}
|
handleEdit={() => handleEditRobot(row.id, row.name, row.params || [])}
|
||||||
handleDuplicate={() => {
|
handleDuplicate={() => {
|
||||||
handleDuplicateRobot(row.id, row.name, row.params || []);
|
handleDuplicateRobot(row.id, row.name, row.params || []);
|
||||||
}}
|
}}
|
||||||
handleDelete={() => {
|
handleDelete={() => {
|
||||||
|
|
||||||
checkRunsForRecording(row.id).then((result: boolean) => {
|
checkRunsForRecording(row.id).then((result: boolean) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
notify('warning', t('recordingtable.notifications.delete_warning'));
|
notify('warning', t('recordingtable.notifications.delete_warning'));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
deleteRecordingFromStorage(row.id).then((result: boolean) => {
|
deleteRecordingFromStorage(row.id).then((result: boolean) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
setRows([]);
|
setRows([]);
|
||||||
notify('success', t('recordingtable.notifications.delete_success'));
|
notify('success', t('recordingtable.notifications.delete_success'));
|
||||||
fetchRecordings();
|
fetchRecordings();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
);
|
);
|
||||||
case 'settings':
|
case 'settings':
|
||||||
return (
|
return (
|
||||||
<TableCell key={column.id} align={column.align}>
|
<TableCell key={column.id} align={column.align}>
|
||||||
<SettingsButton handleSettings={() => handleSettingsRecording(row.id, row.name, row.params || [])} />
|
<SettingsButton handleSettings={() => handleSettingsRecording(row.id, row.name, row.params || [])} />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})}
|
||||||
})}
|
</TableRow>
|
||||||
</TableRow>
|
);
|
||||||
);
|
})
|
||||||
})
|
: null}
|
||||||
: null}
|
</TableBody>
|
||||||
</TableBody>
|
</Table>
|
||||||
</Table>
|
</TableContainer>
|
||||||
</TableContainer>
|
)}
|
||||||
)}
|
|
||||||
<TablePagination
|
<TablePagination
|
||||||
rowsPerPageOptions={[10, 25, 50]}
|
rowsPerPageOptions={[10, 25, 50]}
|
||||||
component="div"
|
component="div"
|
||||||
|
|||||||
Reference in New Issue
Block a user