69 lines
2.5 KiB
TypeScript
69 lines
2.5 KiB
TypeScript
import { HelpText } from './HelpText';
|
|
import { EnvOverrideWarning, FieldLabel, FieldInput } from './formUtils';
|
|
import type { SectionFormProps } from './types';
|
|
|
|
/**
|
|
* Execution — concurrency, max_movements, and job retry settings.
|
|
*
|
|
* Step 3 carve-out from the old "Workspace" form. The path/storage half
|
|
* of Workspace lives in PathsStorageForm. Field paths are unchanged so
|
|
* the underlying config keys keep working without a migration.
|
|
*/
|
|
export function ExecutionForm({ config, onChange, overriddenByEnv }: SectionFormProps) {
|
|
return (
|
|
<div className="space-y-5">
|
|
<h2 className="text-base font-semibold text-slate-800">Execution</h2>
|
|
<HelpText>同時実行数、1 ジョブあたりの movement 上限、ジョブ失敗時のリトライ設定。</HelpText>
|
|
|
|
<div>
|
|
<FieldLabel>Concurrency</FieldLabel>
|
|
<FieldInput
|
|
type="number"
|
|
value={config.concurrency ?? ''}
|
|
onChange={v => onChange('concurrency', v ? Number(v) : undefined)}
|
|
disabled={!!overriddenByEnv['concurrency']}
|
|
disabledReason="CONCURRENCY 環境変数で上書き中"
|
|
/>
|
|
{overriddenByEnv['concurrency'] && <EnvOverrideWarning />}
|
|
<HelpText>同時実行可能なジョブ数</HelpText>
|
|
</div>
|
|
|
|
<div>
|
|
<FieldLabel>Max Movements</FieldLabel>
|
|
<FieldInput
|
|
type="number"
|
|
value={config.maxMovements ?? ''}
|
|
onChange={v => onChange('maxMovements', v ? Number(v) : undefined)}
|
|
/>
|
|
<HelpText>1ジョブあたりの最大 movement 数</HelpText>
|
|
</div>
|
|
|
|
<h3 className="text-sm font-medium text-slate-600 mt-4 pt-3 border-t border-slate-200">Retry</h3>
|
|
|
|
<div>
|
|
<FieldLabel>Max Attempts</FieldLabel>
|
|
<FieldInput
|
|
type="number"
|
|
value={config.retry?.maxAttempts ?? 3}
|
|
onChange={v => onChange('retry.maxAttempts', Number(v))}
|
|
/>
|
|
<HelpText>ジョブ失敗時の最大リトライ回数。デフォルト: 3</HelpText>
|
|
</div>
|
|
|
|
<div>
|
|
<FieldLabel>Backoff Seconds</FieldLabel>
|
|
<FieldInput
|
|
value={(config.retry?.backoffSeconds ?? [60, 300, 900]).join(', ')}
|
|
onChange={v =>
|
|
onChange(
|
|
'retry.backoffSeconds',
|
|
v.split(',').map((s: string) => Number(s.trim())).filter((n: number) => !isNaN(n)),
|
|
)
|
|
}
|
|
/>
|
|
<HelpText>リトライ間隔(秒)。カンマ区切り。デフォルト: 60, 300, 900</HelpText>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|