feat(remote-ingress): support auto-deriving ports for remote ingress edges and expose manual/derived port breakdown in API and UI

This commit is contained in:
2026-02-17 14:17:18 +00:00
parent 31a6510d8b
commit 49606ae007
9 changed files with 183 additions and 22 deletions

View File

@@ -822,6 +822,7 @@ export const fetchRemoteIngressAction = remoteIngressStatePart.createAction(asyn
export const createRemoteIngressAction = remoteIngressStatePart.createAction<{
name: string;
listenPorts?: number[];
autoDerivePorts?: boolean;
tags?: string[];
}>(async (statePartArg, dataArg) => {
const context = getActionContext();
@@ -836,6 +837,7 @@ export const createRemoteIngressAction = remoteIngressStatePart.createAction<{
identity: context.identity,
name: dataArg.name,
listenPorts: dataArg.listenPorts,
autoDerivePorts: dataArg.autoDerivePorts,
tags: dataArg.tags,
});
@@ -883,6 +885,40 @@ export const deleteRemoteIngressAction = remoteIngressStatePart.createAction<str
}
);
export const updateRemoteIngressAction = remoteIngressStatePart.createAction<{
id: string;
name?: string;
listenPorts?: number[];
autoDerivePorts?: boolean;
tags?: string[];
}>(async (statePartArg, dataArg) => {
const context = getActionContext();
const currentState = statePartArg.getState();
try {
const request = new plugins.domtools.plugins.typedrequest.TypedRequest<
interfaces.requests.IReq_UpdateRemoteIngress
>('/typedrequest', 'updateRemoteIngress');
await request.fire({
identity: context.identity,
id: dataArg.id,
name: dataArg.name,
listenPorts: dataArg.listenPorts,
autoDerivePorts: dataArg.autoDerivePorts,
tags: dataArg.tags,
});
await remoteIngressStatePart.dispatchAction(fetchRemoteIngressAction, null);
return statePartArg.getState();
} catch (error) {
return {
...currentState,
error: error instanceof Error ? error.message : 'Failed to update edge',
};
}
});
export const regenerateRemoteIngressSecretAction = remoteIngressStatePart.createAction<string>(
async (statePartArg, edgeId) => {
const context = getActionContext();