refactor(settings): collapse get_all to aksrt_settings and drop migration UI
Make aksrt_settings the sole theme settings store for get_all(), remove aksrt_seo_settings/aksrt_basic_settings merge paths, point global.logo schema at aksrt_settings, and delete the retired settings migration page, route, REST endpoint, and related SPA surface.
This commit is contained in:
@@ -1,111 +0,0 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<PageHeader
|
||||
title="迁移状态"
|
||||
desc="查看数据库 schema 版本、设置迁移版本和迁移日志,方便发布前确认历史兼容层状态。"
|
||||
>
|
||||
<template #actions>
|
||||
<n-space>
|
||||
<n-button quaternary @click="go('/tools/health')">健康检查</n-button>
|
||||
<n-button quaternary @click="go('/tools/import-export')">导入导出</n-button>
|
||||
</n-space>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<n-spin :show="loading" style="width: 100%; min-height: 200px;">
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<h3>版本摘要</h3>
|
||||
</div>
|
||||
<n-space>
|
||||
<n-tag round type="info">DB Schema:{{ status.schema_version || '0.0.0' }}</n-tag>
|
||||
<n-tag round type="info">Settings Migration:{{ status.migration_version || '0.0.0' }}</n-tag>
|
||||
<n-tag round :type="logItems.length ? 'success' : 'default'">迁移日志:{{ logItems.length }} 条</n-tag>
|
||||
</n-space>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<n-alert type="info" :show-icon="false">
|
||||
迁移说明文档位于 `docs/migration-map.md`。如果这里的 schema/version 与文档记录不一致,发布前应先补齐说明。
|
||||
</n-alert>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<h3>迁移日志</h3>
|
||||
</div>
|
||||
<div v-if="logItems.length" class="aksrt-migration-log">
|
||||
<div v-for="(item, index) in logItems" :key="index" class="aksrt-migration-log__item">
|
||||
<pre>{{ stringifyItem(item) }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
<n-empty v-else description="暂无迁移日志" />
|
||||
</n-card>
|
||||
</n-spin>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import api from '@/api'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const message = useMessage()
|
||||
|
||||
const loading = ref(true)
|
||||
const status = ref({})
|
||||
|
||||
const logItems = computed(() => {
|
||||
return Array.isArray(status.value.migration_log) ? status.value.migration_log : []
|
||||
})
|
||||
|
||||
function go(path) {
|
||||
router.push(path)
|
||||
}
|
||||
|
||||
function extractData(response) {
|
||||
return response?.data ?? response ?? {}
|
||||
}
|
||||
|
||||
function stringifyItem(item) {
|
||||
if (typeof item === 'string') {
|
||||
return item
|
||||
}
|
||||
return JSON.stringify(item, null, 2)
|
||||
}
|
||||
|
||||
async function load() {
|
||||
loading.value = true
|
||||
try {
|
||||
status.value = extractData(await api.getMigrationStatus())
|
||||
} catch (error) {
|
||||
message.error(error.message || '加载迁移状态失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(load)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-migration-log {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.aksrt-migration-log__item pre {
|
||||
margin: 0;
|
||||
padding: 12px 14px;
|
||||
border-radius: 12px;
|
||||
background: #101828;
|
||||
color: #d0d7e2;
|
||||
font-size: 12px;
|
||||
line-height: 1.7;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user