in azext_edge/edge/providers/orchestration/work.py [0:0]
def _render_display(self, category: Optional[WorkCategoryKey] = None, active_step: Optional[WorkStepKey] = None):
if active_step:
self._active_step = active_step
if self._show_progress:
grid = Table.grid(expand=False)
grid.add_column()
header_grid = Table.grid(expand=False)
header_grid.add_column()
header_grid.add_row(NewLine(1))
header_grid.add_row(
"[light_slate_gray]Azure IoT Operations",
style=Style(bold=True),
)
header_grid.add_row(f"Workflow Id: [dark_orange3]{self._work_id}")
header_grid.add_row(NewLine(1))
content_grid = Table.grid(expand=False)
content_grid.add_column(max_width=3)
content_grid.add_column(max_width=64)
active_cat_str = "[cyan]->[/cyan] "
active_step_str = "[cyan]*[/cyan]"
complete_str = "[green]:heavy_check_mark:[/green]"
for c in self._display.categories:
cat_prefix = active_cat_str if c == category else ""
content_grid.add_row(
cat_prefix,
f"{self._display.categories[c][0].title} "
f"{'[[dark_khaki]skipped[/dark_khaki]]' if self._display.categories[c][1] else ''}",
)
if self._display.categories[c][0].description:
content_grid.add_row(
"",
Padding(
self._display.categories[c][0].description,
(0, 0, 0, 4),
),
)
if c in self._display.steps:
for s in self._display.steps[c]:
if s in self._completed_steps:
step_prefix = complete_str
elif s == self._active_step:
step_prefix = active_step_str
else:
step_prefix = "-"
content_grid.add_row(
"",
Padding(
f"{step_prefix} {self._display.steps[c][s].title} ",
(0, 0, 0, 2),
),
)
if self._display.steps[c][s].description:
content_grid.add_row(
"",
Padding(
self._display.steps[c][s].description,
(0, 0, 0, 4),
),
)
content_grid.add_row(NewLine(1), NewLine(1))
footer_grid = Table.grid(expand=False)
footer_grid.add_column()
footer_grid.add_row(self._progress_bar)
footer_grid.add_row(NewLine(1))
grid.add_row(header_grid)
grid.add_row(content_grid)
grid.add_row(footer_grid)
if not self._progress_shown:
self._task_id = self._progress_bar.add_task(description="Work.", total=None)
self._progress_shown = True
self._live.update(grid)
sleep(0.5) # min presentation delay
if self._show_progress and not self._live.is_started:
self._live.start(True)