@@ -15,6 +15,7 @@ def status():
15
15
16
16
tanks = _get_tank_status ()
17
17
scenarios = _get_active_scenarios ()
18
+ binaries = _get_active_binaries ()
18
19
19
20
# Create a unified table
20
21
table = Table (title = "Warnet Status" , show_header = True , header_style = "bold magenta" )
@@ -37,6 +38,17 @@ def status():
37
38
else :
38
39
table .add_row ("Scenario" , "No active scenarios" , "" )
39
40
41
+ # Add a separator if there are both tanks or scenarios and binaries
42
+ if (tanks or scenarios ) and binaries :
43
+ table .add_row ("" , "" , "" )
44
+
45
+ # Add binaries to the table
46
+ if binaries :
47
+ for binary in binaries :
48
+ table .add_row ("Binary" , binary ["name" ], binary ["status" ])
49
+ else :
50
+ table .add_row ("Binaries" , "No active binaries" , "" )
51
+
40
52
# Create a panel to wrap the table
41
53
panel = Panel (
42
54
table ,
@@ -53,6 +65,7 @@ def status():
53
65
summary = Text ()
54
66
summary .append (f"\n Total Tanks: { len (tanks )} " , style = "bold cyan" )
55
67
summary .append (f" | Active Scenarios: { len (scenarios )} " , style = "bold green" )
68
+ summary .append (f" | Active Binaries: { len (binaries )} " , style = "bold red" )
56
69
console .print (summary )
57
70
_connected (end = "\r " )
58
71
@@ -65,3 +78,7 @@ def _get_tank_status():
65
78
def _get_active_scenarios ():
66
79
commanders = get_mission ("commander" )
67
80
return [{"name" : c .metadata .name , "status" : c .status .phase .lower ()} for c in commanders ]
81
+
82
+ def _get_active_binaries ():
83
+ binaries = get_mission ("binary" )
84
+ return [{"name" : b .metadata .name , "status" : b .status .phase .lower ()} for b in binaries ]
0 commit comments