mirror of
https://github.com/natankeddem/bale.git
synced 2026-05-03 22:22:53 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| db4f340898 | |||
| f58b03a86b | |||
| 61f297aa0b | |||
| 425b607e8c |
+8
-12
@@ -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})
|
||||
|
||||
+12
-5
@@ -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",
|
||||
@@ -268,8 +269,15 @@ class Automation(Tab):
|
||||
rows = await self._grid.get_selected_rows()
|
||||
for row in rows:
|
||||
for job in self.scheduler.scheduler.get_jobs():
|
||||
j = job.id.split("@")[0]
|
||||
if j == row["name"]:
|
||||
auto = automation(job)
|
||||
if auto is not None and auto.name == row["name"]:
|
||||
if job.id in job_handlers:
|
||||
del job_handlers[job.id]
|
||||
if isinstance(auto, scheduler.Zfs_Autobackup):
|
||||
for host in auto.hosts:
|
||||
command = AutomationTemplate(auto.prop)
|
||||
prop = command.safe_substitute(name=auto.name, host=host)
|
||||
await self._remove_prop_from_all_fs(host=host, prop=prop)
|
||||
self.scheduler.scheduler.remove_job(job.id)
|
||||
self._automations.remove(row)
|
||||
self._grid.update()
|
||||
@@ -767,7 +775,6 @@ class Automation(Tab):
|
||||
self.scheduler.scheduler.remove_job(job.id)
|
||||
for host in hosts:
|
||||
auto_id = f"{auto_name}@{host}"
|
||||
|
||||
if self.previous_prop != "":
|
||||
command = AutomationTemplate(self.previous_prop)
|
||||
prop = command.safe_substitute(name=auto_name, host=host)
|
||||
@@ -810,8 +817,8 @@ class Automation(Tab):
|
||||
)
|
||||
elif self.app.value == "remote":
|
||||
for job in jobs:
|
||||
j = job.id.split("@")[0]
|
||||
if j == auto_name:
|
||||
auto = automation(job)
|
||||
if auto is not None and auto.name == auto_name:
|
||||
self.scheduler.scheduler.remove_job(job.id)
|
||||
for host in hosts:
|
||||
auto_id = f"{auto_name}@{host}"
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user