+ {/* Name */}
+
+
+ setName(e.target.value)}
+ placeholder={t('settings.cron.jobs.formNamePlaceholder')}
+ disabled={saving}
+ className="w-full rounded-md border border-stone-300 dark:border-neutral-700 bg-white dark:bg-neutral-800 px-3 py-2 text-sm text-stone-900 dark:text-neutral-100 placeholder:text-stone-400 dark:placeholder:text-neutral-500 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 disabled:opacity-50"
+ />
+
+
+ {/* Job type */}
+
+
+ {/* Schedule type */}
+
+
+ {/* Cron schedule fields */}
+ {scheduleKind === 'cron' && (
+
+ {/* Preset dropdown */}
+
+
+
+
+
+ {/* Custom expression — shown when no preset selected or user typed */}
+ {(!SCHEDULE_PRESET_VALUES.has(cronPreset) || cronCustom) && (
+
+
+ {
+ const val = e.target.value;
+ setCronCustom(val);
+ // Reset preset to custom sentinel
+ if (!SCHEDULE_PRESET_VALUES.has(val.trim())) {
+ setCronPreset('');
+ } else {
+ setCronPreset(val.trim());
+ }
+ }}
+ placeholder={t('settings.cron.jobs.formCronCustomPlaceholder')}
+ disabled={saving}
+ className="w-full rounded-md border border-stone-300 dark:border-neutral-700 bg-white dark:bg-neutral-800 px-3 py-2 text-sm font-mono text-stone-900 dark:text-neutral-100 placeholder:text-stone-400 dark:placeholder:text-neutral-500 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 disabled:opacity-50"
+ />
+
+ )}
+
+ {/* Live preview */}
+ {cronExpr && (
+
+ {t('settings.cron.jobs.formCronPreview').replace(
+ '{preview}',
+ cronToHuman(cronExpr)
+ )}
+
+ )}
+
+ )}
+
+ {/* At */}
+ {scheduleKind === 'at' && (
+
+
+ setAtValue(e.target.value)}
+ disabled={saving}
+ className="w-full rounded-md border border-stone-300 dark:border-neutral-700 bg-white dark:bg-neutral-800 px-3 py-2 text-sm text-stone-900 dark:text-neutral-100 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 disabled:opacity-50"
+ />
+
+ )}
+
+ {/* Every */}
+ {scheduleKind === 'every' && (
+
+
+ setEveryMs(e.target.value)}
+ disabled={saving}
+ placeholder={t('settings.cron.jobs.formEveryPlaceholder')}
+ className="w-full rounded-md border border-stone-300 dark:border-neutral-700 bg-white dark:bg-neutral-800 px-3 py-2 text-sm text-stone-900 dark:text-neutral-100 placeholder:text-stone-400 dark:placeholder:text-neutral-500 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 disabled:opacity-50"
+ />
+
+ )}
+
+ {/* Prompt (agent only) */}
+ {jobType === 'agent' && (
+
+
+
+ )}
+
+ {/* Command (shell only) */}
+ {jobType === 'shell' && (
+
+
+ setCommand(e.target.value)}
+ placeholder={t('settings.cron.jobs.formCommandPlaceholder')}
+ disabled={saving}
+ className="w-full rounded-md border border-stone-300 dark:border-neutral-700 bg-white dark:bg-neutral-800 px-3 py-2 text-sm font-mono text-stone-900 dark:text-neutral-100 placeholder:text-stone-400 dark:placeholder:text-neutral-500 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 disabled:opacity-50"
+ />
+
+ )}
+
+ {/* Session target (agent only) */}
+ {jobType === 'agent' && (
+
+
+
+
+ )}
+
+ {/* Delivery mode (agent only) */}
+ {jobType === 'agent' && (
+
+
+
+
+ )}
+
+ {/* Delete after run */}
+
+
+ {/* Error */}
+ {error && (
+
+ {error}
+
+ )}
+