bug fixes (#918)

* bug fixes

* fix for backward compatibility

* fix init

* cleanup

* possible fix

* optimize permission check

* Revert "possible fix"

This reverts commit 003f1bbb2aa368aade6702e6019922b7f4871a39.
This commit is contained in:
UUBulb authored and GitHub committed 2024-12-26 23:38:40 +08:00
1 parent fa24f90000
commit d70cfe9ee9
5 files changed
+16 -10

No files matched your search

+4 -1
View File
@@ -151,8 +151,11 @@ func checkStatus() {
role = u.Role
}
UserLock.RUnlock()
if alert.UserID != server.UserID && role != model.RoleAdmin {
continue
}
alertsStore[alert.ID][server.ID] = append(alertsStore[alert.
ID][server.ID], alert.Snapshot(AlertsCycleTransferStatsStore[alert.ID], server, DB, role))
ID][server.ID], alert.Snapshot(AlertsCycleTransferStatsStore[alert.ID], server, DB))
// 发送通知,分为触发报警和恢复通知
max, passed := alert.Check(alertsStore[alert.ID][server.ID])
// 保存当前服务器状态信息