@@ -15,6 +15,7 @@ def status():
15
15
16
16
tanks = _get_tank_status ()
17
17
scenarios = _get_deployed_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" )
@@ -40,6 +41,20 @@ def status():
40
41
else :
41
42
table .add_row ("Scenario" , "No active scenarios" , "" )
42
43
44
+ # Add a separator if there are both tanks or scenarios and binaries
45
+ if (tanks or scenarios ) and binaries :
46
+ table .add_row ("" , "" , "" )
47
+
48
+ # Add binaries to the table
49
+ active_binaries = 0
50
+ if binaries :
51
+ for binary in binaries :
52
+ table .add_row ("Binary" , binary ["name" ], binary ["status" ])
53
+ if binary ["status" ] == "running" or binary ["status" ] == "pending" :
54
+ active_binaries += 1
55
+ else :
56
+ table .add_row ("Binaries" , "No active binaries" , "" )
57
+
43
58
# Create a panel to wrap the table
44
59
panel = Panel (
45
60
table ,
@@ -56,6 +71,7 @@ def status():
56
71
summary = Text ()
57
72
summary .append (f"\n Total Tanks: { len (tanks )} " , style = "bold cyan" )
58
73
summary .append (f" | Active Scenarios: { active } " , style = "bold green" )
74
+ summary .append (f" | Active Binaries: { active_binaries } " , style = "bold red" )
59
75
console .print (summary )
60
76
_connected (end = "\r " )
61
77
@@ -68,3 +84,8 @@ def _get_tank_status():
68
84
def _get_deployed_scenarios ():
69
85
commanders = get_mission ("commander" )
70
86
return [{"name" : c .metadata .name , "status" : c .status .phase .lower ()} for c in commanders ]
87
+
88
+
89
+ def _get_active_binaries ():
90
+ binaries = get_mission ("binary" )
91
+ return [{"name" : b .metadata .name , "status" : b .status .phase .lower ()} for b in binaries ]
0 commit comments