2 Commits

Author SHA1 Message Date
Natan Keddem db4f340898 add default sort to tables 2023-11-24 19:21:53 -05:00
Natan Keddem f58b03a86b optimize result display 2023-11-24 19:21:06 -05:00
4 changed files with 17 additions and 13 deletions
+8 -12
View File
@@ -91,20 +91,16 @@ class Tab:
with el.WColumn():
with el.Card() as card:
card.tailwind.width("full")
with el.WColumn():
ui.label(f"#> {result.command}").classes("text-secondary")
with el.WRow() as row:
row.tailwind.justify_content("around")
with ui.column() as col:
col.tailwind.max_width("lg")
ui.label(f"Host Name: {result.name}").classes("text-secondary")
ui.label(f"Command: {result.command}").classes("text-secondary")
timestamp = await ui.run_javascript(
f"new Date({result.timestamp} * 1000).toLocaleString(undefined, {{dateStyle: 'short', timeStyle: 'short', hour12: 'false'}});"
)
ui.label(f"Timestamp: {timestamp}").classes("text-secondary")
with ui.column() as col:
col.tailwind.max_width("lg")
ui.label(f"Task has failed: {result.failed}").classes("text-secondary")
ui.label(f"Data is cached: {result.cached}").classes("text-secondary")
ui.label(f"Host: {result.name}").classes("text-secondary")
timestamp = await ui.run_javascript(
f"new Date({result.timestamp} * 1000).toLocaleString(undefined, {{dateStyle: 'short', timeStyle: 'short', hour12: 'false'}});"
)
ui.label(f"Timestamp: {timestamp}").classes("text-secondary")
ui.label(f"Return Code: {result.return_code}").classes("text-secondary")
with el.Card() as card:
with el.WColumn():
terminal = cli.Terminal(options={"rows": 18, "cols": 120, "convertEol": True})
+1
View File
@@ -189,6 +189,7 @@ class Automation(Tab):
var date = new Date(data.value * 1000).toLocaleString(undefined, {dateStyle: 'short', timeStyle: 'short', hour12: false});;
return date;
}""",
"sort": "asc",
},
{
"headerName": "Status",
+7 -1
View File
@@ -34,7 +34,12 @@ class History(Tab):
"rowSelection": "multiple",
"paginationAutoPageSize": True,
"pagination": True,
"defaultColDef": {"resizable": True, "sortable": True, "suppressMovable": True, "sortingOrder": ["asc", "desc"]},
"defaultColDef": {
"resizable": True,
"sortable": True,
"suppressMovable": True,
"sortingOrder": ["asc", "desc"],
},
"columnDefs": [
{
"headerName": "Host",
@@ -57,6 +62,7 @@ class History(Tab):
var date = new Date(data.value * 1000).toLocaleString(undefined, {dateStyle: 'short', timeStyle: 'short', hour12: false});;
return date;
}""",
"sort": "desc",
},
{
"headerName": "Status",
+1
View File
@@ -87,6 +87,7 @@ class Manage(Tab):
var date = new Date(data.value * 1000).toLocaleString(undefined, {dateStyle: 'short', timeStyle: 'short', hour12: false});;
return date;
}""",
"sort": "desc",
},
{"headerName": "Holds", "field": "userrefs", "filter": "agNumberColumnFilter", "maxWidth": 100},
],