fix: guard dashboard health panel
This commit is contained in:
@@ -293,8 +293,10 @@ class ReactorDashboard:
|
||||
return row + 1
|
||||
|
||||
def _draw_health_bar(self, win: "curses._CursesWindow", start_y: int) -> None:
|
||||
win.addstr(start_y, 2, "Component Health", curses.A_BOLD | curses.color_pair(1))
|
||||
height, width = win.getmaxyx()
|
||||
if start_y >= height - 2:
|
||||
return
|
||||
win.addstr(start_y, 2, "Component Health", curses.A_BOLD | curses.color_pair(1))
|
||||
bar_width = max(10, min(width - 28, 40))
|
||||
for idx, (name, comp) in enumerate(self.reactor.health_monitor.components.items(), start=1):
|
||||
filled = int(bar_width * comp.integrity)
|
||||
|
||||
Reference in New Issue
Block a user