fix domain picker

This commit is contained in:
miloschwartz
2026-04-09 22:48:43 -04:00
parent 73482c2a05
commit 8a47d69d0d
2 changed files with 43 additions and 37 deletions

View File

@@ -163,15 +163,18 @@ export default function DomainPicker({
domainId: firstOrExistingDomain.domainId
};
const base = firstOrExistingDomain.baseDomain;
const sub =
firstOrExistingDomain.type !== "cname"
? defaultSubdomain?.trim() || undefined
: undefined;
onDomainChange?.({
domainId: firstOrExistingDomain.domainId,
type: "organization",
subdomain:
firstOrExistingDomain.type !== "cname"
? defaultSubdomain || undefined
: undefined,
fullDomain: firstOrExistingDomain.baseDomain,
baseDomain: firstOrExistingDomain.baseDomain
subdomain: sub,
fullDomain: sub ? `${sub}.${base}` : base,
baseDomain: base
});
}
}

View File

@@ -495,7 +495,7 @@ export function InternalResourceForm({
alias: null,
httpHttpsPort: null,
scheme: "http",
ssl: false,
ssl: true,
httpConfigSubdomain: null,
httpConfigDomainId: null,
httpConfigFullDomain: null,
@@ -548,7 +548,7 @@ export function InternalResourceForm({
alias: null,
httpHttpsPort: null,
scheme: "http",
ssl: false,
ssl: true,
httpConfigSubdomain: null,
httpConfigDomainId: null,
httpConfigFullDomain: null,
@@ -732,7 +732,9 @@ export function InternalResourceForm({
name="siteId"
render={({ field }) => (
<FormItem className="flex flex-col">
<FormLabel>{t("site")}</FormLabel>
<FormLabel>
{t("site")}
</FormLabel>
<Popover>
<PopoverTrigger asChild>
<FormControl>
@@ -888,7 +890,10 @@ export function InternalResourceForm({
{t(destinationLabelKey)}
</FormLabel>
<FormControl>
<Input {...field} className="w-full" />
<Input
{...field}
className="w-full"
/>
</FormControl>
<FormMessage />
</FormItem>
@@ -947,16 +952,16 @@ export function InternalResourceForm({
const raw =
e.target
.value;
if (raw === "") {
if (
raw === ""
) {
field.onChange(
null
);
return;
}
const n =
Number(
raw
);
Number(raw);
field.onChange(
Number.isFinite(
n
@@ -986,29 +991,6 @@ export function InternalResourceForm({
{t(httpConfigurationDescriptionKey)}
</div>
</div>
<FormField
control={form.control}
name="ssl"
render={({ field }) => (
<FormItem>
<FormControl>
<SwitchInput
id="internal-resource-ssl"
label={t(
enableSslLabelKey
)}
description={t(
enableSslDescriptionKey
)}
checked={!!field.value}
onCheckedChange={
field.onChange
}
/>
</FormControl>
</FormItem>
)}
/>
<DomainPicker
key={
variant === "edit" && siteResourceId
@@ -1059,6 +1041,27 @@ export function InternalResourceForm({
form.setValue("alias", res.fullDomain);
}}
/>
<FormField
control={form.control}
name="ssl"
render={({ field }) => (
<FormItem>
<FormControl>
<SwitchInput
id="internal-resource-ssl"
label={t(enableSslLabelKey)}
description={t(
enableSslDescriptionKey
)}
checked={!!field.value}
onCheckedChange={
field.onChange
}
/>
</FormControl>
</FormItem>
)}
/>
</div>
) : (
<div className="space-y-4">