snapshot: 数据源管理+大屏增强前快照

This commit is contained in:
attacker committed 2026-06-18 14:01:22 +00:00
1 parent 2bf3e7c308
commit 1726ad65ac
19 files changed
+2540 -273

No files matched your search

+28 -8
View File
@@ -32,16 +32,36 @@ func (AgentReport) TableName() string {
return "agent_reports"
}
// AgentLatestResponse Agent 最新状态(含服务器元信息)// Logan.Li
type AgentLatestResponse struct {
Hostname string `json:"hostname"`
IP string `json:"ip"`
CPUUsage float64 `json:"cpu_usage"`
CPUCores int `json:"cpu_cores"`
MemUsage float64 `json:"mem_usage"`
MemTotal float64 `json:"mem_total"`
MemUsed float64 `json:"mem_used"`
DiskUsage float64 `json:"disk_usage"`
DiskInfo string `json:"disk_info"`
NetInfo string `json:"net_info"`
ReportTime string `json:"report_time"`
AgentVersion string `json:"agent_version"`
AgentStatus string `json:"agent_status"`
OS string `json:"os"`
Region string `json:"region"`
}
// AgentReportRequest Agent 上报请求体 // Logan.Li
type AgentReportRequest struct {
Hostname string `json:"hostname" binding:"required"`
Timestamp string `json:"timestamp"`
CPU CPUMetric `json:"cpu"`
Memory MemMetric `json:"memory"`
Disks []DiskMetric `json:"disks"`
Ports []PortMetric `json:"ports"`
Network NetworkStat `json:"network"` // 网络指标
DiskIO DiskIOStat `json:"disk_io"` // 磁盘 IO
Hostname string `json:"hostname" binding:"required"`
Timestamp string `json:"timestamp"`
AgentVersion string `json:"agent_version"` // Agent 版本号
CPU CPUMetric `json:"cpu"`
Memory MemMetric `json:"memory"`
Disks []DiskMetric `json:"disks"`
Ports []PortMetric `json:"ports"`
Network NetworkStat `json:"network"` // 网络指标
DiskIO DiskIOStat `json:"disk_io"` // 磁盘 IO
}
type CPUMetric struct {