diff --git a/src/apis/index.ts b/src/apis/index.ts index c677733..150c1ab 100644 --- a/src/apis/index.ts +++ b/src/apis/index.ts @@ -85,7 +85,7 @@ export const fetchBackendConfigAPI = () => { export const updateBackendConfigAPI = async ( key: keyof Config, - value: Config[keyof Config], + value: Partial, refetch: ResourceActions['refetch'], ) => { try { diff --git a/src/components/ConfigTitle.tsx b/src/components/ConfigTitle.tsx index 125092f..9db046d 100644 --- a/src/components/ConfigTitle.tsx +++ b/src/components/ConfigTitle.tsx @@ -4,7 +4,7 @@ export const ConfigTitle: ParentComponent<{ withDivider?: boolean }> = ( props, ) => (
tag.tagName !== tagName), ) } - > - - + icon={} + />
)} diff --git a/src/i18n/en.ts b/src/i18n/en.ts index de7c80a..16fc9c0 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -97,4 +97,8 @@ export default { version: 'Version', expire: 'Expire', noExpire: 'Null', + enableTunDevice: 'Enable TUN Device', + tunModeStack: 'TUN Mode Stack', + tunDeviceName: 'TUN Device Name', + interfaceName: 'Interface Name', } diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts index b65e5f6..ee06791 100644 --- a/src/i18n/zh.ts +++ b/src/i18n/zh.ts @@ -99,4 +99,8 @@ export default { version: '版本', expire: '到期时间', noExpire: '不限时', + enableTunDevice: '开启 TUN 转发', + tunModeStack: 'TUN 模式堆栈', + tunDeviceName: 'TUN 设备名称', + interfaceName: '接口名称', } satisfies Dict diff --git a/src/pages/Config.tsx b/src/pages/Config.tsx index 9980cbd..4da3150 100644 --- a/src/pages/Config.tsx +++ b/src/pages/Config.tsx @@ -178,11 +178,6 @@ const ConfigForm = () => { } }) - const onSwitchEndpointClick = () => { - setSelectedEndpoint('') - navigate(ROUTES.Setup) - } - return (
{ +
+
+ + + + void updateBackendConfigAPI( + 'tun', + { enable: e.target.checked }, + refetch, + ) + } + /> +
+ +
+ + + +
+ +
+ + + + void updateBackendConfigAPI( + 'tun', + { device: e.target.value }, + refetch, + ) + } + /> +
+ +
+ + + + void updateBackendConfigAPI( + 'interface-name', + e.target.value, + refetch, + ) + } + /> +
+
+
-
@@ -270,9 +355,9 @@ const ConfigForXd = () => { const { t } = useI18n() return ( -
-
-
+
+
+
{t('autoSwitchTheme')} {
-
+
{t('favDayTheme')} @@ -322,7 +407,7 @@ const ConfigForXd = () => {
-
+
{t('useTwemoji')}