From ef662c9fdba3b8d6615c71707b5e1eed76ee88eb Mon Sep 17 00:00:00 2001 From: Muse Date: Sat, 24 Oct 2026 00:22:24 +0800 Subject: [PATCH] panel: install commands no longer append --probe-only Probe-only is governed solely by the master-side flag so unchecking it in the panel takes effect on its own; an agent.json preset would pin it via the dual-source OR gate. The install-agent.sh/ps1 --probe-only flag stays for manual installs. tsc --noEmit clean. --- frontend/src/pages/nodes/NodeFormModal.tsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/frontend/src/pages/nodes/NodeFormModal.tsx b/frontend/src/pages/nodes/NodeFormModal.tsx index 2cc4ca4..9bbb132 100644 --- a/frontend/src/pages/nodes/NodeFormModal.tsx +++ b/frontend/src/pages/nodes/NodeFormModal.tsx @@ -84,9 +84,6 @@ export default function NodeFormModal({ const [testResult, setTestResult] = useState(null); const [agentToken, setAgentToken] = useState(null); const [agentNodeName, setAgentNodeName] = useState(''); - // Whether the just-created agent node was flagged probe-only, so the - // install command below can carry the matching --probe-only flag. - const [agentProbeOnly, setAgentProbeOnly] = useState(false); const [agentMasterUrl, setAgentMasterUrl] = useState(''); // Edit mode (item 19): the stored install material for an existing agent // node, fetched from the master; null until loaded / for non-agent nodes. @@ -104,7 +101,6 @@ export default function NodeFormModal({ const inboundSyncMode = useWatch({ control: methods.control, name: 'inboundSyncMode' }) ?? 'all'; const nodeType = useWatch({ control: methods.control, name: 'nodeType' }) ?? 'traditional'; const isAgent = nodeType === 'agent'; - const probeOnly = useWatch({ control: methods.control, name: 'probeOnly' }) ?? false; const { data: outboundGroups } = useOutboundTagGroups({ excludeBlackhole: true }); // Outbounds and balancers share one picker (like the panel-outbound selector); @@ -186,10 +182,13 @@ export default function NodeFormModal({ const cmd = shownInstall.hasToken ? `${base} --token ${shownInstall.token} --name ${shownInstall.name}` : `${base} --name ${shownInstall.name}`; - // The toggle is the source of truth for the re-displayed command: - // flipping it rewrites the command the operator would re-run. - return probeOnly ? `${cmd} --probe-only` : cmd; - }, [shownInstall, editMasterUrl, probeOnly]); + // The command never carries --probe-only: an agent.json preset would + // pin probe-only on the machine (dual-source OR gate) and the panel + // toggle alone could no longer turn it off. Probe-only is governed + // solely by the master-side flag; the script flag stays for manual + // installs that deliberately want the preset. + return cmd; + }, [shownInstall, editMasterUrl]); const title = useMemo( () => (mode === 'edit' ? t('pages.nodes.editNode') : t('pages.nodes.addNode')), @@ -307,7 +306,6 @@ export default function NodeFormModal({ if (agentMode && mode === 'add' && obj?.agentToken) { setAgentToken(obj.agentToken); setAgentNodeName(result.data.name.trim()); - setAgentProbeOnly(result.data.probeOnly ?? false); // Default the master URL to the address this panel is being // viewed through — origin AND base path. Dropping the base // path made the agent's registration 404. User can edit it. @@ -330,7 +328,7 @@ export default function NodeFormModal({ // one would produce a command that can never register, so withhold it // (and say why) instead of letting the user copy a dead command. const installCmd = agentMasterUrl - ? `bash <(curl -fL https://git.881218.xyz/rogue/3x-ui-agent/raw/branch/main/install-agent.sh) --master ${agentMasterUrl} --token ${agentToken ?? ''} --name ${agentNodeName}${agentProbeOnly ? ' --probe-only' : ''}` + ? `bash <(curl -fL https://git.881218.xyz/rogue/3x-ui-agent/raw/branch/main/install-agent.sh) --master ${agentMasterUrl} --token ${agentToken ?? ''} --name ${agentNodeName}` : ''; return (