mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-27 12:39:01 +08:00
fix: 编辑计划任务和病毒扫描告警问题处理 (#7058)
This commit is contained in:
parent
d04a35565e
commit
e1bdd215b1
@ -249,17 +249,15 @@ func (c *ClamService) Update(req dto.ClamUpdate) error {
|
|||||||
if err := clamRepo.Update(req.ID, upMap); err != nil {
|
if err := clamRepo.Update(req.ID, upMap); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if req.AlertCount != 0 {
|
updateAlert := dto.CreateOrUpdateAlert{
|
||||||
updateAlert := dto.CreateOrUpdateAlert{
|
AlertTitle: req.AlertTitle,
|
||||||
AlertTitle: req.AlertTitle,
|
AlertType: "clams",
|
||||||
AlertType: "clams",
|
AlertCount: req.AlertCount,
|
||||||
AlertCount: req.AlertCount,
|
EntryID: clam.ID,
|
||||||
EntryID: clam.ID,
|
}
|
||||||
}
|
err := xpack.UpdateAlert(updateAlert)
|
||||||
err := xpack.UpdateAlert(updateAlert)
|
if err != nil {
|
||||||
if err != nil {
|
return err
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -316,17 +316,15 @@ func (u *CronjobService) Update(id uint, req dto.CronjobUpdate) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if req.AlertCount != 0 {
|
updateAlert := dto.CreateOrUpdateAlert{
|
||||||
updateAlert := dto.CreateOrUpdateAlert{
|
AlertTitle: req.AlertTitle,
|
||||||
AlertTitle: req.AlertTitle,
|
AlertType: cronModel.Type,
|
||||||
AlertType: cronModel.Type,
|
AlertCount: req.AlertCount,
|
||||||
AlertCount: req.AlertCount,
|
EntryID: cronModel.ID,
|
||||||
EntryID: cronModel.ID,
|
}
|
||||||
}
|
err = xpack.UpdateAlert(updateAlert)
|
||||||
err = xpack.UpdateAlert(updateAlert)
|
if err != nil {
|
||||||
if err != nil {
|
return err
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user