Show warning about the .local aliases

This commit is contained in:
Owen
2026-06-23 17:44:18 -04:00
parent b8101402cd
commit 91ef0d0153
2 changed files with 12 additions and 0 deletions

View File

@@ -2338,6 +2338,7 @@
"createInternalResourceDialogDestinationCidrDescription": "The CIDR range of the resource on the site's network.",
"createInternalResourceDialogAlias": "Alias",
"createInternalResourceDialogAliasDescription": "An optional internal DNS alias for this resource.",
"internalResourceAliasLocalWarning": "Aliases ending in .local can cause resolution issues due to mDNS on some networks.",
"internalResourceDownstreamSchemeRequired": "Scheme is required for HTTP resources",
"internalResourceHttpPortRequired": "Destination port is required for HTTP resources",
"siteConfiguration": "Configuration",

View File

@@ -580,6 +580,7 @@ export function PrivateResourceForm({
});
const mode = form.watch("mode");
const aliasValue = form.watch("alias");
const httpConfigSubdomain = form.watch("httpConfigSubdomain");
const httpConfigDomainId = form.watch("httpConfigDomainId");
const httpConfigFullDomain = form.watch("httpConfigFullDomain");
@@ -595,6 +596,9 @@ export function PrivateResourceForm({
!isNative &&
pamMode === "push" &&
authDaemonMode === "remote";
const aliasEndsWithLocal =
typeof aliasValue === "string" &&
aliasValue.trim().toLowerCase().endsWith(".local");
const hasInitialized = useRef(false);
const previousResourceId = useRef<number | null>(null);
const initialSitesRef = useRef(initialSites);
@@ -1209,6 +1213,13 @@ export function PrivateResourceForm({
}
/>
</FormControl>
{aliasEndsWithLocal && (
<p className="text-xs text-amber-700/80 mt-1">
{t(
"internalResourceAliasLocalWarning"
)}
</p>
)}
<FormMessage />
</FormItem>
)}