mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #11862 from zhaoxiangchun/feature/zxc-meter-pro-domain-master
fix(monitor): add used_by list filter
This commit is contained in:
@@ -100,6 +100,7 @@ type CommonAlertListInput struct {
|
||||
|
||||
Level string `json:"level"`
|
||||
ResType []string `json:"res_type"`
|
||||
UsedBy string `json:"used_by"`
|
||||
}
|
||||
|
||||
type CommonAlertUpdateInput struct {
|
||||
|
||||
@@ -408,7 +408,11 @@ func (man *SCommonAlertManager) ListItemFilter(
|
||||
}
|
||||
|
||||
func (man *SCommonAlertManager) FieldListFilter(q *sqlchemy.SQuery, input monitor.CommonAlertListInput) {
|
||||
q.Filter(sqlchemy.IsNull(q.Field("used_by")))
|
||||
if len(input.UsedBy) == 0 {
|
||||
q.Filter(sqlchemy.IsNull(q.Field("used_by")))
|
||||
} else {
|
||||
q.Equals("used_by", input.UsedBy)
|
||||
}
|
||||
|
||||
if len(input.Level) > 0 {
|
||||
q.Equals("level", input.Level)
|
||||
|
||||
Reference in New Issue
Block a user