mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-27 10:44:02 +08:00
fix(config): selected option
This commit is contained in:
parent
fc96dc995a
commit
d6ce1376a6
@ -260,13 +260,16 @@ const ConfigForm: ParentComponent<{
|
|||||||
|
|
||||||
<Select
|
<Select
|
||||||
id="mode"
|
id="mode"
|
||||||
value={configsData()?.mode}
|
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
void updateBackendConfigAPI('mode', e.target.value, refetch)
|
void updateBackendConfigAPI('mode', e.target.value, refetch)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<For each={modes()}>
|
<For each={modes()}>
|
||||||
{(name) => <option value={name}>{t(name as keyof Dict)}</option>}
|
{(name) => (
|
||||||
|
<option selected={name === configsData()?.mode} value={name}>
|
||||||
|
{t(name as keyof Dict)}
|
||||||
|
</option>
|
||||||
|
)}
|
||||||
</For>
|
</For>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
@ -311,7 +314,6 @@ const ConfigForm: ParentComponent<{
|
|||||||
|
|
||||||
<Select
|
<Select
|
||||||
id="tun-ip-stack"
|
id="tun-ip-stack"
|
||||||
value={configsData()?.tun?.stack}
|
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
void updateBackendConfigAPI(
|
void updateBackendConfigAPI(
|
||||||
'tun',
|
'tun',
|
||||||
@ -320,10 +322,16 @@ const ConfigForm: ParentComponent<{
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<option>Mixed</option>
|
<For each={['Mixed', 'gVisor', 'System', 'LWIP']}>
|
||||||
<option>gVisor</option>
|
{(name) => (
|
||||||
<option>System</option>
|
<option
|
||||||
<option>LWIP</option>
|
selected={configsData()?.tun?.stack === name}
|
||||||
|
value={name}
|
||||||
|
>
|
||||||
|
{name}
|
||||||
|
</option>
|
||||||
|
)}
|
||||||
|
</For>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user