mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-26 09:09:05 +00:00
Show warning about the .local aliases
This commit is contained in:
@@ -2338,6 +2338,7 @@
|
|||||||
"createInternalResourceDialogDestinationCidrDescription": "The CIDR range of the resource on the site's network.",
|
"createInternalResourceDialogDestinationCidrDescription": "The CIDR range of the resource on the site's network.",
|
||||||
"createInternalResourceDialogAlias": "Alias",
|
"createInternalResourceDialogAlias": "Alias",
|
||||||
"createInternalResourceDialogAliasDescription": "An optional internal DNS alias for this resource.",
|
"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",
|
"internalResourceDownstreamSchemeRequired": "Scheme is required for HTTP resources",
|
||||||
"internalResourceHttpPortRequired": "Destination port is required for HTTP resources",
|
"internalResourceHttpPortRequired": "Destination port is required for HTTP resources",
|
||||||
"siteConfiguration": "Configuration",
|
"siteConfiguration": "Configuration",
|
||||||
|
|||||||
@@ -580,6 +580,7 @@ export function PrivateResourceForm({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const mode = form.watch("mode");
|
const mode = form.watch("mode");
|
||||||
|
const aliasValue = form.watch("alias");
|
||||||
const httpConfigSubdomain = form.watch("httpConfigSubdomain");
|
const httpConfigSubdomain = form.watch("httpConfigSubdomain");
|
||||||
const httpConfigDomainId = form.watch("httpConfigDomainId");
|
const httpConfigDomainId = form.watch("httpConfigDomainId");
|
||||||
const httpConfigFullDomain = form.watch("httpConfigFullDomain");
|
const httpConfigFullDomain = form.watch("httpConfigFullDomain");
|
||||||
@@ -595,6 +596,9 @@ export function PrivateResourceForm({
|
|||||||
!isNative &&
|
!isNative &&
|
||||||
pamMode === "push" &&
|
pamMode === "push" &&
|
||||||
authDaemonMode === "remote";
|
authDaemonMode === "remote";
|
||||||
|
const aliasEndsWithLocal =
|
||||||
|
typeof aliasValue === "string" &&
|
||||||
|
aliasValue.trim().toLowerCase().endsWith(".local");
|
||||||
const hasInitialized = useRef(false);
|
const hasInitialized = useRef(false);
|
||||||
const previousResourceId = useRef<number | null>(null);
|
const previousResourceId = useRef<number | null>(null);
|
||||||
const initialSitesRef = useRef(initialSites);
|
const initialSitesRef = useRef(initialSites);
|
||||||
@@ -1209,6 +1213,13 @@ export function PrivateResourceForm({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
{aliasEndsWithLocal && (
|
||||||
|
<p className="text-xs text-amber-700/80 mt-1">
|
||||||
|
{t(
|
||||||
|
"internalResourceAliasLocalWarning"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user