移除配置页面步骤提示条并保留操作功能
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-06 13:07:26 +08:00
1 parent 29dbb93d04
commit dce9cb5ddf
3 files changed
+16 -43

No files matched your search

@@ -83,12 +83,6 @@
<span class="selected-section-label">{{ currentSection.label }}</span> <span class="selected-section-label">{{ currentSection.label }}</span>
</div> </div>
<ol v-if="canWrite" class="change-workflow" aria-label="配置变更流程">
<li><span class="step-number">1</span><span>验证配置</span></li>
<li><span class="step-number">2</span><span>保存候选</span></li>
<li><span class="step-number">3</span><span>应用生效</span></li>
</ol>
<el-alert <el-alert
v-if="sectionError" v-if="sectionError"
:title="sectionError" :title="sectionError"
@@ -136,38 +136,6 @@
line-height: 1.5; line-height: 1.5;
white-space: nowrap; white-space: nowrap;
} }
.change-workflow {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 8px;
margin: 18px 0;
padding: 0;
list-style: none;
}
.change-workflow li {
display: flex;
align-items: center;
justify-content: center;
gap: 7px;
padding: 8px 4px;
border-radius: 8px;
background: var(--pm-bg-primary);
color: var(--pm-text-secondary);
font-size: 12px;
line-height: 1.5;
}
.step-number {
display: grid;
place-items: center;
flex: none;
width: 20px;
height: 20px;
border-radius: 50%;
color: var(--config-accent);
background: color-mix(in srgb, var(--config-accent) 10%, var(--pm-bg-secondary));
font-size: 11px;
font-weight: 700;
}
.editor-hint, .editor-hint,
.action-hint { .action-hint {
margin: 8px 0 0; margin: 8px 0 0;
@@ -411,11 +379,6 @@
align-items: stretch; align-items: stretch;
flex-direction: column; flex-direction: column;
} }
.change-workflow li {
flex-direction: column;
gap: 5px;
font-size: 11px;
}
.action-row .el-button, .action-row .el-button,
.audit-actions .el-button { .audit-actions .el-button {
flex: 1; flex: 1;
+16
View File
@@ -309,6 +309,22 @@ test('独立页模板可编译,编辑器不再连接维护面板且权限绑
assert.doesNotMatch(template, /&#x[0-9a-f]+;/i) assert.doesNotMatch(template, /&#x[0-9a-f]+;/i)
}) })
test('配置编辑页移除步骤提示条和专用样式,保留实际操作及确认控件', () => {
const root = new URL('../../frontend/src/views/components/ConfigSettings/', import.meta.url)
const template = readFileSync(new URL('ConfigEditor/ConfigEditor.vue', root), 'utf8')
const sharedCss = readFileSync(new URL('ConfigSettings.css', root), 'utf8')
const editorCss = readFileSync(new URL('ConfigEditor/ConfigEditor.css', root), 'utf8')
assert.doesNotMatch(template, /change-workflow|step-number|配置变更流程/)
assert.doesNotMatch(sharedCss + editorCss, /change-workflow|step-number/)
for (const action of ['validateConfig', 'saveConfig', 'applyConfig']) {
assert.match(template, new RegExp(`<el-button\\b[^>]*@click="${action}"[^>]*>`))
}
assert.match(template, /v-if="canWrite" class="editor-footer"/)
assert.match(template, /<el-checkbox\b[^>]*v-model="confirmed"/)
assert.match(template, /@click="managePending\('resume'\)"/)
assert.match(template, /@click="managePending\('cancel'\)"/)
})
test('离开、刷新和正在执行的变更受保护,取消时保留编辑内容', async () => { test('离开、刷新和正在执行的变更受保护,取消时保留编辑内容', async () => {
let cancel = true let cancel = true
let prompts = 0 let prompts = 0