feat: connections page simply support

This commit is contained in:
GyDi authored and GitHub committed 2022-03-18 14:43:22 +08:00
1 parent 46a9023782
commit 4fca73ffbd
5 files changed
+78 -4

No files matched your search

+12
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`);
}