This commit is contained in:
ygx
2026-03-29 20:54:14 +08:00
parent 9a6f224b9b
commit a96208d5c8
2 changed files with 20 additions and 1 deletions

View File

@@ -34,7 +34,7 @@ export const columns = [
{
dataIndex: 'agent_config',
title: 'Agent配置',
width: 100,
width: 120,
slotName: 'agent_config',
},
{
@@ -64,6 +64,7 @@ export const columns = [
dataIndex: 'last_check_time',
title: '最后检查时间',
width: 180,
slotName: 'last_check_time',
},
{
dataIndex: 'actions',

View File

@@ -56,6 +56,11 @@
{{ formatUptime(record.uptime) }}
</template>
<!-- 最后检查时间 -->
<template #last_check_time="{ record }">
{{ formatTime(record.last_check_time) }}
</template>
<!-- 状态 -->
<template #status="{ record }">
<a-tag :color="getStatusColor(record.status)">
@@ -233,6 +238,19 @@ const formatUptime = (uptime?: number) => {
return `${minutes}分钟`
}
// 格式化时间
const formatTime = (time?: string) => {
if (!time) return '-'
const date = new Date(time)
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
}
// 获取中间件列表
const fetchMiddlewareData = async () => {
loading.value = true