Skip to content

Commit f58b03a

Browse files
committed
optimize result display
1 parent 61f297a commit f58b03a

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

bale/tabs/__init__.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,16 @@ async def _display_result(self, result: Result) -> None:
9191
with el.WColumn():
9292
with el.Card() as card:
9393
card.tailwind.width("full")
94+
with el.WColumn():
95+
ui.label(f"#> {result.command}").classes("text-secondary")
9496
with el.WRow() as row:
9597
row.tailwind.justify_content("around")
96-
with ui.column() as col:
97-
col.tailwind.max_width("lg")
98-
ui.label(f"Host Name: {result.name}").classes("text-secondary")
99-
ui.label(f"Command: {result.command}").classes("text-secondary")
100-
timestamp = await ui.run_javascript(
101-
f"new Date({result.timestamp} * 1000).toLocaleString(undefined, {{dateStyle: 'short', timeStyle: 'short', hour12: 'false'}});"
102-
)
103-
ui.label(f"Timestamp: {timestamp}").classes("text-secondary")
104-
with ui.column() as col:
105-
col.tailwind.max_width("lg")
106-
ui.label(f"Task has failed: {result.failed}").classes("text-secondary")
107-
ui.label(f"Data is cached: {result.cached}").classes("text-secondary")
98+
ui.label(f"Host: {result.name}").classes("text-secondary")
99+
timestamp = await ui.run_javascript(
100+
f"new Date({result.timestamp} * 1000).toLocaleString(undefined, {{dateStyle: 'short', timeStyle: 'short', hour12: 'false'}});"
101+
)
102+
ui.label(f"Timestamp: {timestamp}").classes("text-secondary")
103+
ui.label(f"Return Code: {result.return_code}").classes("text-secondary")
108104
with el.Card() as card:
109105
with el.WColumn():
110106
terminal = cli.Terminal(options={"rows": 18, "cols": 120, "convertEol": True})

0 commit comments

Comments
 (0)