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:
sagitchu
2026-03-18 14:12:47 +08:00
parent 455900ba41
commit 5972378897
7 changed files with 57 additions and 117 deletions
+13 -3
View File
@@ -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