修复列宽度/不显示过期时间的问题
This commit is contained in:
@@ -267,6 +267,19 @@ class AcmeService:
|
||||
cert_info = {}
|
||||
if success:
|
||||
cert_path = domain_dir / "fullchain.pem"
|
||||
logger.info(f"证书路径: {cert_path}, 存在: {cert_path.exists()}")
|
||||
# 如果自定义路径没有,尝试从 certbot live 目录复制
|
||||
if not cert_path.exists():
|
||||
import shutil
|
||||
certbot_live = self.cert_dir / ".certbot-config" / "live" / store_dir
|
||||
src = certbot_live / "fullchain.pem"
|
||||
logger.info(f"尝试从 certbot live 复制: {src}, 存在: {src.exists()}")
|
||||
if src.exists():
|
||||
shutil.copy2(str(src), str(cert_path))
|
||||
key_src = certbot_live / "privkey.pem"
|
||||
if key_src.exists():
|
||||
shutil.copy2(str(key_src), str(domain_dir / "private.key"))
|
||||
|
||||
if cert_path.exists():
|
||||
try:
|
||||
cert_data = cert_path.read_bytes()
|
||||
@@ -287,9 +300,14 @@ class AcmeService:
|
||||
"issuer": cert.issuer.rfc4514_string(),
|
||||
}
|
||||
msg = f"签发成功,过期时间: {not_after.strftime('%Y-%m-%d %H:%M:%S')}, SAN: {san}"
|
||||
logger.info(msg)
|
||||
return True, msg, cert_info, output
|
||||
except Exception as e:
|
||||
logger.error(f"解析证书失败: {e}")
|
||||
return True, f"签发成功但解析证书失败: {e}", cert_info, output
|
||||
else:
|
||||
logger.error(f"证书文件不存在: {cert_path}")
|
||||
return True, f"certbot 成功但未找到证书文件: {cert_path}", cert_info, output
|
||||
|
||||
return success, output, cert_info, output
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user