diff --git a/frontend-modern/src/components/Settings/UnifiedAgents.tsx b/frontend-modern/src/components/Settings/UnifiedAgents.tsx index 6d199f19b..6ff64bb98 100644 --- a/frontend-modern/src/components/Settings/UnifiedAgents.tsx +++ b/frontend-modern/src/components/Settings/UnifiedAgents.tsx @@ -109,6 +109,7 @@ export const UnifiedAgents: Component = () => { const [lookupError, setLookupError] = createSignal(null); const [lookupLoading, setLookupLoading] = createSignal(false); const [insecureMode, setInsecureMode] = createSignal(false); // For self-signed certificates (issue #806) + const [customAgentUrl, setCustomAgentUrl] = createSignal(''); createEffect(() => { if (requiresToken()) { @@ -123,7 +124,8 @@ export const UnifiedAgents: Component = () => { const agentUrl = () => securityStatus()?.agentUrl || getPulseBaseUrl(); const commandSections = createMemo(() => { - const commands = buildCommandsByPlatform(agentUrl()); + const url = customAgentUrl() || agentUrl(); + const commands = buildCommandsByPlatform(url); return Object.entries(commands).map(([platform, meta]) => ({ platform: platform as AgentPlatform, ...meta, @@ -243,7 +245,8 @@ export const UnifiedAgents: Component = () => { const getCurlInsecureFlag = () => insecureMode() ? '-k' : ''; const getUninstallCommand = () => { - return `curl ${getCurlInsecureFlag()}-fsSL ${agentUrl()}/install.sh | sudo bash -s -- --uninstall`; + const url = customAgentUrl() || agentUrl(); + return `curl ${getCurlInsecureFlag()}-fsSL ${url}/install.sh | sudo bash -s -- --uninstall`; }; // Track previously seen host types to prevent flapping when one source temporarily has no data @@ -375,7 +378,8 @@ export const UnifiedAgents: Component = () => { const getUpgradeCommand = (_hostname: string) => { const token = resolvedToken(); - return `curl ${getCurlInsecureFlag()}-fsSL ${agentUrl()}/install.sh | sudo bash -s -- --url ${agentUrl()} --token ${token}${getInsecureFlag()}`; + const url = customAgentUrl() || agentUrl(); + return `curl ${getCurlInsecureFlag()}-fsSL ${url}/install.sh | sudo bash -s -- --url ${url} --token ${token}${getInsecureFlag()}`; }; const handleRemoveAgent = async (id: string, type: 'host' | 'docker' | 'kubernetes') => { @@ -501,6 +505,27 @@ export const UnifiedAgents: Component = () => {

The installer auto-detects Docker, Kubernetes, and Proxmox on the target machine.

+ +
+ +
+ setCustomAgentUrl(e.currentTarget.value)} + placeholder={agentUrl()} + class="flex-1 rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-900 dark:text-gray-100 dark:focus:border-blue-400 dark:focus:ring-blue-800" + /> +
+

+ Override the address agents use to connect to this server (e.g., use IP address http://192.168.1.50:7655 if DNS fails). + + Currently using auto-detected: {agentUrl()} + +

+
TLS verification disabled — commands will skip certificate checks (for self-signed certs).