feat: Agent采集uptime, 后端持久化kernel/uptime/diskIO, 前端磁盘BPS+IOPS展示
- Agent: system.go 添加 readUptime(), SystemStat 携带 Uptime - Backend: Server 模型新增 Kernel 字段, ReceiveReport 持久化 kernel+uptime - Backend: /agent/latest 返回 kernel/uptime/port_info/disk_io_info/disk_total - Frontend: 磁盘监控改为 BPS+IOPS (4张卡片), 系统信息修复内核/运行时长/监听端口/磁盘容量 - 图表单位从 MB/s 改为 KB/s, 添加 formatBPS 工具函数
This commit is contained in:
1 parent
31c2e338a3
commit
5949ec5d0c
48 files changed
+2182
-956
No files matched your search
@@ -3,7 +3,6 @@ package models
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// AnsiblePlaybook Playbook 模型 // Logan.Li
|
||||
@@ -17,10 +16,9 @@ type AnsiblePlaybook struct {
|
||||
CreatedBy string `gorm:"size:255" json:"created_by"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
}
|
||||
|
||||
func (AnsiblePlaybook) TableName() string { return "ansible_playbooks" }
|
||||
func (AnsiblePlaybook) TableName() string { return "ops_ansible_playbooks" }
|
||||
|
||||
// AnsibleJob 执行任务记录 // Logan.Li
|
||||
type AnsibleJob struct {
|
||||
@@ -37,10 +35,9 @@ type AnsibleJob struct {
|
||||
CompletedAt *time.Time `json:"completed_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
}
|
||||
|
||||
func (AnsibleJob) TableName() string { return "ansible_jobs" }
|
||||
func (AnsibleJob) TableName() string { return "ops_ansible_jobs" }
|
||||
|
||||
// AnsibleInventory 主机清单 // Logan.Li
|
||||
type AnsibleInventory struct {
|
||||
@@ -51,10 +48,9 @@ type AnsibleInventory struct {
|
||||
CreatedBy string `gorm:"size:255" json:"created_by"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
}
|
||||
|
||||
func (AnsibleInventory) TableName() string { return "ansible_inventories" }
|
||||
func (AnsibleInventory) TableName() string { return "ops_ansible_inventories" }
|
||||
|
||||
// LogSource 日志源 // Logan.Li
|
||||
type LogSource struct {
|
||||
@@ -67,10 +63,9 @@ type LogSource struct {
|
||||
LastSeen *time.Time `json:"last_seen"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
}
|
||||
|
||||
func (LogSource) TableName() string { return "log_sources" }
|
||||
func (LogSource) TableName() string { return "sys_log_sources" }
|
||||
|
||||
// LogEntry 日志条目 // Logan.Li
|
||||
type LogEntry struct {
|
||||
@@ -84,7 +79,6 @@ type LogEntry struct {
|
||||
TraceID string `gorm:"size:100;index" json:"trace_id"`
|
||||
Raw string `gorm:"type:text" json:"raw"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
}
|
||||
|
||||
func (LogEntry) TableName() string { return "log_entries" }
|
||||
func (LogEntry) TableName() string { return "sys_log_entries" }
|
||||
Reference in new issue
Block a user