✨ 优化 2026 前端无障碍与响应式体验
完善 2026 主题的移动端与桌面端交互体验,修复多项可访问性和信息展示问题。 - 允许浏览器缩放,补充焦点样式、按钮名称、表单标签和对话框键盘焦点管理\n- 支持 reduced-motion,扩大公共页、后台导航、记录列表和分页控件的触控区域\n- 优化系统设置分区导航、密码显示、字段语义和底部粘性保存栏\n- 压缩移动文件列表操作区,改善桌面表格滚动可达性和统计值截断\n- 优化仪表盘指标、趋势摘要、进度条语义及中英文文案
This commit is contained in:
1 parent
2f020f5d42
commit
b60c003ec2
29 files changed
+638
-312
No files matched your search
@@ -82,7 +82,7 @@
|
||||
</button>
|
||||
</form>
|
||||
<div class="mt-6 text-center">
|
||||
<router-link to="/" class="text-indigo-400 hover:text-indigo-300 transition duration-300">
|
||||
<router-link to="/" class="inline-flex min-h-11 items-center rounded-lg px-3 text-[#3f6a77] transition duration-200 hover:bg-[#dcebed] hover:text-[#315c69] dark:text-[#b8d4dc] dark:hover:bg-[#294047]">
|
||||
{{ t('send.needRetrieveFile') }}
|
||||
</router-link>
|
||||
</div>
|
||||
@@ -100,8 +100,9 @@
|
||||
{{ t('send.secureEncryption') }}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
@click="toggleDrawer"
|
||||
class="text-sm hover:text-indigo-300 transition duration-300 flex items-center"
|
||||
class="flex min-h-11 items-center rounded-lg px-2 text-sm transition duration-200 hover:bg-indigo-50 dark:hover:bg-gray-700"
|
||||
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-600']"
|
||||
>
|
||||
{{ t('send.sendRecords') }}
|
||||
|
||||
@@ -236,18 +236,18 @@
|
||||
<div class="mb-5 flex flex-col gap-4">
|
||||
<div class="flex min-w-0 flex-col gap-3 xl:flex-row xl:items-start xl:justify-between">
|
||||
<div class="min-w-0">
|
||||
<h3 class="text-lg font-semibold" :class="[primaryTextClass]">下载/上传趋势</h3>
|
||||
<h3 class="text-lg font-semibold" :class="[primaryTextClass]">{{ t('admin.dashboard.trend.title') }}</h3>
|
||||
<p class="break-words text-sm leading-5" :class="[mutedTextClass]">
|
||||
{{ analyticsSummaryText }}
|
||||
</p>
|
||||
<p class="mt-1 text-xs sm:hidden" :class="[mutedTextClass]">轻触或滑动查看数据;拖动底部日期轴平移图表</p>
|
||||
<p class="mt-1 text-xs sm:hidden" :class="[mutedTextClass]">{{ t('admin.dashboard.trend.mobileHint') }}</p>
|
||||
</div>
|
||||
<div class="flex shrink-0 flex-wrap items-center justify-end gap-2 xl:flex-nowrap">
|
||||
<div class="analytics-date-range flex min-w-0 items-center justify-center gap-1.5 sm:gap-2">
|
||||
<NativeDateSelect
|
||||
v-model="analyticsStart"
|
||||
:field-class="fieldClass"
|
||||
aria-label="开始日期"
|
||||
:aria-label="t('admin.dashboard.trend.startDate')"
|
||||
@change="fetchAnalyticsData"
|
||||
/>
|
||||
<span
|
||||
@@ -259,7 +259,7 @@
|
||||
<NativeDateSelect
|
||||
v-model="analyticsEnd"
|
||||
:field-class="fieldClass"
|
||||
aria-label="结束日期"
|
||||
:aria-label="t('admin.dashboard.trend.endDate')"
|
||||
@change="fetchAnalyticsData"
|
||||
/>
|
||||
</div>
|
||||
@@ -270,7 +270,7 @@
|
||||
class="h-9 min-w-16"
|
||||
@click="trendCanvas?.zoom(0.75)"
|
||||
>
|
||||
放大
|
||||
{{ t('admin.dashboard.trend.zoomIn') }}
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
variant="outline"
|
||||
@@ -278,7 +278,7 @@
|
||||
class="h-9 min-w-16"
|
||||
@click="trendCanvas?.zoom(1.33)"
|
||||
>
|
||||
缩小
|
||||
{{ t('admin.dashboard.trend.zoomOut') }}
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
variant="outline"
|
||||
@@ -286,7 +286,7 @@
|
||||
class="h-9 min-w-16"
|
||||
@click="trendCanvas?.resetWindow()"
|
||||
>
|
||||
重置
|
||||
{{ t('admin.dashboard.trend.reset') }}
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
@@ -317,15 +317,15 @@
|
||||
>
|
||||
<div class="mb-5 flex items-center justify-between">
|
||||
<div>
|
||||
<h3 class="text-lg font-semibold" :class="[primaryTextClass]">热门下载 Top 5</h3>
|
||||
<p class="text-sm" :class="[mutedTextClass]">统计当前日期范围内的下载次数和流量</p>
|
||||
<h3 class="text-lg font-semibold" :class="[primaryTextClass]">{{ t('admin.dashboard.topDownloads.title') }}</h3>
|
||||
<p class="text-sm" :class="[mutedTextClass]">{{ t('admin.dashboard.topDownloads.description') }}</p>
|
||||
</div>
|
||||
<DownloadCloudIcon
|
||||
class="h-5 w-5"
|
||||
:class="[isDarkMode ? 'text-[#b8d4dc]' : 'text-[#5f8796]']"
|
||||
/>
|
||||
</div>
|
||||
<div class="overflow-x-auto">
|
||||
<div class="overflow-x-auto" tabindex="0" role="region" :aria-label="t('admin.dashboard.topDownloads.title')">
|
||||
<table
|
||||
class="min-w-full divide-y"
|
||||
:class="[isDarkMode ? 'divide-gray-700' : 'divide-gray-200']"
|
||||
@@ -336,32 +336,32 @@
|
||||
class="px-4 py-3 text-left text-xs font-semibold uppercase"
|
||||
:class="[mutedTextClass]"
|
||||
>
|
||||
文件
|
||||
{{ t('admin.dashboard.topDownloads.file') }}
|
||||
</th>
|
||||
<th
|
||||
class="px-4 py-3 text-left text-xs font-semibold uppercase"
|
||||
:class="[mutedTextClass]"
|
||||
>
|
||||
下载
|
||||
{{ t('admin.dashboard.topDownloads.downloads') }}
|
||||
</th>
|
||||
<th
|
||||
class="px-4 py-3 text-left text-xs font-semibold uppercase"
|
||||
:class="[mutedTextClass]"
|
||||
>
|
||||
流量
|
||||
{{ t('admin.dashboard.topDownloads.traffic') }}
|
||||
</th>
|
||||
<th
|
||||
class="px-4 py-3 text-left text-xs font-semibold uppercase"
|
||||
:class="[mutedTextClass]"
|
||||
>
|
||||
状态
|
||||
{{ t('admin.dashboard.topDownloads.status') }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y" :class="[isDarkMode ? 'divide-gray-700' : 'divide-gray-100']">
|
||||
<tr v-if="analyticsTopFiles.length === 0">
|
||||
<td colspan="4" class="px-4 py-8 text-center text-sm" :class="[mutedTextClass]">
|
||||
暂无下载记录
|
||||
{{ t('admin.dashboard.topDownloads.empty') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
@@ -383,7 +383,7 @@
|
||||
{{ formatBytes(file.download_traffic) }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-sm" :class="[mutedTextClass]">
|
||||
{{ file.current ? '现存' : '历史' }}
|
||||
{{ file.current ? t('admin.dashboard.topDownloads.current') : t('admin.dashboard.topDownloads.history') }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -497,7 +497,7 @@ const analyticsEnd = ref(today())
|
||||
const analyticsData = ref<AnalyticsData | null>(null)
|
||||
const analyticsError = ref('')
|
||||
const isAnalyticsLoading = ref(false)
|
||||
const analyticsWindowText = ref('无数据')
|
||||
const analyticsWindowText = ref(t('admin.dashboard.trend.noData'))
|
||||
const analyticsDailyRows = computed(() => analyticsData.value?.daily || [])
|
||||
const analyticsTopFiles = computed<AnalyticsFileRow[]>(() => analyticsData.value?.topFiles || [])
|
||||
const analyticsUploadTrafficText = computed(() =>
|
||||
@@ -506,13 +506,14 @@ const analyticsUploadTrafficText = computed(() =>
|
||||
const analyticsDownloadTrafficText = computed(() =>
|
||||
formatBytes(analyticsData.value?.totals?.downloadTraffic || 0)
|
||||
)
|
||||
const analyticsSummaryText = computed(
|
||||
() =>
|
||||
`${analyticsWindowText.value},下载 ${analyticsData.value?.totals?.totalDownloads || 0} 次 / ${
|
||||
analyticsDownloadTrafficText.value
|
||||
},上传 ${analyticsData.value?.totals?.totalUploads || 0} 次 / ${
|
||||
analyticsUploadTrafficText.value
|
||||
}`
|
||||
const analyticsSummaryText = computed(() =>
|
||||
t('admin.dashboard.trend.summary', {
|
||||
window: analyticsWindowText.value,
|
||||
downloads: analyticsData.value?.totals?.totalDownloads || 0,
|
||||
downloadTraffic: analyticsDownloadTrafficText.value,
|
||||
uploads: analyticsData.value?.totals?.totalUploads || 0,
|
||||
uploadTraffic: analyticsUploadTrafficText.value
|
||||
})
|
||||
)
|
||||
const formatBytes = (value: number | string | undefined) => formatFileSize(Number(value || 0), 1)
|
||||
|
||||
@@ -522,7 +523,7 @@ const fetchAnalyticsData = async () => {
|
||||
try {
|
||||
analyticsData.value = await fetchAnalytics(analyticsStart.value, analyticsEnd.value)
|
||||
} catch (error) {
|
||||
analyticsError.value = error instanceof Error ? error.message : '统计加载失败'
|
||||
analyticsError.value = error instanceof Error ? error.message : t('admin.dashboard.trend.loadFailed')
|
||||
} finally {
|
||||
isAnalyticsLoading.value = false
|
||||
}
|
||||
@@ -641,10 +642,17 @@ const MetricProgress = defineComponent({
|
||||
h('span', { class: 'line-clamp-1 text-gray-500 dark:text-gray-400' }, props.label),
|
||||
h('span', { class: 'font-medium tabular-nums text-gray-900 dark:text-white' }, `${props.value}%`)
|
||||
]),
|
||||
h('div', { class: 'h-2 overflow-hidden rounded-full bg-gray-100 dark:bg-gray-700' }, [
|
||||
h('div', {
|
||||
class: 'h-2 overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700',
|
||||
role: 'progressbar',
|
||||
'aria-label': props.label,
|
||||
'aria-valuemin': 0,
|
||||
'aria-valuemax': 100,
|
||||
'aria-valuenow': props.value
|
||||
}, [
|
||||
h('div', {
|
||||
class: ['h-full rounded-full', toneClass.value],
|
||||
style: { width: `${props.value}%` }
|
||||
style: { width: `${Math.max(0, Math.min(100, props.value))}%` }
|
||||
})
|
||||
]),
|
||||
h('p', { class: 'mt-2 hidden text-sm text-gray-500 sm:block dark:text-gray-400' }, props.detail)
|
||||
@@ -669,7 +677,7 @@ const PolicyRow = defineComponent({
|
||||
},
|
||||
[
|
||||
h('span', { class: 'text-sm text-gray-500 dark:text-gray-400' }, props.label),
|
||||
h('span', { class: 'text-sm font-medium text-gray-900 dark:text-white' }, props.value)
|
||||
h('span', { class: 'min-w-0 break-words text-right text-sm font-medium text-gray-900 dark:text-white' }, props.value)
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<div>
|
||||
<p class="text-xs sm:text-sm" :class="[mutedTextClass]">{{ card.label }}</p>
|
||||
<p class="mt-1.5 truncate text-xl font-semibold tabular-nums sm:mt-2 sm:text-2xl" :class="[primaryTextClass]">
|
||||
<p class="mt-1.5 break-words text-xl font-semibold leading-tight tabular-nums sm:mt-2 sm:text-2xl" :title="String(card.value)" :class="[primaryTextClass]">
|
||||
{{ card.value }}
|
||||
</p>
|
||||
</div>
|
||||
@@ -58,7 +58,7 @@
|
||||
</template>
|
||||
{{ t('fileManage.resetFilters') }}
|
||||
</BaseButton>
|
||||
<BaseButton variant="secondary" @click="isFilterPanelOpen = !isFilterPanelOpen">
|
||||
<BaseButton variant="secondary" :aria-expanded="filterBodyVisible" aria-controls="file-filter-panel" @click="isFilterPanelOpen = !isFilterPanelOpen">
|
||||
<template #icon>
|
||||
<FilterIcon class="mr-2 h-4 w-4" />
|
||||
</template>
|
||||
@@ -68,7 +68,7 @@
|
||||
</div>
|
||||
|
||||
<Transition name="fcb-expand-120">
|
||||
<div v-if="filterBodyVisible" class="fcb-expand-content mt-4 grid gap-4">
|
||||
<div id="file-filter-panel" v-if="filterBodyVisible" class="fcb-expand-content mt-4 grid gap-4">
|
||||
<div class="flex flex-col gap-3 lg:flex-row lg:items-center">
|
||||
<label class="min-w-0 flex-1">
|
||||
<span class="sr-only">{{ t('fileManage.searchPlaceholder') }}</span>
|
||||
@@ -331,15 +331,9 @@
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-3 grid grid-cols-3 gap-2 pl-14">
|
||||
<button type="button" class="flex min-h-11 items-center justify-center rounded-lg border text-sm font-medium" :class="detailActionClass" @click="openFileDetail(file)">
|
||||
<FileTextIcon class="mr-1.5 h-4 w-4" />{{ t('fileManage.detail') }}
|
||||
</button>
|
||||
<button type="button" class="flex min-h-11 items-center justify-center rounded-lg border text-sm font-medium" :class="detailActionClass" :disabled="Boolean(downloadingFileId)" @click="downloadFile(file)">
|
||||
<DownloadIcon class="mr-1.5 h-4 w-4" />{{ file.isTextFile ? t('fileManage.exportText') : t('fileManage.downloadFile') }}
|
||||
</button>
|
||||
<button type="button" class="flex min-h-11 items-center justify-center rounded-lg border text-sm font-medium" :class="detailActionClass" @click="openEditModal(file)">
|
||||
<PencilIcon class="mr-1.5 h-4 w-4" />{{ t('common.edit') }}
|
||||
<div class="mt-3 pl-14">
|
||||
<button type="button" class="flex min-h-11 w-full items-center justify-center rounded-lg border text-sm font-medium" :class="detailActionClass" @click="openFileDetail(file)">
|
||||
<FileTextIcon class="mr-1.5 h-4 w-4" aria-hidden="true" />{{ t('fileManage.detail') }}
|
||||
</button>
|
||||
</div>
|
||||
</article>
|
||||
@@ -357,7 +351,7 @@
|
||||
</section>
|
||||
|
||||
<div class="hidden md:block">
|
||||
<DataTable :title="t('fileManage.allFiles')" :headers="fileTableHeaders">
|
||||
<DataTable :title="t('fileManage.allFiles')" :headers="fileTableHeaders" table-class="min-w-[1120px]">
|
||||
<template #actions>
|
||||
<BaseButton variant="secondary" :loading="isLoading" @click="refreshFileList">
|
||||
<template #icon>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { inject, onMounted } from 'vue'
|
||||
import { inject, onMounted, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { RefreshCwIcon, SaveIcon } from 'lucide-vue-next'
|
||||
import { EyeIcon, EyeOffIcon, RefreshCwIcon, SaveIcon } from 'lucide-vue-next'
|
||||
import BaseButton from '@/components/common/BaseButton.vue'
|
||||
import SettingNumberInput from '@/components/common/SettingNumberInput.vue'
|
||||
import SettingSwitch from '@/components/common/SettingSwitch.vue'
|
||||
@@ -9,6 +9,7 @@ import { useSystemConfig } from '@/composables'
|
||||
|
||||
const isDarkMode = inject('isDarkMode')
|
||||
const { t } = useI18n()
|
||||
const showAdminPassword = ref(false)
|
||||
const {
|
||||
config,
|
||||
isRefreshing,
|
||||
@@ -29,7 +30,7 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="p-6">
|
||||
<div class="p-4 pb-28 sm:p-6 sm:pb-28">
|
||||
<div
|
||||
class="mb-6 flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between"
|
||||
>
|
||||
@@ -68,8 +69,28 @@ onMounted(() => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav
|
||||
class="mb-4 flex gap-2 overflow-x-auto pb-2"
|
||||
:aria-label="t('manage.settings.sectionNavigation')"
|
||||
>
|
||||
<a
|
||||
v-for="section in [
|
||||
['general', t('manage.settings.basicSettings')],
|
||||
['storage', t('manage.settings.storageSettings')],
|
||||
['upload', t('manage.settings.uploadLimits')],
|
||||
['access', t('manage.settings.errorLimits')]
|
||||
]"
|
||||
:key="section[0]"
|
||||
:href="`#settings-${section[0]}`"
|
||||
class="inline-flex min-h-11 shrink-0 items-center rounded-full border px-4 text-sm font-medium"
|
||||
:class="isDarkMode ? 'border-[#40545c] bg-[#263941] text-[#d8e3e5]' : 'border-[#c8d8dc] bg-[#edf4f5] text-[#415d66]'"
|
||||
>
|
||||
{{ section[1] }}
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
<div
|
||||
class="theme-2026-card theme-2026-card-hover space-y-8 rounded-[30px] border p-6 shadow-md transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg"
|
||||
class="theme-2026-card theme-2026-card-hover mx-auto max-w-6xl space-y-8 rounded-[24px] border p-4 shadow-md transition-all duration-200 hover:shadow-lg sm:rounded-[30px] sm:p-6"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'border-[#40545c] bg-[#202f36]/90 hover:border-[#7199a8] hover:bg-[#263941] hover:shadow-black/25'
|
||||
@@ -77,7 +98,7 @@ onMounted(() => {
|
||||
]"
|
||||
>
|
||||
<!-- 基本设置 -->
|
||||
<section class="space-y-4">
|
||||
<section id="settings-general" class="scroll-mt-4 space-y-4">
|
||||
<h3 class="text-lg font-medium mb-4" :class="[isDarkMode ? 'text-white' : 'text-gray-800']">
|
||||
{{ t('admin.settings.basicSettings') }}
|
||||
</h3>
|
||||
@@ -92,8 +113,10 @@ onMounted(() => {
|
||||
{{ t('admin.settings.siteName') }}
|
||||
</label>
|
||||
<input
|
||||
id="settings-site-name"
|
||||
type="text"
|
||||
v-model="config.name"
|
||||
:aria-label="t('admin.settings.siteName')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -111,8 +134,10 @@ onMounted(() => {
|
||||
{{ t('admin.settings.websiteDescription') }}
|
||||
</label>
|
||||
<input
|
||||
id="settings-description"
|
||||
type="text"
|
||||
v-model="config.description"
|
||||
:aria-label="t('admin.settings.websiteDescription')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -131,24 +156,35 @@ onMounted(() => {
|
||||
</label>
|
||||
<div class="relative">
|
||||
<input
|
||||
type="password"
|
||||
id="settings-admin-password"
|
||||
:type="showAdminPassword ? 'text' : 'password'"
|
||||
minlength="6"
|
||||
v-model="config.admin_token"
|
||||
:placeholder="t('admin.settings.passwordPlaceholder')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
autocomplete="new-password"
|
||||
aria-describedby="settings-admin-password-note"
|
||||
:aria-label="t('admin.settings.adminPassword')"
|
||||
class="w-full rounded-md border px-4 py-2.5 pr-14 shadow-sm outline-none transition-all duration-200 ease-in-out focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500'
|
||||
: 'border-gray-300 hover:border-gray-400 placeholder-gray-500'
|
||||
]"
|
||||
/>
|
||||
<div
|
||||
class="absolute inset-y-0 right-0 flex items-center pr-3 text-sm text-gray-400"
|
||||
:class="[isDarkMode ? 'text-gray-500' : 'text-gray-400']"
|
||||
<button
|
||||
type="button"
|
||||
class="absolute inset-y-0 right-1 flex w-11 items-center justify-center rounded-lg"
|
||||
:aria-label="showAdminPassword ? t('common.hidePassword') : t('common.showPassword')"
|
||||
:title="showAdminPassword ? t('common.hidePassword') : t('common.showPassword')"
|
||||
@click="showAdminPassword = !showAdminPassword"
|
||||
>
|
||||
<span class="text-xs">{{ t('admin.settings.passwordNote') }}</span>
|
||||
</div>
|
||||
<EyeOffIcon v-if="showAdminPassword" class="h-5 w-5" aria-hidden="true" />
|
||||
<EyeIcon v-else class="h-5 w-5" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
<p id="settings-admin-password-note" class="text-xs" :class="isDarkMode ? 'text-gray-300' : 'text-gray-600'">
|
||||
{{ t('admin.settings.passwordNote') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="space-y-2">
|
||||
@@ -159,8 +195,10 @@ onMounted(() => {
|
||||
{{ t('admin.settings.keywords') }}
|
||||
</label>
|
||||
<input
|
||||
id="settings-keywords"
|
||||
type="text"
|
||||
v-model="config.keywords"
|
||||
:aria-label="t('admin.settings.keywords')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -179,7 +217,9 @@ onMounted(() => {
|
||||
{{ t('manage.settings.themeSelection') }}
|
||||
</label>
|
||||
<select
|
||||
id="settings-theme"
|
||||
v-model="config.themesSelect"
|
||||
:aria-label="t('manage.settings.themeSelection')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border appearance-none bg-no-repeat bg-right focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none cursor-pointer"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -203,8 +243,10 @@ onMounted(() => {
|
||||
{{ t('manage.settings.robotsFile') }}
|
||||
</label>
|
||||
<textarea
|
||||
id="settings-robots"
|
||||
v-model="config.robotsText"
|
||||
rows="3"
|
||||
:aria-label="t('manage.settings.robotsFile')"
|
||||
rows="5"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border resize-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -227,6 +269,7 @@ onMounted(() => {
|
||||
<input
|
||||
type="text"
|
||||
v-model="config.notify_title"
|
||||
:aria-label="t('manage.settings.notificationTitle')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -245,6 +288,7 @@ onMounted(() => {
|
||||
</label>
|
||||
<textarea
|
||||
v-model="config.notify_content"
|
||||
:aria-label="t('manage.settings.notificationContent')"
|
||||
rows="3"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border resize-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
@@ -257,7 +301,7 @@ onMounted(() => {
|
||||
</div>
|
||||
|
||||
<!-- 存储设置 -->
|
||||
<div class="space-y-4">
|
||||
<div id="settings-storage" class="scroll-mt-4 space-y-4 border-t pt-8" :class="isDarkMode ? 'border-gray-700' : 'border-gray-200'">
|
||||
<h3
|
||||
class="text-lg font-medium mb-4"
|
||||
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||
@@ -276,6 +320,7 @@ onMounted(() => {
|
||||
type="text"
|
||||
:placeholder="t('manage.settings.storagePathPlaceholder')"
|
||||
v-model="config.storage_path"
|
||||
:aria-label="t('manage.settings.storagePath')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -295,6 +340,7 @@ onMounted(() => {
|
||||
</label>
|
||||
<select
|
||||
v-model="config.file_storage"
|
||||
:aria-label="t('manage.settings.storageMethod')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border appearance-none bg-no-repeat bg-right focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none cursor-pointer"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -331,6 +377,7 @@ onMounted(() => {
|
||||
type="text"
|
||||
:placeholder="t('manage.settings.webdavUrlPlaceholder')"
|
||||
v-model="config.webdav_url"
|
||||
:aria-label="'WebDAV URL'"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -351,6 +398,7 @@ onMounted(() => {
|
||||
type="text"
|
||||
:placeholder="t('manage.settings.webdavUsernamePlaceholder')"
|
||||
v-model="config.webdav_username"
|
||||
:aria-label="'WebDAV Username'"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -371,6 +419,7 @@ onMounted(() => {
|
||||
type="password"
|
||||
:placeholder="t('manage.settings.webdavPasswordPlaceholder')"
|
||||
v-model="config.webdav_password"
|
||||
:aria-label="'WebDAV Password'"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -394,6 +443,7 @@ onMounted(() => {
|
||||
<input
|
||||
type="text"
|
||||
v-model="config.s3_access_key_id"
|
||||
:aria-label="t('manage.settings.s3AccessKeyId')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -413,6 +463,7 @@ onMounted(() => {
|
||||
<input
|
||||
type="password"
|
||||
v-model="config.s3_secret_access_key"
|
||||
:aria-label="t('manage.settings.s3SecretAccessKey')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -432,6 +483,7 @@ onMounted(() => {
|
||||
<input
|
||||
type="text"
|
||||
v-model="config.s3_bucket_name"
|
||||
:aria-label="t('manage.settings.s3BucketName')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -451,6 +503,7 @@ onMounted(() => {
|
||||
<input
|
||||
type="text"
|
||||
v-model="config.s3_endpoint_url"
|
||||
:aria-label="t('manage.settings.s3EndpointUrl')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -470,6 +523,7 @@ onMounted(() => {
|
||||
<input
|
||||
type="text"
|
||||
v-model="config.s3_region_name"
|
||||
:aria-label="t('manage.settings.s3RegionName')"
|
||||
:placeholder="t('manage.settings.autoPlaceholder')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
@@ -489,6 +543,7 @@ onMounted(() => {
|
||||
</label>
|
||||
<select
|
||||
v-model="config.s3_signature_version"
|
||||
:aria-label="t('manage.settings.s3SignatureVersion')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -511,6 +566,7 @@ onMounted(() => {
|
||||
<input
|
||||
type="text"
|
||||
v-model="config.s3_hostname"
|
||||
:aria-label="t('manage.settings.s3Hostname')"
|
||||
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -541,7 +597,7 @@ onMounted(() => {
|
||||
</div>
|
||||
|
||||
<!-- 上传限制 -->
|
||||
<div class="mt-8">
|
||||
<div id="settings-upload" class="scroll-mt-4 border-t pt-8" :class="isDarkMode ? 'border-gray-700' : 'border-gray-200'">
|
||||
<h3
|
||||
class="text-lg font-medium mb-4"
|
||||
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||
@@ -573,6 +629,7 @@ onMounted(() => {
|
||||
<input
|
||||
type="number"
|
||||
v-model="fileSize"
|
||||
:aria-label="t('manage.settings.fileSizeLimit')"
|
||||
class="w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -582,6 +639,7 @@ onMounted(() => {
|
||||
/>
|
||||
<select
|
||||
v-model="sizeUnit"
|
||||
:aria-label="t('manage.settings.fileSizeUnit')"
|
||||
class="rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -644,6 +702,7 @@ onMounted(() => {
|
||||
<input
|
||||
type="number"
|
||||
v-model="saveTime"
|
||||
:aria-label="t('manage.settings.maxSaveTime')"
|
||||
class="w-24 rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -653,6 +712,7 @@ onMounted(() => {
|
||||
/>
|
||||
<select
|
||||
v-model="saveTimeUnit"
|
||||
:aria-label="t('manage.settings.timeUnit')"
|
||||
class="rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
|
||||
:class="[
|
||||
isDarkMode
|
||||
@@ -679,7 +739,7 @@ onMounted(() => {
|
||||
</div>
|
||||
|
||||
<!-- 错误限制 -->
|
||||
<div class="mt-8">
|
||||
<div id="settings-access" class="scroll-mt-4 border-t pt-8" :class="isDarkMode ? 'border-gray-700' : 'border-gray-200'">
|
||||
<h3
|
||||
class="text-lg font-medium mb-4"
|
||||
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
|
||||
@@ -703,6 +763,33 @@ onMounted(() => {
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="fixed inset-x-0 bottom-0 z-40 border-t px-4 py-3 backdrop-blur-xl lg:left-64"
|
||||
:class="isDarkMode ? 'border-[#31454d] bg-[#17252b]/95' : 'border-[#c8d7da] bg-[#f2f6f5]/95'"
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
>
|
||||
<div class="mx-auto flex max-w-6xl flex-wrap items-center justify-between gap-3">
|
||||
<p class="text-sm font-medium" :class="isDirty ? 'text-amber-600 dark:text-amber-300' : isDarkMode ? 'text-gray-300' : 'text-[#415d66]'">
|
||||
{{ isDirty ? t('manage.settings.unsavedChanges') : t('manage.settings.allChangesSaved') }}
|
||||
</p>
|
||||
<div class="flex items-center gap-2">
|
||||
<BaseButton
|
||||
variant="secondary"
|
||||
:loading="isRefreshing"
|
||||
:disabled="isSaving || isDirty"
|
||||
@click="refreshConfig"
|
||||
>
|
||||
{{ t('manage.settings.reloadSaved') }}
|
||||
</BaseButton>
|
||||
<BaseButton :loading="isSaving" :disabled="!isDirty || isRefreshing" @click="submitConfig">
|
||||
<template #icon><SaveIcon class="mr-2 h-4 w-4" /></template>
|
||||
{{ isSaving ? t('manage.settings.saving') : t('manage.settings.saveChanges') }}
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
|
||||
Reference in new issue
Block a user