update descriptions and add adress back

This commit is contained in:
miloschwartz
2025-12-05 12:09:02 -05:00
parent 89ee57cdf9
commit d3be1fbf4c
3 changed files with 126 additions and 177 deletions

View File

@@ -1645,8 +1645,9 @@
"siteConfiguration": "Configuration", "siteConfiguration": "Configuration",
"siteAcceptClientConnections": "Accept Client Connections", "siteAcceptClientConnections": "Accept Client Connections",
"siteAcceptClientConnectionsDescription": "Allow user devices and clients to access resources on this site. This can be changed later.", "siteAcceptClientConnectionsDescription": "Allow user devices and clients to access resources on this site. This can be changed later.",
"siteAddress": "Site Address", "siteAddress": "Site Address (Advanced)",
"siteAddressDescription": "The internal address of the site. Must fall within the organization's subnet.", "siteAddressDescription": "The internal address of the site. Must fall within the organization's subnet.",
"siteNameDescription": "The display name of the site that can be changed later.",
"autoLoginExternalIdp": "Auto Login with External IDP", "autoLoginExternalIdp": "Auto Login with External IDP",
"autoLoginExternalIdpDescription": "Immediately redirect the user to the external IDP for authentication.", "autoLoginExternalIdpDescription": "Immediately redirect the user to the external IDP for authentication.",
"selectIdp": "Select IDP", "selectIdp": "Select IDP",
@@ -2239,5 +2240,7 @@
"noData": "No Data", "noData": "No Data",
"machineClients": "Machine Clients", "machineClients": "Machine Clients",
"install": "Install", "install": "Install",
"run": "Run" "run": "Run",
"clientNameDescription": "The display name of the client that can be changed later.",
"clientAddress": "Client Address (Advanced)"
} }

View File

@@ -410,120 +410,68 @@ export default function Page() {
</SettingsSectionTitle> </SettingsSectionTitle>
</SettingsSectionHeader> </SettingsSectionHeader>
<SettingsSectionBody> <SettingsSectionBody>
<SettingsSectionForm> <Form {...form}>
<Form {...form}> <form
<form onKeyDown={(e) => {
onKeyDown={(e) => { if (e.key === "Enter") {
if (e.key === "Enter") { e.preventDefault(); // block default enter refresh
e.preventDefault(); // block default enter refresh }
} }}
}} className="space-y-4 grid gap-4 grid-cols-1 md:grid-cols-2 items-start"
className="space-y-4" id="create-client-form"
id="create-client-form" >
> <FormField
<FormField control={form.control}
control={form.control} name="name"
name="name" render={({ field }) => (
render={({ field }) => ( <FormItem>
<FormItem> <FormLabel>
<FormLabel> {t("name")}
{t("name")} </FormLabel>
</FormLabel> <FormControl>
<FormControl> <Input
<Input autoComplete="off"
autoComplete="off" {...field}
{...field} />
/> </FormControl>
</FormControl> <FormMessage />
<FormMessage /> <FormDescription>
</FormItem> {t(
)} "clientNameDescription"
/> )}
</FormDescription>
</FormItem>
)}
/>
{/* <FormField */} <FormField
{/* control={form.control} */} control={form.control}
{/* name="subnet" */} name="subnet"
{/* render={({ field }) => ( */} render={({ field }) => (
{/* <FormItem> */} <FormItem>
{/* <FormLabel> */} <FormLabel>
{/* {t("address")} */} {t("clientAddress")}
{/* </FormLabel> */} </FormLabel>
{/* <FormControl> */} <FormControl>
{/* <Input */} <Input
{/* autoComplete="off" */} autoComplete="off"
{/* placeholder={t( */} placeholder={t(
{/* "subnetPlaceholder" */} "subnetPlaceholder"
{/* )} */} )}
{/* {...field} */} {...field}
{/* /> */} />
{/* </FormControl> */} </FormControl>
{/* <FormMessage /> */} <FormMessage />
{/* <FormDescription> */} <FormDescription>
{/* {t( */} {t(
{/* "addressDescription" */} "addressDescription"
{/* )} */} )}
{/* </FormDescription> */} </FormDescription>
{/* </FormItem> */} </FormItem>
{/* )} */} )}
{/* /> */} />
</form>
{/* <FormField */} </Form>
{/* control={form.control} */}
{/* name="siteIds" */}
{/* render={(field) => ( */}
{/* <FormItem className="flex flex-col"> */}
{/* <FormLabel> */}
{/* {t("sites")} */}
{/* </FormLabel> */}
{/* <TagInput */}
{/* {...field} */}
{/* activeTagIndex={ */}
{/* activeSitesTagIndex */}
{/* } */}
{/* setActiveTagIndex={ */}
{/* setActiveSitesTagIndex */}
{/* } */}
{/* placeholder={t("selectSites")} */}
{/* size="sm" */}
{/* tags={ */}
{/* form.getValues() */}
{/* .siteIds */}
{/* } */}
{/* setTags={( */}
{/* olmags */}
{/* ) => { */}
{/* form.setValue( */}
{/* "siteIds", */}
{/* olmags as [ */}
{/* Tag, */}
{/* ...Tag[] */}
{/* ] */}
{/* ); */}
{/* }} */}
{/* enableAutocomplete={ */}
{/* true */}
{/* } */}
{/* autocompleteOptions={ */}
{/* sites */}
{/* } */}
{/* allowDuplicates={ */}
{/* false */}
{/* } */}
{/* restrictTagsToAutocompleteOptions={ */}
{/* true */}
{/* } */}
{/* sortTags={true} */}
{/* /> */}
{/* <FormDescription> */}
{/* {t("sitesDescription")} */}
{/* </FormDescription> */}
{/* <FormMessage /> */}
{/* </FormItem> */}
{/* )} */}
{/* /> */}
</form>
</Form>
</SettingsSectionForm>
</SettingsSectionBody> </SettingsSectionBody>
</SettingsSection> </SettingsSection>

View File

@@ -693,87 +693,85 @@ WantedBy=default.target`
</SettingsSectionTitle> </SettingsSectionTitle>
</SettingsSectionHeader> </SettingsSectionHeader>
<SettingsSectionBody> <SettingsSectionBody>
<SettingsSectionForm> <Form {...form}>
<Form {...form}> <form
<form onKeyDown={(e) => {
onKeyDown={(e) => { if (e.key === "Enter") {
if (e.key === "Enter") { e.preventDefault(); // block default enter refresh
e.preventDefault(); // block default enter refresh }
} }}
}} className="space-y-4 grid gap-4 grid-cols-1 md:grid-cols-2 items-start"
className="space-y-4" id="create-site-form"
id="create-site-form" >
> <FormField
control={form.control}
name="name"
render={({ field }) => (
<FormItem>
<FormLabel>
{t("name")}
</FormLabel>
<FormControl>
<Input
autoComplete="off"
{...field}
/>
</FormControl>
<FormMessage />
<FormDescription>
{t(
"siteNameDescription"
)}
</FormDescription>
</FormItem>
)}
/>
{form.watch("method") === "newt" && (
<FormField <FormField
control={form.control} control={form.control}
name="name" name="clientAddress"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel> <FormLabel>
{t("name")} {t("siteAddress")}
</FormLabel> </FormLabel>
<FormControl> <FormControl>
<Input <Input
autoComplete="off" autoComplete="off"
{...field} value={
clientAddress
}
onChange={(
e
) => {
setClientAddress(
e.target
.value
);
field.onChange(
e.target
.value
);
}}
/> />
</FormControl> </FormControl>
<FormMessage /> <FormMessage />
<FormDescription>
{t(
"siteAddressDescription"
)}
</FormDescription>
</FormItem> </FormItem>
)} )}
/> />
{/*form.watch("method") === )}
"newt" && ( </form>
<FormField </Form>
control={form.control}
name="clientAddress"
render={({ field }) => (
<FormItem>
<FormLabel>
{t(
"siteAddress"
)}
</FormLabel>
<FormControl>
<Input
autoComplete="off"
value={
clientAddress
}
onChange={(
e
) => {
setClientAddress(
e
.target
.value
);
field.onChange(
e
.target
.value
);
}}
/>
</FormControl>
<FormMessage />
<FormDescription>
{t(
"siteAddressDescription"
)}
</FormDescription>
</FormItem>
)}
/>
)*/}
</form>
</Form>
</SettingsSectionForm>
{tunnelTypes.length > 1 && ( {tunnelTypes.length > 1 && (
<> <>
<div className="mb-2"> <div className="mb-2">
<span>{t("type")}</span> <span className="text-sm font-medium">{t("type")}</span>
</div> </div>
<StrategySelect <StrategySelect
options={tunnelTypes} options={tunnelTypes}