
* WIP: add scheduler commands * refactor scheduler commands page * WIP on CRUD for ScheduledCommands * more refactoring, finish CRUD On scheduled pages * Add info text about Scheduler service * Finish recurring commands add/edit * add more texts * fix server status behavior on not-loaded-yet state; adjust texts; lint fixes * add link to the help pages in the commands palette * Move Commands Panel to ServerSchedulesPage * Rename Server Schedules to Server Actions * more texts, a bit changed visual of the actions page, lint fix * add docs * fix tests * Add UTC label to scheduled command create/edit
22 lines
534 B
TypeScript
22 lines
534 B
TypeScript
const transformCommandsToChoices = (commands: Record<string, any>) => {
|
|
return Object.entries(commands).map(([key, value]) => ({
|
|
id: key,
|
|
name: value.name,
|
|
description: value.description,
|
|
}));
|
|
};
|
|
|
|
const ScheduledCommandCreate = () => {
|
|
const commandChoices = transformCommandsToChoices(serverCommands);
|
|
|
|
return (
|
|
<SimpleForm>
|
|
<SelectInput
|
|
source="command"
|
|
choices={commandChoices}
|
|
optionText={choice => `${choice.name} - ${choice.description}`}
|
|
/>
|
|
</SimpleForm>
|
|
);
|
|
};
|