Updates
This commit is contained in:
+18
-14
@@ -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 ? (
|
||||
|
||||
Reference in New Issue
Block a user