(defaultCron: string)
| 71 | } |
| 72 | |
| 73 | function scheduleOptions(defaultCron: string): SelectOption[] { |
| 74 | const recommended = presetValueForCron(defaultCron); |
| 75 | const opts: SelectOption[] = SCHEDULE_PRESETS.map((p) => ({ |
| 76 | label: p.label, |
| 77 | // Encode the cron in the value; "Disabled" is the empty string, which |
| 78 | // would collide with a falsy check, so prefix-tag all preset values. |
| 79 | value: `cron:${p.cron}`, |
| 80 | recommended: p.cron === recommended, |
| 81 | })); |
| 82 | opts.push({ |
| 83 | label: "Custom cron…", |
| 84 | value: PRESET_CUSTOM, |
| 85 | recommended: recommended === PRESET_CUSTOM, |
| 86 | }); |
| 87 | return opts; |
| 88 | } |
| 89 | |
| 90 | export interface DreamerSetupResult { |
| 91 | model: string; |
no test coverage detected