mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-04 12:47:28 +08:00
harden node lifecycle with ttl heartbeat audits, action ACL checks, and status panel
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"clawgo/pkg/config"
|
||||
"clawgo/pkg/nodes"
|
||||
"clawgo/pkg/providers"
|
||||
)
|
||||
func statusCmd() {
|
||||
@@ -158,6 +159,23 @@ func statusCmd() {
|
||||
}
|
||||
fmt.Printf("Autonomy Control: %s\n", autonomyControlState(workspace))
|
||||
}
|
||||
ns := nodes.DefaultManager().List()
|
||||
if len(ns) > 0 {
|
||||
online := 0
|
||||
caps := map[string]int{"run": 0, "camera": 0, "screen": 0, "location": 0, "canvas": 0}
|
||||
for _, n := range ns {
|
||||
if n.Online {
|
||||
online++
|
||||
}
|
||||
if n.Capabilities.Run { caps["run"]++ }
|
||||
if n.Capabilities.Camera { caps["camera"]++ }
|
||||
if n.Capabilities.Screen { caps["screen"]++ }
|
||||
if n.Capabilities.Location { caps["location"]++ }
|
||||
if n.Capabilities.Canvas { caps["canvas"]++ }
|
||||
}
|
||||
fmt.Printf("Nodes: total=%d online=%d\n", len(ns), online)
|
||||
fmt.Printf("Nodes Capabilities: run=%d camera=%d screen=%d location=%d canvas=%d\n", caps["run"], caps["camera"], caps["screen"], caps["location"], caps["canvas"])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user