优化设置页面,删除冗余选项
This commit is contained in:
parent
fe837d2f6d
commit
c5acab73ec
@ -1,32 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="settings-page">
|
<div class="settings-page">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<n-space justify="space-between" align="center">
|
<h1 class="page-title">{{ t('Settings') }}</h1>
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<n-grid :cols="2" :x-gap="24" :y-gap="24">
|
<n-grid :cols="2" :x-gap="24" :y-gap="24">
|
||||||
@ -37,15 +12,6 @@
|
|||||||
<n-form-item :label="t('App Name')">
|
<n-form-item :label="t('App Name')">
|
||||||
<n-input v-model:value="systemSettings.appName" :placeholder="t('Enter app name')" />
|
<n-input v-model:value="systemSettings.appName" :placeholder="t('Enter app name')" />
|
||||||
</n-form-item>
|
</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-form-item :label="t('Timeout')">
|
||||||
<n-input-number v-model:value="systemSettings.timeout" :min="5" :max="300" />
|
<n-input-number v-model:value="systemSettings.timeout" :min="5" :max="300" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
@ -74,6 +40,16 @@
|
|||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</n-form>
|
</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-card>
|
||||||
</n-grid-item>
|
</n-grid-item>
|
||||||
|
|
||||||
@ -184,6 +160,22 @@
|
|||||||
</n-collapse-item>
|
</n-collapse-item>
|
||||||
</n-collapse>
|
</n-collapse>
|
||||||
</n-form>
|
</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-card>
|
||||||
</n-grid-item>
|
</n-grid-item>
|
||||||
</n-grid>
|
</n-grid>
|
||||||
@ -236,9 +228,6 @@ const envConfigSaving = ref(false)
|
|||||||
|
|
||||||
const systemSettings = reactive({
|
const systemSettings = reactive({
|
||||||
appName: localStorage.getItem('appName') || 'Jingrow',
|
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,
|
timeout: 30,
|
||||||
language: getCurrentLocale(),
|
language: getCurrentLocale(),
|
||||||
itemsPerPage: parseInt(localStorage.getItem('itemsPerPage') || '10'),
|
itemsPerPage: parseInt(localStorage.getItem('itemsPerPage') || '10'),
|
||||||
@ -262,10 +251,7 @@ const pageSizeOptions = [
|
|||||||
// 时区选项
|
// 时区选项
|
||||||
const timezoneOptions = [
|
const timezoneOptions = [
|
||||||
{ label: 'Asia/Shanghai (中国标准时间)', value: 'Asia/Shanghai' },
|
{ label: 'Asia/Shanghai (中国标准时间)', value: 'Asia/Shanghai' },
|
||||||
{ label: 'Asia/Tokyo (日本标准时间)', value: 'Asia/Tokyo' },
|
{ label: 'Asia/Hong_Kong (中国香港时间)', value: 'Asia/Hong_Kong' },
|
||||||
{ label: 'Asia/Seoul (韩国标准时间)', value: 'Asia/Seoul' },
|
|
||||||
{ label: 'Asia/Hong_Kong (香港时间)', value: 'Asia/Hong_Kong' },
|
|
||||||
{ label: 'Asia/Taipei (台北时间)', value: 'Asia/Taipei' },
|
|
||||||
{ label: 'Asia/Singapore (新加坡时间)', value: 'Asia/Singapore' },
|
{ label: 'Asia/Singapore (新加坡时间)', value: 'Asia/Singapore' },
|
||||||
{ label: 'UTC (协调世界时)', value: 'UTC' },
|
{ label: 'UTC (协调世界时)', value: 'UTC' },
|
||||||
{ label: 'America/New_York (美国东部时间)', value: 'America/New_York' },
|
{ label: 'America/New_York (美国东部时间)', value: 'America/New_York' },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user