feat: add elements to array

This commit is contained in:
Arman
2024-06-24 16:05:45 +02:00
parent e74876018d
commit b5648d6c72
4 changed files with 69 additions and 8 deletions
+1 -1
View File
@@ -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",
+1 -1
View File
@@ -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 });
@@ -24,12 +24,69 @@
const columns = writable<Column[]>([
{ 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(() => {
@@ -87,6 +87,10 @@
<TableCellText width={column.width} title={column.title}>
{execution.requestMethod}
</TableCellText>
{:else if column.id === 'responseStatusCode'}
<TableCellText width={column.width} title={column.title}>
{execution.responseStatusCode}
</TableCellText>
{:else if column.id === 'requestPath'}
<TableCellText width={column.width} title={column.title}>
{execution.requestPath}