diff --git a/frontend/src/lib/xray/inbound-form-adapter.ts b/frontend/src/lib/xray/inbound-form-adapter.ts index c6b5ad5..ec8b107 100644 --- a/frontend/src/lib/xray/inbound-form-adapter.ts +++ b/frontend/src/lib/xray/inbound-form-adapter.ts @@ -77,7 +77,7 @@ export interface WireInboundPayload { sniffing: string; tag: string; clientStats?: unknown; - nodeId?: number; + nodeId?: number | null; shareAddrStrategy: ShareAddrStrategy; shareAddr: string; subSortIndex: number; @@ -384,6 +384,9 @@ export function formValuesToWirePayload(values: InboundFormValues): WireInboundP subSortIndex: values.subSortIndex, disableFlow: values.disableFlow, }; - if (values.nodeId != null) payload.nodeId = values.nodeId; + // nodeId is always emitted (null = local panel): the update endpoint + // distinguishes an explicit null — "move the inbound back to local" — + // from an omitted key, which keeps the stored assignment untouched. + payload.nodeId = values.nodeId ?? null; return payload; } diff --git a/frontend/src/pages/inbounds/form/InboundFormModal.tsx b/frontend/src/pages/inbounds/form/InboundFormModal.tsx index 65664e3..1f4a50f 100644 --- a/frontend/src/pages/inbounds/form/InboundFormModal.tsx +++ b/frontend/src/pages/inbounds/form/InboundFormModal.tsx @@ -618,7 +618,6 @@ export default function InboundFormModal({