diff --git a/agent/app/dto/monitor.go b/agent/app/dto/monitor.go index 9fbf9d9a2..614cf4e45 100644 --- a/agent/app/dto/monitor.go +++ b/agent/app/dto/monitor.go @@ -4,7 +4,8 @@ import "time" type MonitorSearch struct { Param string `json:"param" validate:"required,oneof=all cpu memory load io network"` - Info string `json:"info"` + IO string `json:"io"` + Network string `json:"network"` StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` } @@ -19,7 +20,7 @@ type Process struct { Name string `json:"name"` Pid int32 `json:"pid"` Percent float64 `json:"percent"` - Memory uint64 `json:"memory"` + Memory uint64 `json:"memory"` Cmd string `json:"cmd"` User string `json:"user"` } diff --git a/agent/app/service/monitor.go b/agent/app/service/monitor.go index f09d94773..775861c04 100644 --- a/agent/app/service/monitor.go +++ b/agent/app/service/monitor.go @@ -83,7 +83,7 @@ func (m *MonitorService) LoadMonitorData(req dto.MonitorSearch) ([]dto.MonitorDa data = append(data, itemData) } if req.Param == "all" || req.Param == "io" { - bases, err := monitorRepo.GetIO(repo.WithByName(req.Info), repo.WithByCreatedAt(req.StartTime, req.EndTime)) + bases, err := monitorRepo.GetIO(repo.WithByName(req.IO), repo.WithByCreatedAt(req.StartTime, req.EndTime)) if err != nil { return nil, err } @@ -97,7 +97,7 @@ func (m *MonitorService) LoadMonitorData(req dto.MonitorSearch) ([]dto.MonitorDa data = append(data, itemData) } if req.Param == "all" || req.Param == "network" { - bases, err := monitorRepo.GetNetwork(repo.WithByName(req.Info), repo.WithByCreatedAt(req.StartTime, req.EndTime)) + bases, err := monitorRepo.GetNetwork(repo.WithByName(req.Network), repo.WithByCreatedAt(req.StartTime, req.EndTime)) if err != nil { return nil, err } diff --git a/frontend/src/api/interface/host.ts b/frontend/src/api/interface/host.ts index 622beaaa1..316826794 100644 --- a/frontend/src/api/interface/host.ts +++ b/frontend/src/api/interface/host.ts @@ -151,7 +151,8 @@ export namespace Host { } export interface MonitorSearch { param: string; - info: string; + io: string; + network: string; startTime: Date; endTime: Date; } diff --git a/frontend/src/views/cronjob/cronjob/record/index.vue b/frontend/src/views/cronjob/cronjob/record/index.vue index 8b652e66f..75ae4a862 100644 --- a/frontend/src/views/cronjob/cronjob/record/index.vue +++ b/frontend/src/views/cronjob/cronjob/record/index.vue @@ -382,7 +382,7 @@ const search = async (changeToLatest: boolean) => { if (!hasRecords.value) { return; } - if (changeToLatest) { + if (changeToLatest || !currentRecord.value) { currentRecord.value = records.value[0]; return; } diff --git a/frontend/src/views/host/firewall/ip/index.vue b/frontend/src/views/host/firewall/ip/index.vue index a2b288242..bf94b4377 100644 --- a/frontend/src/views/host/firewall/ip/index.vue +++ b/frontend/src/views/host/firewall/ip/index.vue @@ -19,6 +19,15 @@ +