From c0ff201efb58765bc108b3c97efdc8d635f26921 Mon Sep 17 00:00:00 2001 From: yaling888 <73897884+yaling888@users.noreply.github.com> Date: Mon, 16 May 2022 03:14:22 +0800 Subject: feat: add "update geo databases" & "tls sniffing switch" to config page --- src/api/configs.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/api') diff --git a/src/api/configs.ts b/src/api/configs.ts index ed2b1e9..3734958 100644 --- a/src/api/configs.ts +++ b/src/api/configs.ts @@ -3,6 +3,7 @@ import { ClashGeneralConfig, TunPartial } from 'src/store/types'; import { ClashAPIConfig } from 'src/types'; const endpoint = '/configs'; +const updateGeoDatabasesFileEndpoint = '/configs/geo'; const flushFakeIPPoolEndpoint = '/cache/fakeip/flush'; export async function fetchConfigs(apiConfig: ClashAPIConfig) { @@ -40,6 +41,14 @@ export async function reloadConfigFile( return await fetch(url + endpoint + '?force=true', { ...init, body, method: 'PUT' }); } +export async function updateGeoDatabasesFile( + apiConfig: ClashAPIConfig +) { + const { url, init } = getURLAndInit(apiConfig); + const body = '{"path": "", "payload": ""}'; + return await fetch(url + updateGeoDatabasesFileEndpoint, { ...init, body, method: 'POST' }); +} + export async function flushFakeIPPool( apiConfig: ClashAPIConfig ) { -- cgit v1.3.1