diff options
| author | yaling888 <[email protected]> | 2022-05-07 03:28:46 +0800 |
|---|---|---|
| committer | yaling888 <[email protected]> | 2022-05-07 03:28:46 +0800 |
| commit | 3ae7d3deea5dbd497167566024f2b62b95da7cb2 (patch) | |
| tree | 3b2fabfe0c0e202485ba6476478cddf1c7b8c3a7 /src/components | |
| parent | e5a6393fa8cdf4c92b2e68b5d2f4c7633ca5d690 (diff) | |
feat: add tun switch config to config page
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Config.tsx | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/src/components/Config.tsx b/src/components/Config.tsx index 808ffd9..3243ae6 100644 --- a/src/components/Config.tsx +++ b/src/components/Config.tsx @@ -164,6 +164,7 @@ function ConfigImpl({ } setConfigState(name, value); break; + case 'enable': case 'stack': setTunConfigState(name, value); dispatch(updateConfigs(apiConfig, { 'tun': {[name]: value }})); @@ -266,17 +267,6 @@ function ConfigImpl({ </div> <div> - <div className={s0.label}>TUN Stack</div> - <Select - options={tunStackOptions} - selected={configState['tun']['stack']} - onChange={(e) => - handleChangeValue({ name: 'stack', value: e.target.value }) - } - /> - </div> - - <div> <div className={s0.label}>Allow LAN</div> <div className={s0.wrapSwitch}> <Switch @@ -286,6 +276,29 @@ function ConfigImpl({ /> </div> </div> + + <div> + <div className={s0.label}>{t('enable_tun_device')}</div> + <div className={s0.wrapSwitch}> + <Switch + checked={configState['tun']['enable']} + onChange={(value: boolean) => + handleChangeValue({ name: 'enable', value: value }) + } + /> + </div> + </div> + + <div> + <div className={s0.label}>TUN Stack</div> + <Select + options={tunStackOptions} + selected={configState['tun']['stack']} + onChange={(e) => + handleChangeValue({ name: 'stack', value: e.target.value }) + } + /> + </div> </div> <div className={s0.sep}> |
