This commit is contained in:
parent
9cb91b9e34
commit
2a40f48dfc
@ -12,9 +12,6 @@
|
||||
<p class="settings-desc">{{ currentSection.description }}</p>
|
||||
</div>
|
||||
<div class="overview-actions">
|
||||
<el-tag class="access-tag" :type="canWrite ? 'info' : 'warning'" effect="plain" size="small">
|
||||
{{ canWrite ? '敏感凭据已脱敏' : '只读模式' }}
|
||||
</el-tag>
|
||||
<el-button
|
||||
v-if="!availabilityError"
|
||||
size="small"
|
||||
@ -28,25 +25,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="!loading && !availabilityError">
|
||||
<dl class="overview-meta" aria-label="当前配置状态">
|
||||
<div class="overview-meta-item">
|
||||
<dt>生效代次</dt>
|
||||
<dd>{{ status.activeGeneration || '-' }}</dd>
|
||||
</div>
|
||||
<div class="overview-meta-item">
|
||||
<dt>最近校验</dt>
|
||||
<dd>{{ formatTime(status.lastValidAt) }}</dd>
|
||||
</div>
|
||||
<div class="overview-meta-item" :class="{ 'overview-meta-warning': status.pendingRestart?.length }">
|
||||
<dt>待重启服务</dt>
|
||||
<dd v-if="status.pendingRestart?.length" class="tag-list">
|
||||
<el-tag v-for="service in status.pendingRestart" :key="service" type="warning" effect="plain" size="small">
|
||||
{{ serviceLabel(service) }}
|
||||
</el-tag>
|
||||
</dd>
|
||||
<dd v-else>无需重启</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<el-alert
|
||||
v-for="issue in status.degradedReasons || []"
|
||||
:key="`${issue.code}-${issue.message}`"
|
||||
@ -97,7 +75,7 @@
|
||||
:disabled="!canWrite || !!working || !!pendingCandidate"
|
||||
@change="updateField"
|
||||
/>
|
||||
<p id="config-sensitive-hint" class="editor-hint">{{ sensitiveHint }}。</p>
|
||||
<p v-if="sensitiveHint" id="config-sensitive-hint" class="editor-hint">{{ sensitiveHint }}。</p>
|
||||
|
||||
<div v-if="secretField" class="secret-editor">
|
||||
<div>
|
||||
|
||||
@ -76,7 +76,7 @@ const validDomain = value => {
|
||||
}
|
||||
|
||||
const baseGroups = [
|
||||
group('site', '站点与域名', '填写域名即可,无需添加协议前缀或路径。', [
|
||||
group('site', '站点与域名', '', [
|
||||
field('domains.primary', '主邮件域名', 'text', { required: true, placeholder: 'example.com' }),
|
||||
field('domains.web', '网页访问域名', 'text', { required: true, placeholder: 'mail.example.com' }),
|
||||
field('domains.accepted', '接收邮件的域名', 'list', { required: true, wide: false, hint: '需包含主邮件域名,每个域名单独填写。', placeholder: 'example.com' }),
|
||||
@ -88,7 +88,7 @@ const baseGroups = [
|
||||
port('database.port', '数据库端口', { min: 1, show: networkDatabase }),
|
||||
field('database.username', '数据库用户名', 'text', { required: true, show: networkDatabase })
|
||||
]),
|
||||
group('http', '网页访问服务', '端口和加密方式变更可能需要重启,并影响当前访问地址。', [
|
||||
group('http', '网页访问服务', '', [
|
||||
field('http.tlsMode', '加密连接方式', 'select', {
|
||||
options: options([['', '沿用当前设置'], ['direct', '由 Smail 提供 HTTPS'], ['proxy', '由反向代理提供 HTTPS']]),
|
||||
hint: '选择内置 HTTPS 自动启用并补全端口;选择反向代理后,Smail 不自动申请或续期 SSL 证书,由反代服务器负责;邮件协议仍需有效的本地证书。'
|
||||
|
||||
@ -185,7 +185,7 @@ export function usePage(pageKey = 'base') {
|
||||
}
|
||||
return null
|
||||
})
|
||||
const sensitiveHint = computed(() => secretField.value ? '密码不会回填,修改请使用下方独立输入框,留空保持原值' : '系统内部字段自动保留,无需手工填写')
|
||||
const sensitiveHint = computed(() => secretField.value ? '密码不会回填,修改请使用下方独立输入框,留空保持原值' : '')
|
||||
|
||||
const invalidateCandidate = () => {
|
||||
savedGeneration.value = 0
|
||||
|
||||
@ -418,7 +418,7 @@ test('配置编辑区移除填写标题、说明与重复标签,保留主标
|
||||
assert.match(template, /<h3 id="config-page-title">{{ currentSection.label }}/)
|
||||
assert.match(template, /v-if="selectedSection === 'ssl' && status.tlsMode === 'proxy'"[^>]*role="note"/)
|
||||
assert.match(template, /v-if="sectionError"[\s\S]*?:title="sectionError"/)
|
||||
assert.match(template, /<p id="config-sensitive-hint"/)
|
||||
assert.match(template, /id="config-sensitive-hint"/)
|
||||
assert.match(template, /v-if="secretField" class="secret-editor"/)
|
||||
assert.match(template, /v-if="validationResult"[^>]*role="status"/)
|
||||
})
|
||||
@ -462,16 +462,12 @@ test('标题合并配置状态,保留刷新保护和降级提示,不再渲
|
||||
assert.match(header, /aria-labelledby="config-page-title"/)
|
||||
assert.match(header, /<h3 id="config-page-title">{{ currentSection.label }}/)
|
||||
assert.match(header, /<span class="sr-only">运行状态:<\/span>{{ stateLabel }}/)
|
||||
assert.match(header, /<dl class="overview-meta" aria-label="当前配置状态">/)
|
||||
assert.equal((header.match(/<dt>/g) || []).length, 3)
|
||||
assert.match(header, /status.activeGeneration/)
|
||||
assert.match(header, /formatTime\(status.lastValidAt\)/)
|
||||
assert.match(header, /v-for="service in status.pendingRestart"/)
|
||||
assert.match(header, /v-for="issue in status.degradedReasons \|\| \[\]"/)
|
||||
assert.match(header, /v-if="!loading && !availabilityError"/)
|
||||
assert.match(header, /:disabled="!!working \|\| sectionLoading \|\| loading"/)
|
||||
assert.match(header, /@click="refreshPage"/)
|
||||
assert.match(header, /canWrite \? '敏感凭据已脱敏' : '只读模式'/)
|
||||
assert.doesNotMatch(header, /<dl class="overview-meta"/)
|
||||
assert.doesNotMatch(header, /access-tag/)
|
||||
assert.doesNotMatch(template, /配置快照|status-panel|status-grid/)
|
||||
assert.match(css, /@container config-main \(max-width: 620px\)/)
|
||||
assert.match(css, /overflow-wrap: anywhere/)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user