mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-29 15:14:56 +02:00
more frontend for clients
This commit is contained in:
parent
204403da67
commit
3830ad65fc
3 changed files with 22 additions and 21 deletions
|
@ -77,11 +77,11 @@ export async function pickClientDefaults(
|
|||
|
||||
const parsedSite = sitesRequiredFields.safeParse(site);
|
||||
if (!parsedSite.success) {
|
||||
logger.error("Unable to pick client defaults because: " + fromError(parsedSite.error).toString());
|
||||
return next(
|
||||
createHttpError(
|
||||
HttpCode.BAD_REQUEST,
|
||||
"Unable to pick client defaults because: " +
|
||||
fromError(parsedSite.error).toString()
|
||||
"Site is not configured to accept client connectivity"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -110,10 +110,13 @@ export default function CreateClientForm({
|
|||
const res = await api.get<AxiosResponse<ListSitesResponse>>(
|
||||
`/org/${orgId}/sites/`
|
||||
);
|
||||
setSites(res.data.data.sites);
|
||||
const sites = res.data.data.sites.filter(
|
||||
(s) => s.type === "newt" && s.subnet
|
||||
);
|
||||
setSites(sites);
|
||||
|
||||
if (res.data.data.sites.length > 0) {
|
||||
form.setValue("siteId", res.data.data.sites[0].siteId);
|
||||
if (sites.length > 0) {
|
||||
form.setValue("siteId", sites[0].siteId);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -289,32 +292,30 @@ export default function CreateClientForm({
|
|||
</Popover>
|
||||
<FormDescription>
|
||||
The client will be have connectivity to this
|
||||
site.
|
||||
site. The site must be configured to accept
|
||||
client connections.
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
{olmCommand && (
|
||||
<div className="w-full">
|
||||
<div className="mb-2">
|
||||
<Collapsible
|
||||
open={isOpen}
|
||||
onOpenChange={setIsOpen}
|
||||
className="space-y-2"
|
||||
>
|
||||
<div className="mx-auto">
|
||||
<CopyTextBox
|
||||
text={olmCommand || ""}
|
||||
text={olmCommand}
|
||||
wrapText={false}
|
||||
/>
|
||||
</div>
|
||||
</Collapsible>
|
||||
</div>
|
||||
<span className="text-sm text-muted-foreground">
|
||||
You will only be able to see the configuration once.
|
||||
You will only be able to see the configuration
|
||||
once.
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="flex items-center space-x-2">
|
||||
<Checkbox
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue