diff --git a/backend/src/catalog/controllers.rs b/backend/src/catalog/controllers.rs index dbf1498..1d3be3e 100644 --- a/backend/src/catalog/controllers.rs +++ b/backend/src/catalog/controllers.rs @@ -143,7 +143,7 @@ pub async fn exec_catalog_service_post_validate_scripts( &service_slug, Status::Queued, &req.payload, - &serde_json::Value::Object(serde_json::Map::new()), + &serde_json::Value::Array(vec![]), ).await { Ok(ces) => ces, Err(err) => return (StatusCode::INTERNAL_SERVER_ERROR, Json(JobResponse { diff --git a/backend/src/catalog/services.rs b/backend/src/catalog/services.rs index 608af03..ac61897 100644 --- a/backend/src/catalog/services.rs +++ b/backend/src/catalog/services.rs @@ -44,7 +44,7 @@ pub async fn background_worker(mut rx: Receiver, pg_pool: &pg_pool, task.catalog_execution_status_id.as_str(), Status::Running, - &serde_json::Value::Object(serde_json::Map::new()), + &serde_json::Value::Array(vec![]), ).await; if let Err(err) = r { diff --git a/frontend/src/components/self-service/SelfServiceRunTable.tsx b/frontend/src/components/self-service/SelfServiceRunTable.tsx index b980204..677e69d 100644 --- a/frontend/src/components/self-service/SelfServiceRunTable.tsx +++ b/frontend/src/components/self-service/SelfServiceRunTable.tsx @@ -1,10 +1,21 @@ -import {millisToHumanTime} from "@/lib/utils.ts"; +import {classNames, millisToHumanTime} from "@/lib/utils.ts"; + +const statuses = { + QUEUED: 'text-orange-400 bg-orange-400/10', + RUNNING: 'text-cyan-400 bg-cyan-400/10', + SUCCESS: 'text-green-400 bg-green-400/10', + FAILURE: 'text-rose-400 bg-rose-400/10' +} interface Props { runs: any[] } function getTotalExecutionTime(tasks: any[]): number { + if (tasks === undefined || tasks.length === 0) { + return 0 + } + return tasks.reduce((acc, task) => { if (task.post_validate_output && task.post_validate_output.execution_time_in_millis) { return acc + task.post_validate_output.execution_time_in_millis @@ -49,7 +60,17 @@ export default function SelfServiceRunTable({runs}: Props): JSX.Element { {run.created_at} - {run.status} + +
+ +
+
+
+
{run.status}
+
+ {run.tasks.length}/{run.tasks.length} {millisToHumanTime(getTotalExecutionTime(run.tasks))}