mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
opt: autoQuitWithoutCoreDelay input (#965)
* opt: autoQuitWithoutCoreDelay input * opt: prevent text overflow in autoQuitWithoutCoreDelay input
This commit is contained in:
parent
c506d60e66
commit
ee19749009
@ -164,19 +164,25 @@ const GeneralConfig: React.FC = () => {
|
||||
</SettingItem>
|
||||
{autoQuitWithoutCore && (
|
||||
<SettingItem title={t('settings.autoQuitWithoutCoreDelay')} divider>
|
||||
<Input
|
||||
size="sm"
|
||||
className="w-[100px]"
|
||||
type="number"
|
||||
endContent={t('common.seconds')}
|
||||
value={autoQuitWithoutCoreDelay.toString()}
|
||||
onValueChange={async (v: string) => {
|
||||
let num = parseInt(v)
|
||||
if (isNaN(num)) num = 5
|
||||
if (num < 5) num = 5
|
||||
await patchAppConfig({ autoQuitWithoutCoreDelay: num })
|
||||
}}
|
||||
/>
|
||||
<div className="flex items-center gap-2">
|
||||
<Input
|
||||
size="sm"
|
||||
className="w-[100px]"
|
||||
type="number"
|
||||
value={autoQuitWithoutCoreDelay.toString()}
|
||||
onValueChange={async (v: string) => {
|
||||
let num = parseInt(v)
|
||||
await patchAppConfig({ autoQuitWithoutCoreDelay: num })
|
||||
}}
|
||||
onBlur={async (e) => {
|
||||
let num = parseInt(e.target.value)
|
||||
if (isNaN(num)) num = 5
|
||||
if (num < 5) num = 5
|
||||
await patchAppConfig({ autoQuitWithoutCoreDelay: num })
|
||||
}}
|
||||
/>
|
||||
<span className="text-default-500">{t('common.seconds')}</span>
|
||||
</div>
|
||||
</SettingItem>
|
||||
)}
|
||||
<SettingItem
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user