mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-29 10:53:14 +08:00
fix: Fix the issue of monitoring fields not being generated properly (#11153)
This commit is contained in:
parent
ff9747560e
commit
c0796dc7c4
3 changed files with 11 additions and 5 deletions
|
|
@ -43,6 +43,8 @@ type Cronjob struct {
|
|||
EntryIDs string `json:"entryIDs"`
|
||||
Records []JobRecords `json:"records"`
|
||||
Secret string `json:"secret"`
|
||||
|
||||
Config string `json:"config"`
|
||||
}
|
||||
|
||||
type JobRecords struct {
|
||||
|
|
|
|||
|
|
@ -2,14 +2,18 @@ package model
|
|||
|
||||
type MonitorBase struct {
|
||||
BaseModel
|
||||
Cpu float64 `json:"cpu"`
|
||||
Cpu float64 `json:"cpu"`
|
||||
TopCPU string `json:"topCPU"`
|
||||
TopCPUItems interface{} `gorm:"-" json:"topCPUItems"`
|
||||
|
||||
Memory float64 `json:"memory"`
|
||||
TopMem string `json:"topMem"`
|
||||
TopMemItems interface{} `gorm:"-" json:"topMemItems"`
|
||||
|
||||
LoadUsage float64 `json:"loadUsage"`
|
||||
CpuLoad1 float64 `json:"cpuLoad1"`
|
||||
CpuLoad5 float64 `json:"cpuLoad5"`
|
||||
CpuLoad15 float64 `json:"cpuLoad15"`
|
||||
|
||||
Memory float64 `json:"memory"`
|
||||
}
|
||||
|
||||
type MonitorIO struct {
|
||||
|
|
|
|||
|
|
@ -661,14 +661,14 @@ var UpdateMonitorInterval = &gormigrate.Migration{
|
|||
}
|
||||
|
||||
var AddMonitorProcess = &gormigrate.Migration{
|
||||
ID: "20251030-add-monitor-process",
|
||||
ID: "20251202-add-monitor-process",
|
||||
Migrate: func(tx *gorm.DB) error {
|
||||
return global.MonitorDB.AutoMigrate(&model.MonitorBase{})
|
||||
},
|
||||
}
|
||||
|
||||
var UpdateCronJob = &gormigrate.Migration{
|
||||
ID: "20251105-update-cronjob",
|
||||
ID: "20251202-update-cronjob",
|
||||
Migrate: func(tx *gorm.DB) error {
|
||||
return tx.AutoMigrate(&model.Cronjob{})
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue