Feature(custom): optimize manage main page

This commit is contained in:
Kuingsmile
2026-01-24 15:12:05 +08:00
parent f7430310d2
commit 6ac1b6413d
16 changed files with 682 additions and 1458 deletions
+17 -12
View File
@@ -71,6 +71,7 @@
small
:title="t('pages.settings.system.isDisableGPU')"
:description="t('pages.settings.system.isDisableGPUDesc')"
@update:model-value="handleIsDisableGPUChange"
/>
</SettingCard>
@@ -189,13 +190,16 @@
<!-- Startup & Shortcuts Section -->
<SettingSection :icon="Keyboard" :title="t('pages.settings.system.startupAndShortcuts')">
<!-- Auto Launch Toggle -->
<CustomSwitch
v-model="formOfSetting.autoStart"
small
:title="t('pages.settings.system.autoLaunch')"
:description="t('pages.settings.system.autoLaunchDesc')"
@change="handleAutoStartChange(formOfSetting.autoStart)"
/>
<SettingCard p1>
<CustomSwitch
v-model="formOfSetting.autoStart"
small
no-border
:title="t('pages.settings.system.autoLaunch')"
:description="t('pages.settings.system.autoLaunchDesc')"
@change="handleAutoStartChange(formOfSetting.autoStart)"
/>
</SettingCard>
<CustomNavCard
:title="t('pages.settings.system.setShortCuts')"
:description="t('pages.settings.system.setShortCutsDesc')"
@@ -1570,11 +1574,6 @@ const addWatch = () => {
}
})
watch(isDisableGPU, newVal => {
message.info(t('pages.settings.system.needRestart'))
saveConfig({ [configPaths.settings.isDisableGPU]: newVal })
})
watch(
advancedRename,
newVal => {
@@ -1744,6 +1743,12 @@ async function handleThemeChange(theme: string) {
}
}
function handleIsDisableGPUChange(value: boolean | undefined) {
if (value === undefined) return
message.info(t('pages.settings.system.needRestart'))
saveConfig({ [configPaths.settings.isDisableGPU]: value })
}
async function initData() {
const config = (await getConfig<IConfig>()) || ({} as IConfig)
const settings = config.settings || {}