优化设置页面,删除冗余选项

This commit is contained in:
jingrow 2025-11-02 01:12:44 +08:00
parent fe837d2f6d
commit 624c836d7b

View File

@ -1,32 +1,7 @@
<template>
<div class="settings-page">
<div class="page-header">
<n-space justify="space-between" align="center">
<div>
<h1 class="page-title">{{ t('Settings') }}</h1>
</div>
<n-space v-if="isAdmin">
<n-button type="default" @click="() => loadEnvironmentConfig()" :loading="envConfigLoading">
<template #icon>
<n-icon><Icon icon="tabler:refresh" /></n-icon>
</template>
</n-button>
<n-button type="primary" class="save-btn-brand" :loading="envConfigSaving" @click="saveEnvironmentConfig">
<template #icon>
<n-icon><Icon icon="tabler:check" /></n-icon>
</template>
{{ t('Save') }}
</n-button>
</n-space>
<n-space v-else>
<n-button type="primary" class="save-btn-brand" @click="saveSystemSettings">
<template #icon>
<n-icon><Icon icon="tabler:check" /></n-icon>
</template>
{{ t('Save') }}
</n-button>
</n-space>
</n-space>
<h1 class="page-title">{{ t('Settings') }}</h1>
</div>
<n-grid :cols="2" :x-gap="24" :y-gap="24">
@ -37,18 +12,6 @@
<n-form-item :label="t('App Name')">
<n-input v-model:value="systemSettings.appName" :placeholder="t('Enter app name')" />
</n-form-item>
<n-form-item label="Jingrow API URL">
<n-input v-model:value="systemSettings.jingrowApiUrl" />
</n-form-item>
<n-form-item :label="t('API Key')">
<n-input v-model:value="systemSettings.apiKey" type="password" show-password-on="click" />
</n-form-item>
<n-form-item :label="t('API Secret')">
<n-input v-model:value="systemSettings.apiSecret" type="password" show-password-on="click" />
</n-form-item>
<n-form-item :label="t('Timeout')">
<n-input-number v-model:value="systemSettings.timeout" :min="5" :max="300" />
</n-form-item>
<n-form-item :label="t('Interface Language')">
<n-select
v-model:value="systemSettings.language"
@ -74,6 +37,16 @@
/>
</n-form-item>
</n-form>
<template #footer>
<n-space justify="start">
<n-button type="primary" class="save-btn-brand" @click="saveSystemSettings">
<template #icon>
<n-icon><Icon icon="tabler:check" /></n-icon>
</template>
{{ t('Save') }}
</n-button>
</n-space>
</template>
</n-card>
</n-grid-item>
@ -184,6 +157,22 @@
</n-collapse-item>
</n-collapse>
</n-form>
<template #footer>
<n-space justify="start">
<n-button type="default" @click="() => loadEnvironmentConfig()" :loading="envConfigLoading">
<template #icon>
<n-icon><Icon icon="tabler:refresh" /></n-icon>
</template>
{{ t('Refresh') }}
</n-button>
<n-button type="primary" class="save-btn-brand" :loading="envConfigSaving" @click="saveEnvironmentConfig">
<template #icon>
<n-icon><Icon icon="tabler:check" /></n-icon>
</template>
{{ t('Save') }}
</n-button>
</n-space>
</template>
</n-card>
</n-grid-item>
</n-grid>
@ -236,10 +225,6 @@ const envConfigSaving = ref(false)
const systemSettings = reactive({
appName: localStorage.getItem('appName') || 'Jingrow',
jingrowApiUrl: (import.meta as any).env.VITE_JINGROW_SERVER_URL || '',
apiKey: (import.meta as any).env.VITE_JINGROW_API_KEY || '',
apiSecret: (import.meta as any).env.VITE_JINGROW_API_SECRET || '',
timeout: 30,
language: getCurrentLocale(),
itemsPerPage: parseInt(localStorage.getItem('itemsPerPage') || '10'),
timezone: localStorage.getItem('timezone') || 'Asia/Shanghai'
@ -262,10 +247,7 @@ const pageSizeOptions = [
//
const timezoneOptions = [
{ label: 'Asia/Shanghai (中国标准时间)', value: 'Asia/Shanghai' },
{ label: 'Asia/Tokyo (日本标准时间)', value: 'Asia/Tokyo' },
{ label: 'Asia/Seoul (韩国标准时间)', value: 'Asia/Seoul' },
{ label: 'Asia/Hong_Kong (香港时间)', value: 'Asia/Hong_Kong' },
{ label: 'Asia/Taipei (台北时间)', value: 'Asia/Taipei' },
{ label: 'Asia/Hong_Kong (中国香港时间)', value: 'Asia/Hong_Kong' },
{ label: 'Asia/Singapore (新加坡时间)', value: 'Asia/Singapore' },
{ label: 'UTC (协调世界时)', value: 'UTC' },
{ label: 'America/New_York (美国东部时间)', value: 'America/New_York' },