Implement bad connections baseline reset functionality
Publish telemt-api gateway Docker image / test (push) Successful in 9s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 2m1s

- Added a new field `badConnBaseline` in the `Handler` struct to store the baseline for bad connections.
- Updated the `BuildIncidents` function to utilize the effective bad connections count for incident generation.
- Introduced a new API endpoint `/api/agg/bad-connections/reset` to reset the bad connections baseline.
- Enhanced the frontend with a button to trigger the reset action, providing user feedback through toast notifications.
- Updated Svelte components to handle the reset functionality and display appropriate messages based on the operation's success or failure.
This commit is contained in:
Denozordec
2026-04-12 13:30:56 +07:00
parent ea2ecb44d2
commit d1095081bc
8 changed files with 233 additions and 4 deletions
+4
View File
@@ -308,6 +308,10 @@ func (g *Gateway) serve(w http.ResponseWriter, r *http.Request) {
proxy.NormalizeRequestURLPath(r)
}
const prefix = "/api/"
if r.Method == http.MethodPost && r.URL.Path == "/api/agg/bad-connections/reset" {
g.agg.HandleResetBadConnectionsBaseline(w, r)
return
}
if r.URL.Path == "/api/agg" || strings.HasPrefix(r.URL.Path, "/api/agg/") {
g.agg.ServeHTTP(w, r)
return