feat: connections page simply support

This commit is contained in:
GyDi
2022-03-18 14:43:22 +08:00
committed by GitHub
parent 7074bbc405
commit 5b886fe6be
5 changed files with 78 additions and 4 deletions

View File

@@ -141,3 +141,15 @@ export async function getProviders() {
const response = await instance.get<any, any>("/providers/proxies");
return response.providers as any;
}
// Close specific connection
export async function deleteConnection(id: string) {
const instance = await getAxios();
await instance.delete<any, any>(`/connections/${encodeURIComponent(id)}`);
}
// Close all connections
export async function closeAllConnections() {
const instance = await getAxios();
await instance.delete<any, any>(`/connections`);
}