This commit is contained in:
2026-09-20 11:15:22 +01:00
parent 6e3319b21c
commit 59071f87ad
9 changed files with 125 additions and 184 deletions
@@ -17,6 +17,7 @@ export default function AddClientFormWgIpAddress({
form,
setForm,
host_id,
existing_full,
}: Props) {
const [grabbing, setGrabbing] = useState(false);
const [grab_error, setGrabError] = useState<string>();
@@ -52,23 +53,26 @@ export default function AddClientFormWgIpAddress({
}));
}}
defaultValue={form.wg_ip_address}
readOnly={Boolean(existing_full?.id)}
showLabel
/>
<Button
title="Grab the next available client IP from the host's WireGuard subnet"
variant="outlined"
color="primary"
size="small"
beforeIcon={<Wand2 size={16} />}
loading={grabbing}
onClick={(e) => {
e.preventDefault();
handleGrabNextIp();
}}
>
Grab Next Available IP
</Button>
{existing_full?.id ? null : (
<Button
title="Grab the next available client IP from the host's WireGuard subnet"
variant="outlined"
color="primary"
size="small"
beforeIcon={<Wand2 size={16} />}
loading={grabbing}
onClick={(e) => {
e.preventDefault();
handleGrabNextIp();
}}
>
Grab Next Available IP
</Button>
)}
</Row>
{grab_error ? (