mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 15:26:36 +08:00
[新增] 内网穿透隧道前端管理与代理规则绑定支持 (P5)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { apiRequest } from '@/lib/api/client';
|
||||
|
||||
import type { TunnelItem, TunnelMutationPayload } from '@/features/tunnels/types';
|
||||
|
||||
export function getTunnels() {
|
||||
return apiRequest<TunnelItem[]>('/tunnels/');
|
||||
}
|
||||
|
||||
export function createTunnel(payload: TunnelMutationPayload) {
|
||||
return apiRequest<TunnelItem>('/tunnels/', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
export function updateTunnel(id: number, payload: TunnelMutationPayload) {
|
||||
return apiRequest<TunnelItem>(`/tunnels/${id}/update`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteTunnel(id: number) {
|
||||
return apiRequest<void>(`/tunnels/${id}/delete`, {
|
||||
method: 'POST',
|
||||
});
|
||||
}
|
||||
|
||||
export function rotateTunnelToken(id: number) {
|
||||
return apiRequest<TunnelItem>(`/tunnels/${id}/rotate-token`, {
|
||||
method: 'POST',
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user