mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
refactor(containers): migrate restart policy tab to react [EE-5213] (#10347)
This commit is contained in:
parent
3d19c46326
commit
2dfa4a7c45
9 changed files with 122 additions and 15 deletions
|
@ -0,0 +1,27 @@
|
|||
import { ButtonSelector } from '@@/form-components/ButtonSelector/ButtonSelector';
|
||||
import { FormControl } from '@@/form-components/FormControl';
|
||||
|
||||
import { RestartPolicy } from './types';
|
||||
|
||||
export function RestartPolicyTab({
|
||||
values,
|
||||
onChange,
|
||||
}: {
|
||||
values: RestartPolicy;
|
||||
onChange: (values: RestartPolicy) => void;
|
||||
}) {
|
||||
return (
|
||||
<FormControl label="Restart Policy">
|
||||
<ButtonSelector
|
||||
options={[
|
||||
{ label: 'Never', value: RestartPolicy.No },
|
||||
{ label: 'Always', value: RestartPolicy.Always },
|
||||
{ label: 'On failure', value: RestartPolicy.OnFailure },
|
||||
{ label: 'Unless stopped', value: RestartPolicy.UnlessStopped },
|
||||
]}
|
||||
value={values}
|
||||
onChange={onChange}
|
||||
/>
|
||||
</FormControl>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue