简化仪表盘证书当前版本展示
This commit is contained in:
parent
21dad55b45
commit
a98188d458
@ -896,8 +896,7 @@ code {
|
||||
max-width: 1380px;
|
||||
}
|
||||
|
||||
.task-details-modal,
|
||||
.certificate-versions-modal {
|
||||
.task-details-modal {
|
||||
width: min(100%, 860px);
|
||||
}
|
||||
|
||||
@ -958,14 +957,12 @@ code {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.attempt-list,
|
||||
.version-list {
|
||||
.attempt-list {
|
||||
display: grid;
|
||||
gap: 9px;
|
||||
}
|
||||
|
||||
.attempt-row,
|
||||
.version-row {
|
||||
.attempt-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
@ -976,15 +973,13 @@ code {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.attempt-row > div,
|
||||
.version-row > div {
|
||||
.attempt-row > div {
|
||||
display: grid;
|
||||
gap: 5px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.attempt-row strong,
|
||||
.version-row strong {
|
||||
.attempt-row strong {
|
||||
color: #2d4568;
|
||||
font-size: 13px;
|
||||
overflow-wrap: anywhere;
|
||||
@ -997,10 +992,6 @@ code {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.version-row .muted {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.task-detail-summary {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
@ -1016,8 +1007,7 @@ code {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.attempt-row,
|
||||
.version-row {
|
||||
.attempt-row {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,11 +53,6 @@ export function useDashboard() {
|
||||
const taskAttempts = ref([]);
|
||||
const taskDetailsLoading = ref(false);
|
||||
const taskDetailsError = ref("");
|
||||
const showCertificateVersions = ref(false);
|
||||
const certificateVersions = ref([]);
|
||||
const certificateVersionsDomain = ref(null);
|
||||
const certificateVersionsLoading = ref(false);
|
||||
const certificateVersionsError = ref("");
|
||||
const hasOpenModal = computed(
|
||||
() =>
|
||||
showForm.value ||
|
||||
@ -65,8 +60,7 @@ export function useDashboard() {
|
||||
showSSHKeyForm.value ||
|
||||
showSettings.value ||
|
||||
showCertificateImport.value ||
|
||||
showTaskDetails.value ||
|
||||
showCertificateVersions.value,
|
||||
showTaskDetails.value,
|
||||
);
|
||||
let previousBodyOverflow = "";
|
||||
|
||||
@ -668,32 +662,6 @@ export function useDashboard() {
|
||||
taskDetailsError.value = "";
|
||||
}
|
||||
|
||||
async function openCertificateVersions(item) {
|
||||
showCertificateVersions.value = true;
|
||||
certificateVersionsDomain.value = item;
|
||||
certificateVersions.value = [];
|
||||
certificateVersionsError.value = "";
|
||||
certificateVersionsLoading.value = true;
|
||||
try {
|
||||
const response = await fetchAdmin(`/api/v1/domains/${item.id}/certificate/versions`);
|
||||
if (!response.ok) {
|
||||
throw new Error(await responseError(response, "查询证书版本失败"));
|
||||
}
|
||||
certificateVersions.value = (await response.json()).items || [];
|
||||
} catch (err) {
|
||||
certificateVersionsError.value = err.message || "查询证书版本失败";
|
||||
} finally {
|
||||
certificateVersionsLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function closeCertificateVersions() {
|
||||
showCertificateVersions.value = false;
|
||||
certificateVersions.value = [];
|
||||
certificateVersionsDomain.value = null;
|
||||
certificateVersionsError.value = "";
|
||||
}
|
||||
|
||||
async function cancelTask(item) {
|
||||
if (!window.confirm("确定取消这项正在执行的证书任务吗?")) return;
|
||||
error.value = "";
|
||||
@ -1196,13 +1164,6 @@ export function useDashboard() {
|
||||
taskAttempts,
|
||||
taskDetailsLoading,
|
||||
taskDetailsError,
|
||||
openCertificateVersions,
|
||||
closeCertificateVersions,
|
||||
showCertificateVersions,
|
||||
certificateVersions,
|
||||
certificateVersionsDomain,
|
||||
certificateVersionsLoading,
|
||||
certificateVersionsError,
|
||||
taskTypeLabel,
|
||||
auditActionLabel,
|
||||
taskStageLabel,
|
||||
|
||||
@ -100,13 +100,6 @@ const {
|
||||
taskAttempts,
|
||||
taskDetailsLoading,
|
||||
taskDetailsError,
|
||||
openCertificateVersions,
|
||||
closeCertificateVersions,
|
||||
showCertificateVersions,
|
||||
certificateVersions,
|
||||
certificateVersionsDomain,
|
||||
certificateVersionsLoading,
|
||||
certificateVersionsError,
|
||||
displayLabel,
|
||||
formatDate,
|
||||
daysRemaining,
|
||||
@ -323,9 +316,6 @@ const {
|
||||
<button class="text-button" type="button" @click="openCertificateImport(item)">
|
||||
导入证书
|
||||
</button>
|
||||
<button class="text-button" type="button" @click="openCertificateVersions(item)">
|
||||
证书版本
|
||||
</button>
|
||||
<button class="text-button" type="button" @click="openEdit(item)">
|
||||
编辑</button
|
||||
><button
|
||||
@ -1180,6 +1170,7 @@ const {
|
||||
</form>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
<div v-if="showTaskDetails" class="modal-backdrop" @click.self="closeTaskDetails">
|
||||
<section class="modal-card task-details-modal" role="dialog" aria-modal="true" aria-label="任务详情">
|
||||
<div class="modal-heading">
|
||||
@ -1222,35 +1213,6 @@ const {
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div v-if="showCertificateVersions" class="modal-backdrop" @click.self="closeCertificateVersions">
|
||||
<section class="modal-card certificate-versions-modal" role="dialog" aria-modal="true" aria-label="证书版本">
|
||||
<div class="modal-heading">
|
||||
<div>
|
||||
<p class="eyebrow">证书管理</p>
|
||||
<h2>当前证书版本</h2>
|
||||
<p class="muted">{{ certificateVersionsDomain?.name }}</p>
|
||||
</div>
|
||||
<button class="close-button" type="button" aria-label="关闭" @click="closeCertificateVersions">×</button>
|
||||
</div>
|
||||
<div v-if="certificateVersionsLoading" class="empty-state">正在读取证书版本……</div>
|
||||
<p v-else-if="certificateVersionsError" class="form-error">{{ certificateVersionsError }}</p>
|
||||
<div v-else-if="certificateVersions.length === 0" class="empty-state">当前域名还没有已保存的证书版本。</div>
|
||||
<div v-else class="version-list">
|
||||
<article v-for="version in certificateVersions" :key="version.version" class="version-row">
|
||||
<div>
|
||||
<strong>{{ version.version }}</strong>
|
||||
<span class="muted">保存时间:{{ formatDate(version.saved_at || version.created_at) }}</span>
|
||||
<span class="muted">证书目录:{{ version.directory }}</span>
|
||||
</div>
|
||||
<span class="tag success">当前使用</span>
|
||||
</article>
|
||||
</div>
|
||||
<p class="security-hint">当前版本策略只保留正在使用的版本;新证书申请成功后会生成新的日期与 Vx.x 目录。</p>
|
||||
<div class="modal-actions">
|
||||
<button class="secondary-button" type="button" @click="closeCertificateVersions">关闭</button>
|
||||
</div>
|
||||
</section>
|
||||
</div> </div>
|
||||
</main>
|
||||
</template>
|
||||
<style scoped src="./Dashboard.css"></style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user