Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions odtp/dashboard/page_executions/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ def ui_table_layout(executions):
return
df = pd.DataFrame(data=executions)
df["_id"] = df["_id"].astype("string")
df["timestamp"] = df["start_timestamp"]
df["createdAt"] = df["createdAt"]
df["start_timestamp"] = df["start_timestamp"].fillna('')
df["end_timestamp"] = df["end_timestamp"].fillna('')
df["steps"] = df["steps"].apply(helpers.pd_lists_to_counts).astype("string")
df = df[["timestamp", "title", "steps"]]
df = df.sort_values(by="timestamp", ascending=False)
df = df[["createdAt", "title", "steps", "start_timestamp", "end_timestamp"]]
df = df.sort_values(by="createdAt", ascending=False)
ui.table.from_pandas(df)
6 changes: 3 additions & 3 deletions odtp/dashboard/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ def get_execution_select_options(digital_twin_id):
sub_collection=db.collection_executions,
item_id=digital_twin_id,
ref_name=db.collection_executions,
sort_by=[("start_timestamp", db.DESCENDING)],
sort_by=[("createdAt", db.DESCENDING)],
)
if not executions:
return {}
execution_options = {}
for execution in executions:
execution_options[str(execution["_id"])] = (
f"{execution['start_timestamp'].strftime('%d/%m/%y')} {execution.get('title')}"
f"{execution['createdAt'].strftime('%d/%m/%y')} {execution.get('title')}"
)
return execution_options

Expand Down Expand Up @@ -103,7 +103,7 @@ def build_execution_with_steps(execution_id):
execution_with_steps = {
"execution_id": execution_id,
"title": execution.get("title"),
"timestamp": execution.get("start_timestamp").strftime("%m/%d/%Y, %H:%M:%S"),
"createdAt": execution.get("createdAt").strftime("%m/%d/%Y, %H:%M:%S"),
"versions": execution["workflowSchema"]["component_versions"],
"version_tags": version_tags,
"steps": step_ids,
Expand Down