mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-11 19:56:37 +08:00
fix: resolve merge conflicts and fix monitoring bugs
- Add missing 'uptime' field to NodeMetricApiItem type definition - Fix WS message handling: non-UpgradeProgress typed messages now broadcast via broadcastInfo instead of being silently dropped - Strengthen looksLikeSystemInfoMessage heuristic to require ≥3 matching keys to avoid false positives - Fix tab/space indentation inconsistency in admin.tsx useEffect - Remove duplicate method declarations from merge (repository_control, mutations) - Update tunnel_entry_sqlite_test to use renamed Tx suffix function
This commit is contained in:
@@ -258,10 +258,16 @@ func (s *Server) handleNode(w http.ResponseWriter, r *http.Request, nodeID int64
|
||||
Type string `json:"type"`
|
||||
}
|
||||
if json.Unmarshal([]byte(msg), &parsed) == nil && parsed.Type != "" {
|
||||
if parsed.Type == "UpgradeProgress" {
|
||||
switch parsed.Type {
|
||||
case "UpgradeProgress":
|
||||
s.broadcastTyped(nodeID, "upgrade_progress", msg)
|
||||
continue
|
||||
default:
|
||||
// Unknown typed messages still get broadcast so future
|
||||
// agent message types are not silently lost.
|
||||
s.broadcastInfo(nodeID, msg)
|
||||
continue
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if looksLikeSystemInfoMessage(msg) {
|
||||
@@ -308,9 +314,13 @@ func looksLikeSystemInfoMessage(msg string) bool {
|
||||
"\"load5\"",
|
||||
"\"load15\"",
|
||||
}
|
||||
matched := 0
|
||||
for _, k := range keys {
|
||||
if strings.Contains(msg, k) {
|
||||
return true
|
||||
matched++
|
||||
if matched >= 3 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user