feat(config): update page layout

This commit is contained in:
kunish 2023-09-17 00:05:15 +08:00
parent 2be357e73c
commit 95200a56b8
No known key found for this signature in database
GPG Key ID: 647A12B4F782C430
3 changed files with 32 additions and 14 deletions

View File

@ -91,4 +91,7 @@ export default {
flushFakeIPData: 'Flush Fake-IP Data',
tagClientSourceIPWithName: 'Tag Client Source IP With Name',
tag: 'Tag',
coreConfig: 'Core Config',
xdConfig: 'XD Config',
version: 'Version',
}

View File

@ -91,4 +91,7 @@ export default {
flushFakeIPData: '清空 Fake-IP 数据',
tagClientSourceIPWithName: '为客户端源 IP 地址添加名称标记',
tag: '标记',
coreConfig: '核心配置',
xdConfig: 'XD 配置',
version: '版本',
}

View File

@ -251,7 +251,19 @@ const ConfigForXd = () => {
const [t, { locale }] = useI18n()
return (
<div class="grid grid-cols-2 gap-4">
<div class="grid grid-cols-2 place-items-center gap-4">
<div class="col-span-2">
<Button
onClick={() => {
const curLocale = locale()
locale(curLocale === LANG.EN ? LANG.ZH : LANG.EN)
}}
>
{t('switchLanguage')}
</Button>
</div>
<div class="flex flex-col gap-4">
<div>
<ConfigTitle>{t('autoSwitchTheme')}</ConfigTitle>
@ -313,18 +325,6 @@ const ConfigForXd = () => {
onChange={(e) => setUseTwemoji(e.target.checked)}
/>
</div>
<div>
<Button
onClick={() => {
const curLocale = locale()
locale(curLocale === LANG.EN ? LANG.ZH : LANG.EN)
}}
>
{t('switchLanguage')}
</Button>
</div>
</div>
)
}
@ -339,7 +339,7 @@ const Versions = () => {
})
return (
<div class="flex gap-4">
<div class="flex items-center justify-center gap-4">
<kbd class="kbd">{import.meta.env.version}</kbd>
<kbd class="kbd">{backendVersion()}</kbd>
</div>
@ -347,12 +347,24 @@ const Versions = () => {
}
export default () => {
const [t] = useI18n()
return (
<div class="mx-auto flex max-w-screen-md flex-col gap-4">
<ConfigTitle withDivider>{t('dnsQuery')}</ConfigTitle>
<DNSQueryForm />
<ConfigTitle withDivider>{t('coreConfig')}</ConfigTitle>
<ConfigForm />
<ConfigTitle withDivider>{t('xdConfig')}</ConfigTitle>
<ConfigForXd />
<ConfigTitle withDivider>{t('version')}</ConfigTitle>
<Versions />
</div>
)