chore: v0.1.6 UI优化 - 两列网格布局、暗色适配、系统配置浮窗保存、退出登录统一到侧边栏
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,56 +1,75 @@
|
||||
<template>
|
||||
<div class="admin-layout">
|
||||
<el-menu
|
||||
:default-active="activeMenu"
|
||||
class="admin-menu"
|
||||
@select="handleMenuSelect"
|
||||
>
|
||||
<div class="menu-header">
|
||||
<h2>{{ siteName || 'CloudSearch' }}</h2>
|
||||
<p>管理后台</p>
|
||||
<aside class="admin-sidebar">
|
||||
<div class="sidebar-brand">
|
||||
<div class="sidebar-logo">☁️</div>
|
||||
<div class="sidebar-brand-text">
|
||||
<h2>{{ siteName || 'CloudSearch' }}</h2>
|
||||
<p>管理控制台</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-menu-item index="dashboard">
|
||||
<el-icon><DataBoard /></el-icon>
|
||||
<span>仪表盘</span>
|
||||
</el-menu-item>
|
||||
<el-sub-menu index="cloud-configs">
|
||||
<template #title>
|
||||
<el-icon><Connection /></el-icon>
|
||||
<span>网盘配置</span>
|
||||
</template>
|
||||
<el-menu-item index="cloud-configs-toggle">网盘设置及授权</el-menu-item>
|
||||
<el-menu-item index="cloud-configs-cleanup">存储清理</el-menu-item>
|
||||
</el-sub-menu>
|
||||
<el-sub-menu index="system">
|
||||
<template #title>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span>系统配置</span>
|
||||
</template>
|
||||
<el-menu-item index="sys-site">网站设置</el-menu-item>
|
||||
<el-menu-item index="sys-services">外部服务和缓存</el-menu-item>
|
||||
<el-menu-item index="sys-strategy">性能配置</el-menu-item>
|
||||
<el-menu-item index="sys-password">修改管理员密码</el-menu-item>
|
||||
</el-sub-menu>
|
||||
<el-menu-item index="save-records">
|
||||
<el-icon><DocumentCopy /></el-icon>
|
||||
<span>转存日志</span>
|
||||
</el-menu-item>
|
||||
<div class="version-footer">T {{ appVersion }}</div>
|
||||
<el-menu-item index="logout">
|
||||
<el-icon><SwitchButton /></el-icon>
|
||||
<span>退出登录</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
|
||||
<el-menu
|
||||
:default-active="activeMenu"
|
||||
class="sidebar-menu"
|
||||
@select="handleMenuSelect"
|
||||
>
|
||||
<el-menu-item index="dashboard">
|
||||
<el-icon><DataBoard /></el-icon>
|
||||
<span>仪表盘</span>
|
||||
</el-menu-item>
|
||||
|
||||
<el-sub-menu index="cloud-configs">
|
||||
<template #title>
|
||||
<el-icon><Connection /></el-icon>
|
||||
<span>网盘管理</span>
|
||||
</template>
|
||||
<el-menu-item index="cloud-configs-toggle">📋 设置及授权</el-menu-item>
|
||||
<el-menu-item index="cloud-configs-cleanup">🧹 存储清理</el-menu-item>
|
||||
</el-sub-menu>
|
||||
|
||||
<el-sub-menu index="system">
|
||||
<template #title>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span>系统设置</span>
|
||||
</template>
|
||||
<el-menu-item index="sys-site">🌐 网站设置</el-menu-item>
|
||||
<el-menu-item index="sys-services">🔗 外部服务 & 缓存</el-menu-item>
|
||||
<el-menu-item index="sys-strategy">⚡ 性能配置</el-menu-item>
|
||||
<el-menu-item index="sys-password">🔑 修改密码</el-menu-item>
|
||||
</el-sub-menu>
|
||||
|
||||
<el-menu-item index="save-records">
|
||||
<el-icon><DocumentCopy /></el-icon>
|
||||
<span>转存日志</span>
|
||||
</el-menu-item>
|
||||
|
||||
<div class="sidebar-spacer"></div>
|
||||
|
||||
<div class="sidebar-version">v{{ appVersion }}</div>
|
||||
|
||||
<el-menu-item index="logout">
|
||||
<el-icon><SwitchButton /></el-icon>
|
||||
<span>退出登录</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</aside>
|
||||
|
||||
<div class="admin-content">
|
||||
<div class="content-header">
|
||||
<h2>{{ pageTitle }}</h2>
|
||||
<el-button text @click="goBackHome">返回前台</el-button>
|
||||
</div>
|
||||
<div class="content-body">
|
||||
<header class="content-header">
|
||||
<div class="content-breadcrumb">
|
||||
<span class="breadcrumb-current">{{ pageTitle }}</span>
|
||||
</div>
|
||||
<div class="content-actions">
|
||||
<el-button text size="small" @click="goBackHome">
|
||||
<el-icon><ArrowLeft /></el-icon>
|
||||
返回前台
|
||||
</el-button>
|
||||
</div>
|
||||
</header>
|
||||
<main class="content-body">
|
||||
<router-view />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -58,7 +77,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { DataBoard, Connection, Setting, SwitchButton, DocumentCopy } from '@element-plus/icons-vue'
|
||||
import { DataBoard, Connection, Setting, SwitchButton, DocumentCopy, ArrowLeft } from '@element-plus/icons-vue'
|
||||
import { getSiteConfig } from '../../api'
|
||||
|
||||
const router = useRouter()
|
||||
@@ -129,14 +148,163 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.admin-menu .menu-header { padding: 16px 20px 8px; text-align: center; border-bottom: 1px solid var(--el-border-color-light); }
|
||||
.admin-menu .menu-header h2 { margin: 0; font-size: 16px; color: var(--el-color-primary); }
|
||||
.admin-menu .menu-header p { margin: 4px 0 0; font-size: 12px; color: var(--el-text-color-secondary); }
|
||||
.version-footer { padding: 8px; text-align: center; font-size: 11px; color: var(--el-text-color-placeholder); border-top: 1px solid var(--el-border-color-light); margin-top: auto; }
|
||||
.admin-layout { display: flex; height: 100vh; }
|
||||
.admin-menu { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; }
|
||||
.admin-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
|
||||
.content-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; border-bottom: 1px solid var(--el-border-color-light); background: var(--el-bg-color); }
|
||||
.content-header h2 { margin: 0; font-size: 18px; }
|
||||
.content-body { flex: 1; overflow-y: auto; padding: 20px 24px; background: var(--el-bg-color-page); }
|
||||
.admin-layout {
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
background: var(--bg-page);
|
||||
}
|
||||
|
||||
/* ── Sidebar ── */
|
||||
.admin-sidebar {
|
||||
width: var(--sidebar-w);
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: linear-gradient(180deg, #111827 0%, #1e293b 100%);
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.sidebar-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 20px 20px 16px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
.sidebar-logo {
|
||||
font-size: 28px;
|
||||
line-height: 1;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.sidebar-brand-text h2 {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
margin: 0;
|
||||
color: #fff;
|
||||
line-height: 1.3;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.sidebar-brand-text p {
|
||||
font-size: 11px;
|
||||
margin: 2px 0 0;
|
||||
color: rgba(255, 255, 255, 0.45);
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
/* ── Menu ── */
|
||||
.sidebar-menu {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: transparent !important;
|
||||
border-right: none !important;
|
||||
padding: 4px 0;
|
||||
}
|
||||
.sidebar-menu :deep(.el-menu-item),
|
||||
.sidebar-menu :deep(.el-sub-menu__title) {
|
||||
color: rgba(255, 255, 255, 0.65);
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
transition: all 0.2s ease;
|
||||
margin: 0 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
.sidebar-menu :deep(.el-menu-item):hover,
|
||||
.sidebar-menu :deep(.el-sub-menu__title):hover {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
.sidebar-menu :deep(.el-menu-item.is-active) {
|
||||
color: #fff;
|
||||
background: linear-gradient(90deg, rgba(64, 158, 255, 0.25) 0%, rgba(99, 102, 241, 0.15) 100%);
|
||||
font-weight: 500;
|
||||
}
|
||||
.sidebar-menu :deep(.el-menu-item)::after {
|
||||
display: none;
|
||||
}
|
||||
.sidebar-menu :deep(.el-sub-menu .el-menu) {
|
||||
background: rgba(0, 0, 0, 0.2) !important;
|
||||
}
|
||||
.sidebar-menu :deep(.el-sub-menu .el-menu .el-menu-item) {
|
||||
padding-left: 52px !important;
|
||||
font-size: 13px;
|
||||
height: 38px;
|
||||
line-height: 38px;
|
||||
}
|
||||
.sidebar-menu :deep(.el-icon) {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.sidebar-spacer {
|
||||
flex: 1;
|
||||
}
|
||||
.sidebar-version {
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
color: rgba(255, 255, 255, 0.25);
|
||||
padding: 8px 0;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
/* ── Content Area ── */
|
||||
.admin-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 16px 28px;
|
||||
background: var(--bg-card);
|
||||
border-bottom: 1px solid var(--border-light);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.content-breadcrumb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.breadcrumb-current {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
.content-actions :deep(.el-button) {
|
||||
color: var(--text-secondary);
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.content-body {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 24px 28px;
|
||||
}
|
||||
|
||||
/* ── Global page save bar ── */
|
||||
.content-body :deep(.save-bar) {
|
||||
position: fixed;
|
||||
bottom: 32px;
|
||||
right: 32px;
|
||||
z-index: 100;
|
||||
background: var(--bg-card);
|
||||
padding: 12px 16px;
|
||||
border-radius: var(--radius-lg);
|
||||
border: 1px solid var(--border);
|
||||
box-shadow: 0 4px 16px rgba(0,0,0,0.12);
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
transition: box-shadow 0.2s, transform 0.2s;
|
||||
}
|
||||
.content-body :deep(.save-bar:hover) {
|
||||
box-shadow: 0 6px 24px rgba(0,0,0,0.18);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
<template>
|
||||
<div class="admin-login-page">
|
||||
<div class="login-bg-pattern"></div>
|
||||
<div class="login-card">
|
||||
<h1 class="login-title">{{ siteName || 'CloudSearch' }} 管理后台</h1>
|
||||
<div class="login-brand">
|
||||
<div class="login-logo">☁️</div>
|
||||
<h1 class="login-title">{{ siteName || 'CloudSearch' }}</h1>
|
||||
<p class="login-subtitle">管理后台</p>
|
||||
</div>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="0" size="large" @keyup.enter="handleLogin">
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="form.username" placeholder="用户名" prefix-icon="User" />
|
||||
@@ -11,17 +16,18 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="loading" class="login-btn" @click="handleLogin">
|
||||
登录
|
||||
{{ loading ? '登录中...' : '登 录' }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<p v-if="errorMsg" class="error-msg">{{ errorMsg }}</p>
|
||||
<p class="login-footer">CloudSearch v{{ appVersion }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { User, Lock } from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getSiteConfig, adminLogin } from '../../api'
|
||||
@@ -31,8 +37,8 @@ const formRef = ref<InstanceType<typeof ElForm>>()
|
||||
const loading = ref(false)
|
||||
const errorMsg = ref('')
|
||||
const siteName = ref('')
|
||||
const appVersion = ref('')
|
||||
|
||||
// 获取网站名称
|
||||
getSiteConfig().then(cfg => {
|
||||
if (cfg.site_name) siteName.value = cfg.site_name
|
||||
}).catch(() => {})
|
||||
@@ -64,6 +70,14 @@ async function handleLogin() {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const h = await fetch('/health')
|
||||
const hv = await h.json()
|
||||
appVersion.value = hv.version || ''
|
||||
} catch {}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -72,29 +86,84 @@ async function handleLogin() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.login-bg-pattern {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background:
|
||||
radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.12) 0%, transparent 50%),
|
||||
radial-gradient(circle at 80% 30%, rgba(118, 75, 162, 0.12) 0%, transparent 50%),
|
||||
radial-gradient(circle at 50% 80%, rgba(64, 158, 255, 0.08) 0%, transparent 50%);
|
||||
}
|
||||
.login-card {
|
||||
position: relative;
|
||||
width: 400px;
|
||||
padding: 40px;
|
||||
background: var(--bg-white);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
|
||||
padding: 48px 40px 36px;
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
backdrop-filter: blur(20px);
|
||||
border-radius: var(--radius-xl);
|
||||
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.login-brand {
|
||||
text-align: center;
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
.login-logo {
|
||||
font-size: 48px;
|
||||
margin-bottom: 8px;
|
||||
line-height: 1;
|
||||
}
|
||||
.login-title {
|
||||
text-align: center;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: #303133;
|
||||
margin-bottom: 32px;
|
||||
font-size: 26px;
|
||||
font-weight: 800;
|
||||
color: #1d2129;
|
||||
margin: 0 0 4px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
.login-subtitle {
|
||||
font-size: 14px;
|
||||
color: #86909c;
|
||||
margin: 0;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.login-btn {
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
font-size: 15px;
|
||||
letter-spacing: 4px;
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
.error-msg {
|
||||
text-align: center;
|
||||
color: #f56c6c;
|
||||
font-size: 14px;
|
||||
font-size: 13px;
|
||||
margin-top: 12px;
|
||||
padding: 8px 12px;
|
||||
background: #fef0f0;
|
||||
border-radius: var(--radius-sm);
|
||||
line-height: 1.4;
|
||||
}
|
||||
.login-footer {
|
||||
text-align: center;
|
||||
color: #c9cdd4;
|
||||
font-size: 11px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .login-card {
|
||||
background: rgba(29, 29, 29, 0.95);
|
||||
}
|
||||
[data-theme="dark"] .login-title {
|
||||
color: #e5e5e5;
|
||||
}
|
||||
[data-theme="dark"] .login-subtitle {
|
||||
color: #666666;
|
||||
}
|
||||
[data-theme="dark"] .error-msg {
|
||||
background: rgba(245, 108, 108, 0.12);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,53 +2,108 @@
|
||||
<div class="cleanup-section">
|
||||
<el-card class="config-card">
|
||||
<template #header><span>🧹 存储清理</span></template>
|
||||
<el-form label-width="160px" label-position="left" size="small">
|
||||
<el-form-item label="启用自动清理">
|
||||
<el-switch v-model="cleanupEnabled" active-text="启用" inactive-text="关闭" />
|
||||
<div class="form-tip" style="margin-left: 8px;">
|
||||
每天自动检查一次,将过期文件移入回收站、删除旧日志、清空回收站释放空间
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="云盘文件保留天数">
|
||||
<el-input-number v-model="cleanupFileRetentionDays" :min="1" :max="365" style="width: 140px" />
|
||||
<div class="form-tip" style="margin-left: 8px;">超过此天数的日期文件夹将被移入回收站</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="转存日志保留天数">
|
||||
<el-input-number v-model="cleanupLogRetentionDays" :min="1" :max="365" style="width: 140px" />
|
||||
<div class="form-tip" style="margin-left: 8px;">超过此天数的转存记录将被删除</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="清空回收站">
|
||||
<el-switch v-model="cleanupEmptyTrash" active-text="启用" inactive-text="关闭" />
|
||||
<div class="form-tip" style="margin-left: 8px;">移入回收站后自动清空,永久删除文件以释放存储空间</div>
|
||||
</el-form-item>
|
||||
<el-divider content-position="left">空间阈值自动清理</el-divider>
|
||||
<el-form-item label="启用空间阈值清理">
|
||||
<el-switch v-model="cleanupSpaceThresholdEnabled" active-text="启用" inactive-text="关闭" />
|
||||
<div class="form-tip" style="margin-left: 8px;">已用空间超过阈值时,按比例删除最旧的转存文件(优先级高于保留天数)</div>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cleanupSpaceThresholdEnabled" label="使用阈值">
|
||||
<el-slider v-model="cleanupSpaceThresholdPercent" :min="50" :max="99" style="width: 200px" show-input />
|
||||
<div class="form-tip" style="margin-left: 8px;">已用空间超过此百分比时触发强制清理</div>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cleanupSpaceThresholdEnabled" label="删除比例">
|
||||
<el-slider v-model="cleanupSpaceThresholdDeletePercent" :min="5" :max="50" :step="5" style="width: 200px" show-input />
|
||||
<div class="form-tip" style="margin-left: 8px;">触发清理时释放总空间的百分比(如 10% 表示累计删除最旧文件直到达到总空间的 10%,6TB 总空间 → 释放 ~600GB)</div>
|
||||
</el-form-item>
|
||||
<el-divider content-position="left">分享链接复用</el-divider>
|
||||
<el-form-item label="复用已有分享链接">
|
||||
<el-switch v-model="saveReuseEnabled" active-text="启用" inactive-text="关闭" />
|
||||
<div class="form-tip" style="margin-left: 8px;">相同原始链接不再重复转存,复用已有分享链接(会验证原链接有效性;60秒内重复请求直接返回已有链接)</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-divider content-position="left">手动操作</el-divider>
|
||||
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
|
||||
<el-button type="primary" size="small" :loading="cleanupSaving" @click="handleSaveCleanupConfigs">💾 保存清理配置</el-button>
|
||||
<el-button type="danger" size="small" :loading="cleanupRunning" @click="handleRunCleanup">{{ cleanupRunning ? '清理中...' : '🗑️ 立即清理' }}</el-button>
|
||||
<el-button type="warning" size="small" :loading="emptyTrashRunning" @click="handleEmptyTrash">{{ emptyTrashRunning ? '清空中...' : '🧹 立即清空回收站' }}</el-button>
|
||||
<div class="cleanup-grid">
|
||||
<!-- 列1: ⏱ 基础清理策略 -->
|
||||
<div class="cleanup-group">
|
||||
<div class="cleanup-group-label">⏱ 基础清理策略</div>
|
||||
<el-form label-width="120px" label-position="left" size="small">
|
||||
<el-form-item label="自动清理">
|
||||
<div style="display: flex; align-items: center; gap: 10px; flex-wrap: wrap;">
|
||||
<el-switch v-model="cleanupEnabled" size="small" />
|
||||
<span class="cleanup-hint">每天自动检查一次,删除过期日志、移入回收站文件</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="清空回收站">
|
||||
<div style="display: flex; align-items: center; gap: 10px;">
|
||||
<el-switch v-model="cleanupEmptyTrash" size="small" />
|
||||
<span class="cleanup-hint">清理时一并清空各网盘回收站</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="白名单目录">
|
||||
<div style="width: 100%;">
|
||||
<div style="display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px;" v-if="whitelistDirs.length">
|
||||
<el-tag v-for="(dir, i) in whitelistDirs" :key="i" closable size="small" @close="removeWhitelistDir(i)">{{ dir }}</el-tag>
|
||||
</div>
|
||||
<div style="display: flex; gap: 6px;">
|
||||
<el-input v-model="newWhitelistDir" placeholder="输入目录名" size="small" style="width: 160px" @keyup.enter="addWhitelistDir" />
|
||||
<el-button type="primary" size="small" @click="addWhitelistDir">添加</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<!-- 列2: 📦 保留设置 -->
|
||||
<div class="cleanup-group">
|
||||
<div class="cleanup-group-label">📦 保留设置</div>
|
||||
<el-form label-width="120px" label-position="left" size="small">
|
||||
<el-form-item label="文件保留">
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<el-input-number v-model="cleanupFileRetentionDays" :min="1" :max="365" style="width: 100px" size="small" />
|
||||
<span>天</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="日志保留">
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<el-input-number v-model="cleanupLogRetentionDays" :min="1" :max="365" style="width: 100px" size="small" />
|
||||
<span>天</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="Cookie检测">
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<el-input-number v-model="verifyIntervalMinutes" :min="5" :max="1440" :step="5" style="width: 100px" size="small" />
|
||||
<span>分钟</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="空间校准">
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<el-input-number v-model="storageRefreshIntervalMinutes" :min="5" :max="1440" :step="5" style="width: 100px" size="small" />
|
||||
<span>分钟</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<!-- 列3: 📊 空间阈值自动清理 -->
|
||||
<div class="cleanup-group">
|
||||
<div class="cleanup-group-label">📊 空间阈值自动清理</div>
|
||||
<el-form label-width="120px" label-position="left" size="small">
|
||||
<el-form-item label="启用">
|
||||
<el-switch v-model="cleanupSpaceThresholdEnabled" size="small" />
|
||||
<span class="cleanup-hint" style="margin-left: 8px;">已用空间超过阈值时,按比例删除最旧的转存文件</span>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cleanupSpaceThresholdEnabled" label="使用阈值">
|
||||
<el-slider v-model="cleanupSpaceThresholdPercent" :min="50" :max="99" style="width: 140px" show-input size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cleanupSpaceThresholdEnabled" label="删除比例">
|
||||
<el-slider v-model="cleanupSpaceThresholdDeletePercent" :min="5" :max="50" :step="5" style="width: 140px" show-input size="small" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<!-- 列4: 🔗 分享链接复用 -->
|
||||
<div class="cleanup-group">
|
||||
<div class="cleanup-group-label">🔗 分享链接复用</div>
|
||||
<el-form label-width="120px" label-position="left" size="small">
|
||||
<el-form-item label="复用">
|
||||
<el-switch v-model="saveReuseEnabled" size="small" />
|
||||
<span class="cleanup-hint" style="margin-left: 8px;">相同原始链接不再重复转存,复用已有分享链接(会自动验证原链接有效性;60秒内重复请求直接返回已有链接)</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="lastCleanupTime" class="cleanup-info" style="margin-top: 10px;">
|
||||
<span>⏰ 上次清理:{{ lastCleanupTime }}</span>
|
||||
<span v-if="lastCleanupStats" style="margin-left: 16px;">📊 {{ lastCleanupStats }}</span>
|
||||
|
||||
<!-- 底部:手动操作(跨列全宽) -->
|
||||
<div class="cleanup-actions">
|
||||
<div class="cleanup-actions-buttons">
|
||||
<el-button type="primary" :loading="cleanupSaving" @click="handleSaveCleanupConfigs">💾 保存清理配置</el-button>
|
||||
<el-button type="danger" :loading="cleanupRunning" @click="handleRunCleanup">{{ cleanupRunning ? '清理中...' : '🗑️ 立即清理' }}</el-button>
|
||||
<el-button type="warning" :loading="emptyTrashRunning" @click="handleEmptyTrash">{{ emptyTrashRunning ? '清空中...' : '🧹 清空回收站' }}</el-button>
|
||||
</div>
|
||||
<div v-if="lastCleanupTime" class="cleanup-info">
|
||||
⏰ 上次清理:{{ lastCleanupTime }}
|
||||
<span v-if="lastCleanupStats" style="margin-left: 12px;">📊 {{ lastCleanupStats }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
@@ -116,12 +171,51 @@ const saveReuseEnabled = computed({
|
||||
set: (val: boolean) => { sysConfigs.save_reuse_enabled = val ? 'true' : 'false' },
|
||||
})
|
||||
|
||||
// 白名单
|
||||
const whitelistDirs = ref<string[]>([])
|
||||
const newWhitelistDir = ref('')
|
||||
|
||||
function loadWhitelistDirs() {
|
||||
try {
|
||||
const raw = String(sysConfigs.cleanup_whitelist_dirs || '[]')
|
||||
whitelistDirs.value = JSON.parse(raw)
|
||||
} catch {
|
||||
whitelistDirs.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function addWhitelistDir() {
|
||||
const name = newWhitelistDir.value.trim()
|
||||
if (!name) return
|
||||
if (whitelistDirs.value.includes(name)) {
|
||||
ElMessage.warning('该目录已在白名单中')
|
||||
return
|
||||
}
|
||||
whitelistDirs.value.push(name)
|
||||
newWhitelistDir.value = ''
|
||||
}
|
||||
|
||||
function removeWhitelistDir(index: number) {
|
||||
whitelistDirs.value.splice(index, 1)
|
||||
}
|
||||
|
||||
// Cookie检测间隔 + 空间校准间隔
|
||||
const verifyIntervalMinutes = computed({
|
||||
get: () => Number(sysConfigs.cleanup_verify_interval ?? 30),
|
||||
set: (val: number) => { sysConfigs.cleanup_verify_interval = val },
|
||||
})
|
||||
const storageRefreshIntervalMinutes = computed({
|
||||
get: () => Number(sysConfigs.storage_refresh_interval ?? 180),
|
||||
set: (val: number) => { sysConfigs.storage_refresh_interval = val },
|
||||
})
|
||||
|
||||
async function loadCleanupConfigs() {
|
||||
try {
|
||||
const raw = await getSystemConfigs()
|
||||
for (const cfg of raw) {
|
||||
sysConfigs[cfg.key] = cfg.value
|
||||
}
|
||||
loadWhitelistDirs()
|
||||
} catch (e) {
|
||||
console.error('加载清理配置失败', e)
|
||||
}
|
||||
@@ -130,8 +224,15 @@ async function loadCleanupConfigs() {
|
||||
async function handleSaveCleanupConfigs() {
|
||||
cleanupSaving.value = true
|
||||
try {
|
||||
const keys = ['cleanup_enabled', 'cleanup_file_retention_days', 'cleanup_log_retention_days', 'cleanup_empty_trash', 'cleanup_space_threshold_enabled', 'cleanup_space_threshold_percent', 'cleanup_space_threshold_delete_percent', 'save_reuse_enabled']
|
||||
const keys = [
|
||||
'cleanup_enabled', 'cleanup_file_retention_days', 'cleanup_log_retention_days',
|
||||
'cleanup_empty_trash',
|
||||
'cleanup_space_threshold_enabled', 'cleanup_space_threshold_percent', 'cleanup_space_threshold_delete_percent',
|
||||
'save_reuse_enabled',
|
||||
'cleanup_verify_interval', 'storage_refresh_interval',
|
||||
]
|
||||
const entries = keys.map(key => ({ key, value: String(sysConfigs[key] ?? '') }))
|
||||
entries.push({ key: 'cleanup_whitelist_dirs', value: JSON.stringify(whitelistDirs.value) })
|
||||
await updateSystemConfigs(entries)
|
||||
ElMessage.success('清理配置已保存')
|
||||
} catch (e: any) {
|
||||
@@ -181,14 +282,74 @@ onMounted(() => {
|
||||
|
||||
<style scoped>
|
||||
.cleanup-section .config-card {
|
||||
max-width: 800px;
|
||||
/* 全宽展示,没有max-width限制 */
|
||||
}
|
||||
.form-tip {
|
||||
.cleanup-section :deep(.el-card__header) {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.5px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
/* ── 2列网格布局 ── */
|
||||
.cleanup-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.cleanup-group {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-md);
|
||||
padding: 16px 18px;
|
||||
background: var(--bg-card);
|
||||
transition: box-shadow 0.2s;
|
||||
}
|
||||
.cleanup-group:hover {
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
.cleanup-group-label {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--primary);
|
||||
margin-bottom: 12px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 1px dashed var(--border-light);
|
||||
}
|
||||
.cleanup-hint {
|
||||
color: var(--text-tertiary);
|
||||
font-size: 12px;
|
||||
color: var(--el-text-color-secondary);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* ── 底部操作栏(跨列全宽) ── */
|
||||
.cleanup-actions {
|
||||
margin-top: 20px;
|
||||
padding: 16px 18px;
|
||||
border-top: 1px solid var(--border);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
.cleanup-actions-buttons {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.cleanup-info {
|
||||
font-size: 13px;
|
||||
color: var(--el-text-color-secondary);
|
||||
color: var(--text-tertiary);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
/* ── 响应式:窄屏时改为单列 ── */
|
||||
@media (max-width: 900px) {
|
||||
.cleanup-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -29,11 +29,13 @@
|
||||
<el-button @click="verifyAll">全部重新验证</el-button>
|
||||
</div>
|
||||
|
||||
<el-table :data="configs" stripe style="width: 100%">
|
||||
<el-table-column label="网盘类型" width="110">
|
||||
<template #default="{ row }">
|
||||
<CloudBadge :cloud_type="row.cloud_type" />
|
||||
</template>
|
||||
<el-card shadow="never" class="table-card">
|
||||
<template #header><span>📋 网盘配置列表</span></template>
|
||||
<el-table :data="configs" stripe style="width: 100%" empty-text="暂无网盘配置,点击上方「新增配置」添加">
|
||||
<el-table-column label="网盘类型" width="110">
|
||||
<template #default="{ row }">
|
||||
<CloudBadge :cloud_type="row.cloud_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="nickname" label="昵称" width="140">
|
||||
<template #default="{ row }">
|
||||
@@ -121,10 +123,26 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog v-model="dialogVisible" :title="editingId ? '编辑配置' : '新增配置'" width="560px">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||
<!-- 白名单目录提示 -->
|
||||
<el-alert
|
||||
v-show="whitelistDirs.length > 0"
|
||||
type="warning"
|
||||
show-icon
|
||||
:closable="false"
|
||||
style="margin-bottom: 18px;"
|
||||
>
|
||||
<template #title>
|
||||
<div style="line-height: 1.6;">
|
||||
<div>🧹 请在网盘主目录内创建:<b>{{ whitelistDirs.join('、') }}</b> 目录</div>
|
||||
<div>并将你的重要文件移至该目录,<b>只有这个目录不会被自动清理</b></div>
|
||||
</div>
|
||||
</template>
|
||||
</el-alert>
|
||||
<el-form-item label="网盘类型" prop="cloud_type">
|
||||
<el-select v-model="form.cloud_type" style="width: 100%" :disabled="!!editingId" @change="onCloudTypeChange">
|
||||
<el-option
|
||||
@@ -152,11 +170,6 @@
|
||||
input-style="font-family: monospace; font-size: 12px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label=" ">
|
||||
<el-button type="primary" :loading="form._verifying" @click="verifyAndFillNickname" style="width: 100%">
|
||||
{{ form._verifying ? '验证中...' : '🔍 自动获取(验证 Cookie 并回填信息)' }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<!-- Cookie 获取教程(根据网盘类型切换) -->
|
||||
<el-form-item label=" " v-if="form.cloud_type && form.cloud_type !== ''" class="cookie-tips-item">
|
||||
<div class="cookie-tips" :class="`cookie-tips-${form.cloud_type}`">
|
||||
@@ -182,6 +195,7 @@ import { CLOUD_LABELS } from '../../types'
|
||||
import type { CloudType, CloudConfig } from '../../types'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getCloudConfigs, saveCloudConfig, updateCloudConfig, deleteCloudConfig, testCloudConnection, getCloudTypes, toggleCloudType, setPrimary } from '../../api'
|
||||
import { getSystemConfigs } from '../../api'
|
||||
import CloudBadge from '../../components/CloudBadge.vue'
|
||||
import type { ElForm } from 'element-plus'
|
||||
|
||||
@@ -305,6 +319,7 @@ const cookieTutorialHtml = computed(() => {
|
||||
onMounted(async () => {
|
||||
await loadConfigs()
|
||||
await loadCloudTypes()
|
||||
await loadSystemConfigs()
|
||||
})
|
||||
|
||||
// 每30分钟自动验证一次
|
||||
@@ -325,6 +340,27 @@ async function loadCloudTypes() {
|
||||
} catch (e) { console.error('加载网盘类型失败', e) }
|
||||
}
|
||||
|
||||
/** 加载系统配置,提取清理白名单目录 */
|
||||
const systemConfigs = ref<Record<string, string>>({})
|
||||
const whitelistDirs = computed(() => {
|
||||
try {
|
||||
const raw = systemConfigs.value.cleanup_whitelist_dirs || '[]'
|
||||
const arr = JSON.parse(raw)
|
||||
return Array.isArray(arr) && arr.length > 0 ? arr : []
|
||||
} catch { return [] }
|
||||
})
|
||||
|
||||
async function loadSystemConfigs() {
|
||||
try {
|
||||
const list = await getSystemConfigs()
|
||||
const map: Record<string, string> = {}
|
||||
for (const item of list) {
|
||||
map[item.key] = item.value
|
||||
}
|
||||
systemConfigs.value = map
|
||||
} catch (e) { console.error('加载系统配置失败', e) }
|
||||
}
|
||||
|
||||
async function handleCloudToggle(type: string, enabled: boolean) {
|
||||
const ct = cloudTypes.value.find(c => c.type === type)
|
||||
if (!ct) return
|
||||
@@ -413,33 +449,6 @@ async function verifyOne(row: CloudConfig & { _verifying?: boolean }, silent = f
|
||||
}
|
||||
}
|
||||
|
||||
async function verifyAndFillNickname() {
|
||||
if (!form.cookie) {
|
||||
ElMessage.warning('请先输入 Cookie')
|
||||
return
|
||||
}
|
||||
if (!form.cloud_type) {
|
||||
ElMessage.warning('请先选择网盘类型')
|
||||
return
|
||||
}
|
||||
form._verifying = true
|
||||
try {
|
||||
const result = await testCloudConnection(form.cloud_type as CloudType, form.cookie)
|
||||
if (result.success) {
|
||||
if (result.nickname) form.nickname = result.nickname
|
||||
if (result.storage_used) form._storageUsed = result.storage_used
|
||||
if (result.storage_total) form._storageTotal = result.storage_total
|
||||
ElMessage.success(`昵称:${result.nickname || '获取成功'}`)
|
||||
} else {
|
||||
ElMessage.warning(result.message || '验证失败,请检查 Cookie')
|
||||
}
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e.response?.data?.error || '验证失败,请检查 Cookie')
|
||||
} finally {
|
||||
form._verifying = false
|
||||
}
|
||||
}
|
||||
|
||||
function openDialog(row: CloudConfig | null) {
|
||||
if (row) {
|
||||
editingId.value = row.id ?? null
|
||||
@@ -473,10 +482,9 @@ async function handleSave() {
|
||||
// 1. 表单校验(含推广账号必填)
|
||||
const valid = await formRef.value?.validate().catch(() => false)
|
||||
if (!valid) return
|
||||
|
||||
saving.value = true
|
||||
try {
|
||||
// 2. 如果有 Cookie,先验证 Cookie
|
||||
// 2. 如果有 Cookie,验证 Cookie 有效/无效(不回填昵称和空间)
|
||||
if (form.cookie) {
|
||||
try {
|
||||
const verifyResult = await testCloudConnection(form.cloud_type as CloudType, form.cookie)
|
||||
@@ -485,17 +493,12 @@ async function handleSave() {
|
||||
saving.value = false
|
||||
return
|
||||
}
|
||||
// 保存验证结果
|
||||
if (verifyResult.nickname && !form.nickname) form.nickname = verifyResult.nickname
|
||||
if (verifyResult.storage_used) form._storageUsed = verifyResult.storage_used
|
||||
if (verifyResult.storage_total) form._storageTotal = verifyResult.storage_total
|
||||
} catch (e: any) {
|
||||
ElMessage.error(`Cookie验证失败:${e.response?.data?.error || '网络错误'}`)
|
||||
saving.value = false
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 保存配置
|
||||
if (editingId.value) {
|
||||
await updateCloudConfig({
|
||||
@@ -506,8 +509,6 @@ async function handleSave() {
|
||||
is_transfer_enabled: form.is_transfer_enabled ? 1 : 0,
|
||||
cookie: form.cookie || undefined,
|
||||
is_active: 1,
|
||||
storage_used: form._storageUsed || undefined,
|
||||
storage_total: form._storageTotal || undefined,
|
||||
})
|
||||
ElMessage.success('配置更新成功')
|
||||
} else {
|
||||
@@ -518,8 +519,6 @@ async function handleSave() {
|
||||
is_transfer_enabled: form.is_transfer_enabled ? 1 : 0,
|
||||
cookie: form.cookie,
|
||||
is_active: 1,
|
||||
storage_used: form._storageUsed || undefined,
|
||||
storage_total: form._storageTotal || undefined,
|
||||
})
|
||||
ElMessage.success('配置保存成功')
|
||||
}
|
||||
@@ -584,16 +583,27 @@ function storageFree(row: CloudConfig): string {
|
||||
|
||||
<style scoped>
|
||||
.cloud-config {
|
||||
background: var(--bg-white);
|
||||
border-radius: var(--radius-card);
|
||||
padding: 24px;
|
||||
/* Uses global card styles from App.vue */
|
||||
}
|
||||
.cloud-toggle-grid { display: flex; flex-wrap: wrap; gap: 12px; }
|
||||
.cloud-toggle-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--el-border-color-light); border-radius: 8px; background: var(--el-bg-color); }
|
||||
.cloud-toggle-chip:hover { border-color: var(--el-color-primary-light-5); }
|
||||
.cloud-icon-img { width: 20px; height: 20px; object-fit: contain; }
|
||||
.cloud-label { font-size: 13px; font-weight: 500; }
|
||||
.form-tip { font-size: 12px; color: var(--el-text-color-secondary); }
|
||||
|
||||
/* ── Table card wrapper ── */
|
||||
.table-card {
|
||||
border-radius: var(--radius-lg);
|
||||
border: 1px solid var(--border) !important;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.table-card :deep(.el-card__header) {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
background: var(--bg-card-header);
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding: 12px 18px;
|
||||
}
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* ── Toolbar ── */
|
||||
.toolbar {
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
@@ -601,24 +611,35 @@ function storageFree(row: CloudConfig): string {
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.sign-summary-tag {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
/* ── Table cells ── */
|
||||
.nickname-text {
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
color: var(--text);
|
||||
}
|
||||
.promotion-text {
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
.uid-cell {
|
||||
font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
|
||||
font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
|
||||
font-size: 11px;
|
||||
color: #909399;
|
||||
color: var(--text-tertiary);
|
||||
letter-spacing: 0.3px;
|
||||
}
|
||||
/* 空间进度条 */
|
||||
.save-count {
|
||||
font-size: 12px;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
.verifying {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 12px;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
/* ── Storage bar ── */
|
||||
.storage-cell {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -627,7 +648,7 @@ function storageFree(row: CloudConfig): string {
|
||||
}
|
||||
.storage-bar-wrap {
|
||||
height: 4px;
|
||||
background: #f0f2f5;
|
||||
background: var(--border-light);
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -641,44 +662,27 @@ function storageFree(row: CloudConfig): string {
|
||||
.storage-bar-fill.bar-danger { background: #f56c6c; }
|
||||
.storage-text {
|
||||
font-size: 11px;
|
||||
color: #909399;
|
||||
color: var(--text-tertiary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
}
|
||||
.storage-used { color: #606266; font-weight: 600; }
|
||||
.storage-total { color: #303133; font-weight: 600; }
|
||||
.storage-free { color: #909399; }
|
||||
.save-count {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
.verifying {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
:deep(.el-input-group__append) {
|
||||
padding: 0;
|
||||
}
|
||||
:deep(.el-input-group__append .el-button) {
|
||||
border-radius: 0;
|
||||
}
|
||||
.storage-used { color: var(--text-secondary); font-weight: 600; }
|
||||
.storage-total { color: var(--text); font-weight: 600; }
|
||||
.storage-free { color: var(--text-tertiary); }
|
||||
|
||||
/* Cookie 教程卡片 */
|
||||
/* ── Cookie tutorial card ── */
|
||||
.cookie-tips-item :deep(.el-form-item__content) {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
.cookie-tips {
|
||||
background: #f8faff;
|
||||
border: 1px solid #e8f0fe;
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 14px 16px;
|
||||
font-size: 12px;
|
||||
line-height: 1.8;
|
||||
color: #606266;
|
||||
color: var(--text-secondary);
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@@ -687,7 +691,7 @@ function storageFree(row: CloudConfig): string {
|
||||
}
|
||||
.cookie-tips-title {
|
||||
font-weight: 700;
|
||||
color: #409eff;
|
||||
color: var(--primary);
|
||||
font-size: 13px;
|
||||
}
|
||||
.cookie-tips-steps {
|
||||
@@ -698,11 +702,11 @@ function storageFree(row: CloudConfig): string {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.cookie-tips-steps code {
|
||||
background: #ecf5ff;
|
||||
background: var(--primary-soft);
|
||||
padding: 1px 5px;
|
||||
border-radius: 3px;
|
||||
font-size: 11px;
|
||||
font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
|
||||
font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
|
||||
}
|
||||
.cookie-tips-note {
|
||||
margin-top: 8px;
|
||||
@@ -718,4 +722,42 @@ function storageFree(row: CloudConfig): string {
|
||||
background: #f5f0e0;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .cookie-tips {
|
||||
background: rgba(64, 158, 255, 0.06);
|
||||
border-color: rgba(64, 158, 255, 0.15);
|
||||
}
|
||||
[data-theme="dark"] .cookie-tips-title {
|
||||
color: #66b1ff;
|
||||
}
|
||||
[data-theme="dark"] .cookie-tips-steps code {
|
||||
background: rgba(64, 158, 255, 0.12);
|
||||
}
|
||||
[data-theme="dark"] .cookie-tips-note {
|
||||
background: rgba(255, 193, 7, 0.1);
|
||||
border-color: rgba(255, 193, 7, 0.2);
|
||||
color: #d4a84b;
|
||||
}
|
||||
[data-theme="dark"] .cookie-tips-note code {
|
||||
background: rgba(255, 193, 7, 0.12);
|
||||
}
|
||||
|
||||
/* ── Cloud toggle (re-used from AdminDashboard) ── */
|
||||
.cloud-toggle-grid { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.cloud-toggle-chip { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
|
||||
.cloud-toggle-chip:hover { border-color: var(--primary); }
|
||||
.cloud-icon-img { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
|
||||
.cloud-label { font-size: 13px; font-weight: 500; }
|
||||
|
||||
/* ── Dialog refinements ── */
|
||||
:deep(.el-dialog__header) {
|
||||
font-weight: 700;
|
||||
font-size: 16px;
|
||||
}
|
||||
:deep(.el-dialog__body) {
|
||||
padding: 20px 24px;
|
||||
}
|
||||
:deep(.el-dialog__wrapper .el-dialog) {
|
||||
border-radius: var(--radius-lg);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -74,14 +74,16 @@
|
||||
</div>
|
||||
|
||||
<!-- ── Table ── -->
|
||||
<div class="el-table-wrap">
|
||||
<el-table
|
||||
:data="records" stripe style="width: 100%"
|
||||
v-loading="loading"
|
||||
empty-text="暂无转存记录"
|
||||
@expand-change="onExpandChange"
|
||||
:row-class-name="rowClassName"
|
||||
>
|
||||
<el-card shadow="never" class="save-table-card">
|
||||
<template #header><span>📋 转存日志列表</span></template>
|
||||
<div class="el-table-wrap">
|
||||
<el-table
|
||||
:data="records" stripe style="width: 100%"
|
||||
v-loading="loading"
|
||||
empty-text="暂无转存记录"
|
||||
@expand-change="onExpandChange"
|
||||
:row-class-name="rowClassName"
|
||||
>
|
||||
<el-table-column type="expand" width="36">
|
||||
<template #default="{ row }">
|
||||
<div class="expand-detail">
|
||||
@@ -250,6 +252,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- ── Pagination ── -->
|
||||
<div class="pagination-wrap" v-if="total > 0">
|
||||
@@ -599,6 +602,20 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
/* ── Table ── */
|
||||
.save-table-card {
|
||||
border-radius: var(--radius-lg);
|
||||
border: 1px solid var(--border) !important;
|
||||
}
|
||||
.save-table-card :deep(.el-card__header) {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
background: var(--bg-card-header);
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding: 12px 18px;
|
||||
}
|
||||
.save-table-card :deep(.el-card__body) {
|
||||
padding: 0;
|
||||
}
|
||||
.save-records :deep(.el-table) {
|
||||
border: 1px solid var(--el-border-color-light, #ebeef5);
|
||||
border-radius: 8px;
|
||||
|
||||
@@ -497,7 +497,6 @@
|
||||
<el-button type="primary" size="large" :loading="saving" @click="handleSave">
|
||||
保存配置
|
||||
</el-button>
|
||||
<el-button size="large" @click="handleLogout">退出登录</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1097,16 +1096,6 @@ async function handleRemoveLogo() {
|
||||
background: #f0f0f0;
|
||||
object-fit: contain;
|
||||
}
|
||||
.save-bar {
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
background: var(--bg-white);
|
||||
padding: 16px 0;
|
||||
border-top: 1px solid var(--border-color);
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
justify-content: flex-end; padding-right: 24px; gap: 12px;
|
||||
}
|
||||
|
||||
/* ── 搜索策略 3列网格 ── */
|
||||
.strategy-grid {
|
||||
|
||||
Reference in New Issue
Block a user