diff --git a/src/lib/layout/logs.svelte b/src/lib/layout/logs.svelte index 55deb7332..484dc25f7 100644 --- a/src/lib/layout/logs.svelte +++ b/src/lib/layout/logs.svelte @@ -16,7 +16,6 @@ import { isCloud } from '$lib/system'; import { getServiceLimit, tierToPlan, upgradeURL } from '$lib/stores/billing'; import { organization } from '$lib/stores/organization'; - import { app } from '$lib/stores/app'; import { Button } from '$lib/elements/forms'; import { BillingPlan } from '$lib/constants'; @@ -163,9 +162,7 @@
-
+
Request
@@ -276,9 +273,7 @@

{/if}
-
+
Response
diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index 05ef8bb35..0d04ac273 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -1,36 +1,37 @@ - +

The {tier} plan has limits

    @@ -82,6 +73,42 @@ {/if} +
    + +
    + + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    + +
    {#if !$func.logging}
    @@ -97,62 +124,8 @@
    {/if} - {#if data.executions.total} - - - Execution ID - Status - Created - Trigger - Method - Path - Duration - - - {#each data.executions.executions as execution} - showLogs(execution)}> - - {execution.$id} - - - {@const status = execution.status} -
    - - {#if status === 'scheduled'} - -
    -
    - - {timeFromNow(execution.$createdAt)} - - - - {execution.trigger} - - - - {execution.requestMethod} - - - {execution.requestPath} - - - {calculateTime(execution.duration)} - -
    - {/each} -
    -
    + {#if data?.executions?.total} + { depends(Dependencies.EXECUTIONS); const page = getPage(url); const limit = getLimit(url, route, PAGE_LIMIT); const offset = pageToOffset(page, limit); + const query = getQuery(url); + + const parsedQueries = queryParamToMap(query || '[]'); + queries.set(parsedQueries); return { offset, limit, + query, executions: await sdk.forProject.functions.listExecutions(params.function, [ Query.limit(limit), Query.offset(offset), - Query.orderDesc('') + Query.orderDesc(''), + ...parsedQueries.values() ]) }; }; diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte new file mode 100644 index 000000000..37c21d3c8 --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte @@ -0,0 +1,104 @@ + + + + + {#each columns as column} + {#if column.show} + {column.title} + {/if} + {/each} + + + {#each data.executions.executions as execution (execution.$id)} + showLogs(execution)}> + {#each columns as column} + {#if column.show} + {#if column.id === '$id'} + {#key column.id} + + {execution.$id} + + {/key} + {:else if column.id === 'status'} + + {@const status = execution.status} +
    + + {#if status === 'scheduled'} + +
    +
    + {:else if column.id === '$createdAt'} + + {timeFromNow(execution.$createdAt)} + + {:else if column.id === 'trigger'} + + + {execution.trigger} + + + {:else if column.id === 'requestMethod'} + + {execution.requestMethod} + + {:else if column.id === 'requestPath'} + + {execution.requestPath} + + {:else if column.id === 'duration'} + + {calculateTime(execution.duration)} + + {/if} + {/if} + {/each} +
    + {/each} +
    +