+
Collections
-
+
+ test
+
+
+
{#if data.collections.total}
-
(showCreate = true)}>
- {#each data.collections.collections as collection}
-
- {collection.name}
-
- {#if !collection.enabled}
- disabled
- {/if}
-
-
- Collection ID
-
-
- {/each}
-
- Create a new collection
-
-
-
-
-
Total results: {data.collections.total}
-
-
+ {#if $preferredView === 'list'}
+
+ {:else}
+
+ {/if}
{:else}
{
await parent();
const page = Number(params.page);
- const offset = pageToOffset(page, CARD_LIMIT);
+ const offset = pageToOffset(page, limit);
return {
offset,
collections: await sdkForProject.databases.listCollections(params.database, [
- Query.limit(CARD_LIMIT),
+ Query.limit(limit),
Query.offset(offset),
Query.orderDesc('$createdAt')
])
diff --git a/src/routes/console/project-[project]/databases/database-[database]/[[page]]/gridView.svelte b/src/routes/console/project-[project]/databases/database-[database]/[[page]]/gridView.svelte
new file mode 100644
index 000000000..6478512a6
--- /dev/null
+++ b/src/routes/console/project-[project]/databases/database-[database]/[[page]]/gridView.svelte
@@ -0,0 +1,50 @@
+
+
+ (showCreate = true)}>
+ {#each data.collections.collections as collection}
+
+ {collection.name}
+
+ {#if !collection.enabled}
+ disabled
+ {/if}
+
+
+ Collection ID
+
+
+ {/each}
+
+ Create a new collection
+
+
+
+
+
Total results: {data.collections.total}
+
+
diff --git a/src/routes/console/project-[project]/databases/database-[database]/[[page]]/tableView.svelte b/src/routes/console/project-[project]/databases/database-[database]/[[page]]/tableView.svelte
new file mode 100644
index 000000000..eb3e8a738
--- /dev/null
+++ b/src/routes/console/project-[project]/databases/database-[database]/[[page]]/tableView.svelte
@@ -0,0 +1,64 @@
+
+
+
+
+ Collection ID
+ Name
+ Updated At
+ Created At
+
+
+ {#each data.collections.collections as collection}
+
+
+
+
+
+ {collection.$id}
+
+
+
+
+ {collection.name}
+
+
+ {toLocaleDateTime(collection.$updatedAt)}
+
+
+ {toLocaleDateTime(collection.$createdAt)}
+
+
+ {/each}
+
+
+
+
+
Total results: {data.collections.total}
+
+