修复列宽度/不显示过期时间的问题

This commit is contained in:
2026-07-20 10:47:08 +08:00
parent 1d8fe97a49
commit 6d9013e9fd
4 changed files with 40 additions and 13 deletions
+4 -4
View File
@@ -7,17 +7,17 @@
<el-card>
<el-table :data="configs" stripe style="width: 100%;">
<el-table-column prop="name" label="名称" width="160">
<el-table-column prop="name" label="名称" min-width="140">
<template #default="{ row }">
<span style="font-weight: 600;">{{ row.name }}</span>
</template>
</el-table-column>
<el-table-column prop="acme_server" label="ACME 服务器" width="200">
<el-table-column prop="acme_server" label="ACME 服务器" min-width="160">
<template #default="{ row }">
{{ row.acme_server.includes('staging') ? '测试' : '生产' }}
</template>
</el-table-column>
<el-table-column prop="email" label="邮箱" width="180" />
<el-table-column prop="email" label="邮箱" min-width="160" />
<el-table-column prop="dns_provider" label="DNS 提商" width="120">
<template #default="{ row }">
<el-tag size="small">{{ row.dns_provider === 'aliyun' ? '阿里云' : row.dns_provider }}</el-tag>
@@ -27,7 +27,7 @@
<el-table-column label="关联域名" width="100">
<template #default="{ row }">{{ row.domain_count }}</template>
</el-table-column>
<el-table-column label="操作" width="200" align="right">
<el-table-column label="操作" min-width="180" align="right">
<template #default="{ row }">
<el-button type="primary" link size="small" @click="openEdit(row)">编辑</el-button>
<el-button type="warning" link size="small" :loading="renewingId === row.id" @click="autoRenew(row)">续签</el-button>
+14 -5
View File
@@ -7,7 +7,7 @@
<el-card>
<el-table :data="domains" stripe style="width: 100%;">
<el-table-column prop="domain" label="域名" width="240">
<el-table-column prop="domain" label="域名" min-width="180">
<template #default="{ row }">
<span style="font-weight: 600;">{{ row.domain }}</span>
</template>
@@ -31,17 +31,17 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="过期时间" width="170">
<el-table-column label="过期时间" width="150">
<template #default="{ row }">
<span :style="{ color: isExpiringSoon(row.expiry_date) ? '#f56c6c' : '#606266' }">
{{ row.expiry_date || '-' }}
<span :style="{ color: isExpiringSoon(row.cert_not_after) ? '#f56c6c' : '#606266' }">
{{ row.cert_not_after ? formatDate(row.cert_not_after) : '-' }}
</span>
</template>
</el-table-column>
<el-table-column label="版本" width="70">
<template #default="{ row }">{{ row.version }}</template>
</el-table-column>
<el-table-column label="操作" width="300" align="right">
<el-table-column label="操作" min-width="280" align="right">
<template #default="{ row }">
<div style="display: flex; align-items: center; gap: 4px; justify-content: flex-end;">
<el-button type="primary" link size="small" @click="openEdit(row)">编辑</el-button>
@@ -201,6 +201,15 @@ const isExpiringSoon = (dateStr) => {
return diff < 30
}
const formatDate = (dateStr) => {
if (!dateStr) return '-'
const d = new Date(dateStr)
const y = d.getFullYear()
const m = String(d.getMonth() + 1).padStart(2, '0')
const day = String(d.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
}
// ---- 域名表单 ----
const openCreate = () => {
isEdit.value = false
+4 -4
View File
@@ -7,7 +7,7 @@
<el-card>
<el-table :data="servers" stripe style="width: 100%;">
<el-table-column prop="name" label="名称" width="160">
<el-table-column prop="name" label="名称" min-width="140">
<template #default="{ row }">
<span style="font-weight: 600;">{{ row.name }}</span>
</template>
@@ -17,16 +17,16 @@
<el-tag :type="row.platform === 'linux' ? 'warning' : ''" size="small">{{ row.platform }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="ip" label="IP" width="140">
<el-table-column prop="ip" label="IP" min-width="140">
<template #default="{ row }">{{ row.ip || '-' }}</template>
</el-table-column>
<el-table-column prop="domain_count" label="域名数" width="80" />
<el-table-column label="Token" width="180">
<el-table-column label="Token" min-width="180">
<template #default="{ row }">
<code style="background: #f5f7fa; padding: 2px 8px; border-radius: 4px; font-size: 12px;">{{ row.token.substring(0, 12) }}...</code>
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="right">
<el-table-column label="操作" min-width="140" align="right">
<template #default="{ row }">
<el-button type="primary" link size="small" @click="openEdit(row)">编辑</el-button>
<el-button type="danger" link size="small" @click="handleDelete(row)">删除</el-button>