mirror of
https://github.com/henrygd/beszel.git
synced 2026-09-21 08:57:48 +02:00
feat: add network monitors (ICMP/TCP/HTTP/DNS) (#2266)
Co-authored-by: xiaomiku01 <xiaomiku01@outlook.com> Co-authored-by: henrygd <hank@henrygd.me>
This commit is contained in:
@@ -29,6 +29,13 @@ func UpsertUserAlerts(e *core.RequestEvent) error {
|
||||
return e.BadRequestError("Bad data", err)
|
||||
}
|
||||
|
||||
if reqData.Name == alertNameNetworkMonitorLoss {
|
||||
if reqData.Value < 0 || reqData.Value >= 100 {
|
||||
return e.BadRequestError("Monitor loss threshold must be at least 0 and below 100", nil)
|
||||
}
|
||||
reqData.Min = 0
|
||||
}
|
||||
|
||||
alertsCollection, err := e.App.FindCachedCollectionByNameOrId("alerts")
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user