From b5648d6c72c4cefe5ee38581c2d2ec9c77c3633c Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 24 Jun 2024 16:05:45 +0200 Subject: [PATCH] feat: add elements to array --- package.json | 2 +- src/lib/components/filters/store.ts | 2 +- .../executions/+page.svelte | 69 +++++++++++++++++-- .../executions/table.svelte | 4 ++ 4 files changed, 69 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 42ec216dd..c49a3eae4 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "e2e:ui": "playwright test tests/e2e --ui" }, "dependencies": { - "@appwrite.io/console": "^0.6.2", + "@appwrite.io/console": "npm:khushboo-console@0.0.3", "@appwrite.io/pink": "0.23.0", "@appwrite.io/pink-icons": "0.23.0", "@popperjs/core": "^2.11.8", diff --git a/src/lib/components/filters/store.ts b/src/lib/components/filters/store.ts index 1f7777aba..ce4895420 100644 --- a/src/lib/components/filters/store.ts +++ b/src/lib/components/filters/store.ts @@ -96,7 +96,7 @@ export function addFilter( ) { const operator = operatorKey ? operators[operatorKey] : null; const column = columns.find((c) => c.id === columnId) as Column; - + console.log(column, operator); if (!column || !operator) return; if (column.array) { queries.addFilter({ column, operator, value: arrayValues }); 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 0d04ac273..4f341efb2 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 @@ -24,12 +24,69 @@ const columns = writable([ { id: '$id', title: 'Execution ID', type: 'string', show: true, width: 150 }, - { id: 'status', title: 'Status', type: 'string', show: true, width: 110 }, - { id: '$createdAt', title: 'Created', type: 'datetime', show: true, width: 140 }, - { id: 'trigger', title: 'Trigger', type: 'string', show: true, filter: false, width: 90 }, - { id: 'requestMethod', title: 'Method', type: 'string', show: true, width: 70 }, - { id: 'requestPath', title: 'Path', type: 'string', show: true, width: 90 }, - { id: 'duration', title: 'Duration', type: 'string', show: true, width: 80 } + { + id: 'status', + title: 'Status', + type: 'string', + show: true, + width: 110, + array: true, + format: 'enum', + elements: ['completed', 'scheduled', 'waiting', 'processing', 'cancelled', 'failed'] + }, + { + id: '$createdAt', + title: 'Created', + type: 'datetime', + show: true, + width: 140, + format: 'datetime' + }, + { + id: 'trigger', + title: 'Trigger', + type: 'string', + show: true, + width: 90, + array: true, + format: 'enum', + elements: ['http', 'scheduled', 'event'] + }, + { + id: 'requestMethod', + title: 'Method', + type: 'string', + show: true, + width: 70, + array: true, + format: 'enum', + elements: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'] + }, + { + id: 'responseStatusCode', + title: 'Status code', + type: 'string', + show: true, + width: 100, + array: true, + format: 'integer' + }, + { + id: 'requestPath', + title: 'Path', + type: 'string', + show: true, + width: 90, + format: 'string' + }, + { + id: 'duration', + title: 'Duration', + type: 'string', + show: true, + width: 80, + format: 'integer' + } ]); onMount(() => { 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 index 37c21d3c8..89cead33b 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte @@ -87,6 +87,10 @@ {execution.requestMethod} + {:else if column.id === 'responseStatusCode'} + + {execution.responseStatusCode} + {:else if column.id === 'requestPath'} {execution.requestPath}