Can configure network NAT settings from UI

This commit is contained in:
2024-01-09 21:57:18 +01:00
parent 71e22bc328
commit f82925dbcb
11 changed files with 446 additions and 11 deletions

View File

@ -0,0 +1,40 @@
import {
RadioGroup,
FormControlLabel,
Radio,
FormControl,
FormLabel,
} from "@mui/material";
interface RadioGroupOption {
label: string;
value: string;
}
export function RadioGroupInput(p: {
editable: boolean;
label?: string;
options: RadioGroupOption[];
value: string;
onValueChange: (v: string) => void;
}): React.ReactElement {
return (
<FormControl>
{p.label && <FormLabel>{p.label}</FormLabel>}
<RadioGroup
row
value={p.value}
onChange={(_ev, v) => p.onValueChange?.(v)}
>
{p.options.map((o) => (
<FormControlLabel
disabled={!p.editable}
value={o.value}
control={<Radio />}
label={o.label}
/>
))}
</RadioGroup>
</FormControl>
);
}