feat(wip): scheduler
This commit is contained in:
@@ -72,9 +72,10 @@ interface Data {
|
|||||||
interface RecordingsTableProps {
|
interface RecordingsTableProps {
|
||||||
handleEditRecording: (fileName: string) => void;
|
handleEditRecording: (fileName: string) => void;
|
||||||
handleRunRecording: (fileName: string, params: string[]) => void;
|
handleRunRecording: (fileName: string, params: string[]) => void;
|
||||||
|
handleScheduleRecording: (fileName: string, params: string[]) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const RecordingsTable = ({ handleEditRecording, handleRunRecording }: RecordingsTableProps) => {
|
export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handleScheduleRecording }: RecordingsTableProps) => {
|
||||||
const [page, setPage] = React.useState(0);
|
const [page, setPage] = React.useState(0);
|
||||||
const [rowsPerPage, setRowsPerPage] = React.useState(10);
|
const [rowsPerPage, setRowsPerPage] = React.useState(10);
|
||||||
const [rows, setRows] = React.useState<Data[]>([]);
|
const [rows, setRows] = React.useState<Data[]>([]);
|
||||||
@@ -171,7 +172,7 @@ export const RecordingsTable = ({ handleEditRecording, handleRunRecording }: Rec
|
|||||||
case 'schedule':
|
case 'schedule':
|
||||||
return (
|
return (
|
||||||
<TableCell key={column.id} align={column.align}>
|
<TableCell key={column.id} align={column.align}>
|
||||||
<ScheduleButton handleSchedule={() => {/* todo: schedule logic here */ }} />
|
<ScheduleButton handleSchedule={() => handleScheduleRecording(row.name, row.params || []) } />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
);
|
);
|
||||||
case 'delete':
|
case 'delete':
|
||||||
@@ -230,18 +231,20 @@ const InterpretButton = ({ handleInterpret }: InterpretButtonProps) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interface ScheduleButtonProps {
|
interface ScheduleButtonProps {
|
||||||
handleSchedule: () => void;
|
handleSchedule: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ScheduleButton = ({ handleSchedule }: ScheduleButtonProps) => {
|
const ScheduleButton = ({ handleSchedule }: ScheduleButtonProps) => {
|
||||||
return (
|
return (
|
||||||
<IconButton
|
<IconButton aria-label="add" size="small" onClick={() => {
|
||||||
aria-label="schedule"
|
handleSchedule();
|
||||||
size="small"
|
}}
|
||||||
onClick={handleSchedule}
|
|
||||||
sx={{ '&:hover': { color: '#1976d2', backgroundColor: 'transparent' } }}>
|
sx={{ '&:hover': { color: '#1976d2', backgroundColor: 'transparent' } }}>
|
||||||
<Assignment />
|
<PlayCircle />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
);
|
)
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user