diff options
| author | yaling888 <[email protected]> | 2022-05-16 03:14:22 +0800 |
|---|---|---|
| committer | yaling888 <[email protected]> | 2022-05-16 03:14:22 +0800 |
| commit | c0ff201efb58765bc108b3c97efdc8d635f26921 (patch) | |
| tree | c0d76e5e09122b1cbd1d302acd61a1924935deaa /src/api/configs.ts | |
| parent | f3d984984124c947322024c3f8b9a8e8ae8b728f (diff) | |
feat: add "update geo databases" & "tls sniffing switch" to config page
Diffstat (limited to 'src/api/configs.ts')
| -rw-r--r-- | src/api/configs.ts | 9 |
1 files changed, 9 insertions, 0 deletions
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 ) { |
