This commit is contained in:
parent
a8100db3e9
commit
1b25dff25e
@ -81,8 +81,52 @@
|
|||||||
.degraded-alert {
|
.degraded-alert {
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
.section-select {
|
.config-workspace {
|
||||||
width: 150px;
|
display: grid;
|
||||||
|
grid-template-columns: 176px minmax(0, 1fr);
|
||||||
|
align-items: start;
|
||||||
|
gap: 20px;
|
||||||
|
}
|
||||||
|
.config-submenu {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
display: grid;
|
||||||
|
gap: 6px;
|
||||||
|
align-self: start;
|
||||||
|
padding: 8px;
|
||||||
|
border: 1px solid var(--pm-border-color);
|
||||||
|
border-radius: var(--pm-radius-lg);
|
||||||
|
background: var(--pm-bg-secondary);
|
||||||
|
}
|
||||||
|
.config-submenu-item {
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px 14px;
|
||||||
|
color: var(--pm-text-secondary);
|
||||||
|
text-align: left;
|
||||||
|
font: inherit;
|
||||||
|
border: 0;
|
||||||
|
border-radius: var(--pm-radius-sm);
|
||||||
|
background: transparent;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: color .2s ease, background-color .2s ease;
|
||||||
|
}
|
||||||
|
.config-submenu-item:hover,
|
||||||
|
.config-submenu-item.active {
|
||||||
|
color: var(--pm-primary-color);
|
||||||
|
background: var(--el-color-primary-light-9);
|
||||||
|
}
|
||||||
|
.config-submenu-item.active {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.config-main {
|
||||||
|
display: grid;
|
||||||
|
gap: 24px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.selected-section-label {
|
||||||
|
color: var(--pm-primary-color);
|
||||||
|
font-size: 14px;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.editor-meta {
|
.editor-meta {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -231,8 +275,24 @@
|
|||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
.section-select {
|
.config-workspace {
|
||||||
width: 100%;
|
grid-template-columns: 1fr;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
.config-submenu {
|
||||||
|
position: static;
|
||||||
|
display: flex;
|
||||||
|
gap: 6px;
|
||||||
|
overflow-x: auto;
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
.config-submenu-item {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
width: auto;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.selected-section-label {
|
||||||
|
white-space: normal;
|
||||||
}
|
}
|
||||||
.action-row .el-button,
|
.action-row .el-button,
|
||||||
.audit-actions .el-button {
|
.audit-actions .el-button {
|
||||||
@ -295,4 +355,4 @@
|
|||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,6 +135,12 @@ export function usePage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const selectSection = value => {
|
||||||
|
if (selectedSection.value === value) return
|
||||||
|
selectedSection.value = value
|
||||||
|
loadSection()
|
||||||
|
}
|
||||||
|
|
||||||
const loadBackups = async () => {
|
const loadBackups = async () => {
|
||||||
if (!canRollback.value) return
|
if (!canRollback.value) return
|
||||||
backupsLoading.value = true
|
backupsLoading.value = true
|
||||||
@ -426,7 +432,7 @@ export function usePage() {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
loading, working, status, stateLabel, stateTagType, sectionOptions: sections,
|
loading, working, status, stateLabel, stateTagType, sectionOptions: sections,
|
||||||
selectedSection, editorText, sectionError, sensitiveHint, secretField, secretValue,
|
selectedSection, selectSection, editorText, sectionError, sensitiveHint, secretField, secretValue,
|
||||||
confirmed, savedGeneration, validationResult, canWrite, canRollback, canAudit, canExportAudit,
|
confirmed, savedGeneration, validationResult, canWrite, canRollback, canAudit, canExportAudit,
|
||||||
backupsLoading, backups, rollbackGeneration, rollbackConfirmed, rollbackPreview,
|
backupsLoading, backups, rollbackGeneration, rollbackConfirmed, rollbackPreview,
|
||||||
auditLoading, auditItems, loadAll, loadSection, validateConfig, saveConfig, applyConfig,
|
auditLoading, auditItems, loadAll, loadSection, validateConfig, saveConfig, applyConfig,
|
||||||
|
|||||||
@ -14,58 +14,72 @@
|
|||||||
class="config-alert"
|
class="config-alert"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<section class="status-panel">
|
<div class="config-workspace">
|
||||||
<div class="status-heading">
|
<nav class="config-submenu" aria-label="配置分区">
|
||||||
<div>
|
<button
|
||||||
<span class="section-eyebrow">运行状态</span>
|
v-for="item in sectionOptions"
|
||||||
<h4>配置快照</h4>
|
:key="item.value"
|
||||||
</div>
|
type="button"
|
||||||
<el-button size="small" plain :loading="loading" @click="loadAll">刷新</el-button>
|
class="config-submenu-item"
|
||||||
</div>
|
:class="{ active: selectedSection === item.value }"
|
||||||
<div class="status-grid">
|
:aria-current="selectedSection === item.value ? 'page' : undefined"
|
||||||
<div class="status-item">
|
@click="selectSection(item.value)"
|
||||||
<span>状态</span>
|
>
|
||||||
<el-tag :type="stateTagType">{{ stateLabel }}</el-tag>
|
{{ item.label }}
|
||||||
</div>
|
</button>
|
||||||
<div class="status-item">
|
</nav>
|
||||||
<span>当前生效代次</span>
|
|
||||||
<strong>{{ status.activeGeneration || '-' }}</strong>
|
|
||||||
</div>
|
|
||||||
<div class="status-item">
|
|
||||||
<span>最近校验时间</span>
|
|
||||||
<strong>{{ formatTime(status.lastValidAt) }}</strong>
|
|
||||||
</div>
|
|
||||||
<div class="status-item status-wide">
|
|
||||||
<span>待重启服务</span>
|
|
||||||
<div v-if="status.pendingRestart?.length" class="tag-list">
|
|
||||||
<el-tag v-for="service in status.pendingRestart" :key="service" type="warning" effect="plain">
|
|
||||||
{{ serviceLabel(service) }}
|
|
||||||
</el-tag>
|
|
||||||
</div>
|
|
||||||
<strong v-else>无</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<el-alert
|
|
||||||
v-for="issue in status.degradedReasons || []"
|
|
||||||
:key="`${issue.code}-${issue.message}`"
|
|
||||||
:title="`${issue.code}:${issue.message}`"
|
|
||||||
type="warning"
|
|
||||||
:closable="false"
|
|
||||||
show-icon
|
|
||||||
class="degraded-alert"
|
|
||||||
/>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="editor-panel">
|
<div class="config-main">
|
||||||
<div class="panel-heading">
|
<section class="status-panel">
|
||||||
<div>
|
<div class="status-heading">
|
||||||
<span class="section-eyebrow">分区配置</span>
|
<div>
|
||||||
<h4>编辑候选配置</h4>
|
<span class="section-eyebrow">运行状态</span>
|
||||||
</div>
|
<h4>配置快照</h4>
|
||||||
<el-select v-model="selectedSection" class="section-select" aria-label="配置分区" @change="loadSection">
|
</div>
|
||||||
<el-option v-for="item in sectionOptions" :key="item.value" :label="item.label" :value="item.value" />
|
<el-button size="small" plain :loading="loading" @click="loadAll">刷新</el-button>
|
||||||
</el-select>
|
</div>
|
||||||
</div>
|
<div class="status-grid">
|
||||||
|
<div class="status-item">
|
||||||
|
<span>状态</span>
|
||||||
|
<el-tag :type="stateTagType">{{ stateLabel }}</el-tag>
|
||||||
|
</div>
|
||||||
|
<div class="status-item">
|
||||||
|
<span>当前生效代次</span>
|
||||||
|
<strong>{{ status.activeGeneration || '-' }}</strong>
|
||||||
|
</div>
|
||||||
|
<div class="status-item">
|
||||||
|
<span>最近校验时间</span>
|
||||||
|
<strong>{{ formatTime(status.lastValidAt) }}</strong>
|
||||||
|
</div>
|
||||||
|
<div class="status-item status-wide">
|
||||||
|
<span>待重启服务</span>
|
||||||
|
<div v-if="status.pendingRestart?.length" class="tag-list">
|
||||||
|
<el-tag v-for="service in status.pendingRestart" :key="service" type="warning" effect="plain">
|
||||||
|
{{ serviceLabel(service) }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
<strong v-else>无</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-alert
|
||||||
|
v-for="issue in status.degradedReasons || []"
|
||||||
|
:key="`${issue.code}-${issue.message}`"
|
||||||
|
:title="`${issue.code}:${issue.message}`"
|
||||||
|
type="warning"
|
||||||
|
:closable="false"
|
||||||
|
show-icon
|
||||||
|
class="degraded-alert"
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="editor-panel">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<div>
|
||||||
|
<span class="section-eyebrow">分区配置</span>
|
||||||
|
<h4>编辑候选配置</h4>
|
||||||
|
</div>
|
||||||
|
<strong class="selected-section-label">{{ sectionOptions.find(item => item.value === selectedSection)?.label }}</strong>
|
||||||
|
</div>
|
||||||
|
|
||||||
<el-alert
|
<el-alert
|
||||||
v-if="sectionError"
|
v-if="sectionError"
|
||||||
@ -124,9 +138,9 @@
|
|||||||
<li v-for="issue in validationResult.issues" :key="`${issue.code}-${issue.message}`">{{ issue.code }}:{{ issue.message }}</li>
|
<li v-for="issue in validationResult.issues" :key="`${issue.code}-${issue.message}`">{{ issue.code }}:{{ issue.message }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section v-if="canMigrate" class="migration-panel">
|
<section v-if="canMigrate" class="migration-panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<div>
|
<div>
|
||||||
<span class="section-eyebrow">数据库迁移</span>
|
<span class="section-eyebrow">数据库迁移</span>
|
||||||
@ -172,9 +186,9 @@
|
|||||||
<span>目标数据库:{{ migrationRecord.target?.name || migrationRecord.target?.localRef || '-' }}</span>
|
<span>目标数据库:{{ migrationRecord.target?.name || migrationRecord.target?.localRef || '-' }}</span>
|
||||||
<span v-if="migrationRecord.errorCode" class="migration-error">错误代码:{{ migrationRecord.errorCode }}</span>
|
<span v-if="migrationRecord.errorCode" class="migration-error">错误代码:{{ migrationRecord.errorCode }}</span>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section v-if="canRestart && status.pendingRestart?.length" class="restart-panel">
|
<section v-if="canRestart && status.pendingRestart?.length" class="restart-panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<div>
|
<div>
|
||||||
<span class="section-eyebrow">受控重启</span>
|
<span class="section-eyebrow">受控重启</span>
|
||||||
@ -196,9 +210,9 @@
|
|||||||
<span>服务管理器:{{ restartPreview.serviceManager }}</span>
|
<span>服务管理器:{{ restartPreview.serviceManager }}</span>
|
||||||
<span>{{ restartPreview.triggerAvailable ? '重启通道可用' : '重启通道暂不可用,请先检查服务部署' }}</span>
|
<span>{{ restartPreview.triggerAvailable ? '重启通道可用' : '重启通道暂不可用,请先检查服务部署' }}</span>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section v-if="canRollback" class="rollback-panel">
|
<section v-if="canRollback" class="rollback-panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<div>
|
<div>
|
||||||
<span class="section-eyebrow">受控回滚</span>
|
<span class="section-eyebrow">受控回滚</span>
|
||||||
@ -231,9 +245,9 @@
|
|||||||
<span>候选代次:{{ rollbackPreview.candidateGeneration }}</span>
|
<span>候选代次:{{ rollbackPreview.candidateGeneration }}</span>
|
||||||
<span>变更分区:{{ rollbackPreview.changedSections?.map(sectionLabel).join('、') || '无' }}</span>
|
<span>变更分区:{{ rollbackPreview.changedSections?.map(sectionLabel).join('、') || '无' }}</span>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section v-if="canAudit" class="audit-panel">
|
<section v-if="canAudit" class="audit-panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<div>
|
<div>
|
||||||
<span class="section-eyebrow">审计记录</span>
|
<span class="section-eyebrow">审计记录</span>
|
||||||
@ -255,7 +269,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-empty v-else description="暂无配置审计记录" :image-size="72" />
|
<el-empty v-else description="暂无配置审计记录" :image-size="72" />
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -271,6 +287,7 @@ const {
|
|||||||
stateTagType,
|
stateTagType,
|
||||||
sectionOptions,
|
sectionOptions,
|
||||||
selectedSection,
|
selectedSection,
|
||||||
|
selectSection,
|
||||||
editorText,
|
editorText,
|
||||||
sectionError,
|
sectionError,
|
||||||
sensitiveHint,
|
sensitiveHint,
|
||||||
@ -325,4 +342,4 @@ const {
|
|||||||
void computed
|
void computed
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped src="./ConfigSettings.css"></style>
|
<style scoped src="./ConfigSettings.css"></style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user