mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
enable-disable forwards
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
LoginReq,
|
||||
SubscribeRes,
|
||||
TunnelUpdateResult,
|
||||
SetForwardEnabledReq,
|
||||
UpdateForwardLabelReq,
|
||||
UpsertDeviceReq,
|
||||
UpsertSubnetReq,
|
||||
@@ -181,7 +182,11 @@ export class MockApiService extends ApiService {
|
||||
{
|
||||
op: PatchOp.ADD,
|
||||
path: `/portForwards/${params.source}`,
|
||||
value: { target: params.target, label: params.label || '' },
|
||||
value: {
|
||||
target: params.target,
|
||||
label: params.label || '',
|
||||
enabled: true,
|
||||
},
|
||||
},
|
||||
]
|
||||
this.mockRevision(patch)
|
||||
@@ -204,6 +209,21 @@ export class MockApiService extends ApiService {
|
||||
return null
|
||||
}
|
||||
|
||||
async setForwardEnabled(params: SetForwardEnabledReq): Promise<null> {
|
||||
await pauseFor(1000)
|
||||
|
||||
const patch: ReplaceOperation<boolean>[] = [
|
||||
{
|
||||
op: PatchOp.REPLACE,
|
||||
path: `/portForwards/${params.source}/enabled`,
|
||||
value: params.enabled,
|
||||
},
|
||||
]
|
||||
this.mockRevision(patch)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
async deleteForward(params: DeleteForwardReq): Promise<null> {
|
||||
await pauseFor(1000)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user