feat(agent): agent 0.11.0 新增证书清单与 Nginx 重载,公网 Agent 页并排展示 VPS 资源与证书(v1.2.5)

agent 0.11.0:新增 GET /api/v1/certs(遍历证书目录、crypto/x509 解析 fullchain.pem 到期时间、按剩余天数排序、解析失败记 warnings)与 POST /api/v1/nginx/reload(回传 nginx -t 与 reload 的失败原因,成功后失效可用性探测缓存)

应用侧:AgentClient.Certs / NginxReload + service / handler / router;agent 版本要求提到 ≥ 0.11.0(旧版本仍按 404/405 降级为升级提示)

前端:公网 Agent 页新增「VPS 证书」卡(域名/剩余天数/Fonu 证书库/到期时间,与 Fonu 证书库交叉核对);Nginx 卡新增「重载 Nginx」并显示失败原因;VPS 资源与 VPS 证书改为并排各占半行(dep-grid 6 列 + span 分配,窄屏复位)

二进制:内嵌 fonu-agent-linux-amd64 / arm64 重编;VERSION → 1.2.5
This commit is contained in:
2026-09-24 10:49:28 +08:00
parent 2f59f5adc4
commit 828be2ea66
13 changed files with 386 additions and 15 deletions
+7 -1
View File
@@ -290,7 +290,13 @@ export const api = {
uninstallFrpAgent: (id: number, keepData: boolean) => request<{ ok: boolean; output: string }>(`/api/frpmulti/servers/${id}/agent/uninstall?keep_data=${keepData}`, { method: 'POST' }),
sshDiagnoseFrpAgent: (id: number) => request<{ output: string }>(`/api/frpmulti/servers/${id}/agent/ssh-diagnose`, { method: 'POST' }),
getFrpAgentStatus: (id: number) => request<import('./types').FrpAgentStatus>(`/api/frpmulti/servers/${id}/agent/status`),
getFrpAgentMetrics: (id: number) =>
getFrpAgentCerts: (id: number) =>
request<import('./types').FrpAgentCerts>(`/api/frpmulti/servers/${id}/agent/certs`),
reloadFrpAgentNginx: (id: number) =>
request<import('./types').FrpAgentNginxReload>(`/api/frpmulti/servers/${id}/agent/nginx/reload`, {
method: 'POST',
}),
getFrpAgentMetrics: (id: number) =>
request<import('./types').FrpAgentMetrics>(`/api/frpmulti/servers/${id}/agent/metrics`),
getFrpAgentNginxLogs: (id: number, type: 'access' | 'error', lines = 200) =>
request<import('./types').FrpAgentNginxLogs>(
+24
View File
@@ -736,6 +736,30 @@ export interface FrpRouteHealthSummary {
failed_servers?: string[]
}
export interface FrpAgentCertificate {
domain: string
cert_path: string
key_path: string
not_after?: string
days_left: number
}
export interface FrpAgentCerts {
certs: FrpAgentCertificate[]
warnings?: string[]
dir?: string
checked_at: string
}
export interface FrpAgentNginxReload {
ok: boolean
test_ok?: boolean
test_error?: string
reload_ok?: boolean
reload_error?: string
checked_at: string
}
export interface FrpAgentMetrics {
cpu_percent: number
mem_used_bytes: number