diff --git a/src/lib/utilities/format-date.ts b/src/lib/utilities/format-date.ts new file mode 100644 index 0000000000..7a8d9f3a99 --- /dev/null +++ b/src/lib/utilities/format-date.ts @@ -0,0 +1,6 @@ +import { format } from 'date-fns'; + +export function formatDate(date: string | null): string { + if (!date) return ''; + return format(new Date(date), 'MMMM dd, yyyy — h:mm a'); +} diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index f854fcca47..c72b1002e6 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -33,7 +33,6 @@ diff --git a/src/routes/workflows/__layout.svelte b/src/routes/workflows/__layout.svelte index ea9ac5940f..deb4b65770 100644 --- a/src/routes/workflows/__layout.svelte +++ b/src/routes/workflows/__layout.svelte @@ -6,8 +6,7 @@ const endTime = addDays(new Date(), 30).toISOString(); const query = new URLSearchParams({ startTime, endTime }); - - const response = await fetch(`/api/workflows.json?${query.toString()}`); + const response = await fetch(`/api/workflows?${query}`); if (!response.ok) { const message = `An error has occured: ${response.status}`; @@ -25,20 +24,152 @@ } - -

Workflows

+
+ + + + + + + + + + + {#await workflows} +

Loading…

+ {:then workflows} + {#each workflows.executions as workflow} + + + + + + + {/each} + {:catch} +

There was an error.

+ {/await} + +
Workflow/Run IDStatusStartedEnded
+ +

+ {workflow.type.name} +

+

+ {workflow.execution.runId} +

+
+
+ +

{workflow.status}

+
+
+ +

{formatDate(workflow.startTime)}

+
+
+ +

{formatDate(workflow.closeTime)}

+
+
+ +
+ + diff --git a/static/css/global.css b/static/css/global.css index 9de9851443..d230a06339 100644 --- a/static/css/global.css +++ b/static/css/global.css @@ -5,5 +5,5 @@ } body { - font-family: Inter; + font-family: Inter, sans-serif; }