diff --git a/src/components/proxy-hosts/UpstreamDnsResolutionFields.tsx b/src/components/proxy-hosts/UpstreamDnsResolutionFields.tsx index e8d995bd..ab3e6e4f 100644 --- a/src/components/proxy-hosts/UpstreamDnsResolutionFields.tsx +++ b/src/components/proxy-hosts/UpstreamDnsResolutionFields.tsx @@ -1,4 +1,6 @@ -import { Alert, Box, MenuItem, Stack, TextField, Typography } from "@mui/material"; +import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; +import { Alert, Box, Collapse, IconButton, MenuItem, Stack, TextField, Typography } from "@mui/material"; +import { useState } from "react"; import type { ProxyHost } from "@/src/lib/models/proxy-hosts"; type ResolutionMode = "inherit" | "enabled" | "disabled"; @@ -24,6 +26,10 @@ export function UpstreamDnsResolutionFields({ }) { const mode = toResolutionMode(upstreamDnsResolution?.enabled); const family = toFamilyMode(upstreamDnsResolution?.family); + const [expanded, setExpanded] = useState(mode !== "inherit" || family !== "inherit"); + const summary = mode === "inherit" && family === "inherit" + ? "Using global upstream DNS pinning defaults" + : `Override: ${mode === "inherit" ? "inherit mode" : mode}, ${family === "inherit" ? "inherit family" : family}`; return ( - - Upstream DNS Pinning - - - Inherit Global - Enabled - Disabled - - - Inherit Global - Both (Prefer IPv6) - IPv6 only - IPv4 only - - - When enabled, hostname upstreams are resolved during config apply and written to Caddy as concrete IP dials. If this handler has - multiple different HTTPS upstream hostnames, HTTPS pinning is skipped for those HTTPS upstreams to avoid SNI mismatch. - + + + + Upstream DNS Pinning + + + {summary} + + + setExpanded(prev => !prev)} + sx={{ + transform: expanded ? "rotate(180deg)" : "rotate(0deg)", + transition: "transform 0.2s ease" + }} + > + + + + + + + + Inherit Global + Enabled + Disabled + + + Inherit Global + Both (Prefer IPv6) + IPv6 only + IPv4 only + + + When enabled, hostname upstreams are resolved during config apply and written to Caddy as concrete IP dials. If this handler has + multiple different HTTPS upstream hostnames, HTTPS pinning is skipped for those HTTPS upstreams to avoid SNI mismatch. + + + );