diff options
| author | yaling888 <[email protected]> | 2022-05-07 02:43:42 +0800 |
|---|---|---|
| committer | yaling888 <[email protected]> | 2022-05-07 02:43:42 +0800 |
| commit | e5a6393fa8cdf4c92b2e68b5d2f4c7633ca5d690 (patch) | |
| tree | 24e08847d6f3f7f615e2e8ef45282e39bf2f348d /src/api | |
| parent | aff98308f361b26e419e2b4b80c2ae0b800d19de (diff) | |
feat: add tun stack config to config page
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/configs.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/configs.ts b/src/api/configs.ts index e084261..ed2b1e9 100644 --- a/src/api/configs.ts +++ b/src/api/configs.ts @@ -1,5 +1,5 @@ import { getURLAndInit } from 'src/misc/request-helper'; -import { ClashGeneralConfig } from 'src/store/types'; +import { ClashGeneralConfig, TunPartial } from 'src/store/types'; import { ClashAPIConfig } from 'src/types'; const endpoint = '/configs'; @@ -14,7 +14,7 @@ export async function fetchConfigs(apiConfig: ClashAPIConfig) { // req body // { Path: string } -type ClashConfigPartial = Partial<ClashGeneralConfig>; +type ClashConfigPartial = TunPartial<ClashGeneralConfig>; function configsPatchWorkaround(o: ClashConfigPartial) { // backward compatibility for older clash using `socket-port` if ('socks-port' in o) { @@ -32,7 +32,7 @@ export async function updateConfigs( return await fetch(url + endpoint, { ...init, body, method: 'PATCH' }); } -export async function reloadConfigs( +export async function reloadConfigFile( apiConfig: ClashAPIConfig ) { const { url, init } = getURLAndInit(apiConfig); |
