diff --git a/src/lib/components/avatarInitials.svelte b/src/lib/components/avatarInitials.svelte
index f18ba99fd4..1696404a57 100644
--- a/src/lib/components/avatarInitials.svelte
+++ b/src/lib/components/avatarInitials.svelte
@@ -7,7 +7,7 @@
export let background: string | undefined = undefined;
export let color = 'black';
- $: src = sdk.forConsole.avatars.getInitials(name, size * 2, size * 2, background).toString();
+ $: src = sdk.forConsole.avatars.getInitials(name, size * 2, size * 2, background);
diff --git a/src/lib/components/cardContainer.svelte b/src/lib/components/cardContainer.svelte
index 0590e6182a..8021ec796c 100644
--- a/src/lib/components/cardContainer.svelte
+++ b/src/lib/components/cardContainer.svelte
@@ -16,7 +16,7 @@
$: planLimit = getServiceLimit(serviceId) || Infinity;
- $: limit = preferences.get($page.route)?.limit ?? CARD_LIMIT;
+ $: limit = preferences.get($page.params.project, $page.route)?.limit ?? CARD_LIMIT;
diff --git a/src/lib/components/limit.svelte b/src/lib/components/limit.svelte
index 2150f5c3f5..9e71cbabc1 100644
--- a/src/lib/components/limit.svelte
+++ b/src/lib/components/limit.svelte
@@ -20,7 +20,7 @@
const url = new URL($pageStore.url);
const previousLimit = Number(url.searchParams.get('limit'));
url.searchParams.set('limit', limit.toString());
- preferences.setLimit(limit);
+ preferences.setLimit($pageStore.params.project, $pageStore.route, limit);
if (url.searchParams.has('page')) {
const page = Number(url.searchParams.get('page'));
diff --git a/src/lib/components/viewSelector.svelte b/src/lib/components/viewSelector.svelte
index d0d69ed658..13331cee8f 100644
--- a/src/lib/components/viewSelector.svelte
+++ b/src/lib/components/viewSelector.svelte
@@ -23,7 +23,10 @@
onMount(async () => {
if (isCustomCollection) {
- const prefs = preferences.getCustomCollectionColumns($page.params.collection);
+ const prefs = preferences.getCustomCollectionColumns(
+ $page.params.project,
+ $page.params.collection
+ );
columns.set(
$columns.map((column) => {
column.show = prefs?.includes(column.id) ?? true;
@@ -31,7 +34,7 @@
})
);
} else {
- const prefs = preferences.get($page.route);
+ const prefs = preferences.get($page.params.project, $page.route);
// Override the shown columns only if a preference was set
if (prefs?.columns) {
@@ -48,9 +51,9 @@
const columns = ctx.filter((n) => n.show).map((n) => n.id);
if (isCustomCollection) {
- preferences.setCustomCollectionColumns(columns);
+ preferences.setCustomCollectionColumns($page.params.project, $page.route, columns);
} else {
- preferences.setColumns(columns);
+ preferences.setColumns($page.params.project, $page.route, columns);
}
});
});
@@ -62,7 +65,7 @@
}
function updateViewPreferences(view: View) {
- preferences.setView(view);
+ preferences.setView($page.params.project, $page.route, view);
}
$: selectedColumnsNumber = $columns.reduce((acc, column) => {
diff --git a/src/lib/elements/flag.svelte b/src/lib/elements/flag.svelte
index 066a531b3d..410307c9a0 100644
--- a/src/lib/elements/flag.svelte
+++ b/src/lib/elements/flag.svelte
@@ -14,14 +14,10 @@
export function getFlag(country: string, width: number, height: number, quality: number) {
if (!isValueOfStringEnum(Flag, country)) return '';
- let flag = sdk
- .forProject($page.params.region, $page.params.project)
- .avatars.getFlag(country, width * 2, height * 2, quality)
- ?.toString();
- flag?.includes('&project=')
- ? (flag = flag.replace('&project=', '&mode=admin'))
- : flag + '&mode=admin';
- return flag;
+
+ return sdk
+ .forProject($page.params.region, 'console')
+ .avatars.getFlag(country, width * 2, height * 2, quality);
}
diff --git a/src/lib/helpers/load.ts b/src/lib/helpers/load.ts
index 88cd98c381..82176ad349 100644
--- a/src/lib/helpers/load.ts
+++ b/src/lib/helpers/load.ts
@@ -9,8 +9,15 @@ export function getPage(url: URL): number {
return Number(url.searchParams.get('page'));
}
-export function getLimit(url: URL, route: Page['route'], fallback: number): number {
- return Number(url.searchParams.get('limit') ?? preferences.get(route).limit ?? fallback);
+export function getLimit(
+ projectId: string,
+ url: URL,
+ route: Page['route'],
+ fallback: number
+): number {
+ return Number(
+ url.searchParams.get('limit') ?? preferences.get(projectId, route).limit ?? fallback
+ );
}
export enum View {
@@ -18,14 +25,14 @@ export enum View {
Grid = 'grid'
}
-export function getView(url: URL, route: Page['route'], fallback: View): View {
- return (url.searchParams.get('view') ?? preferences.get(route).view) === View.Grid
+export function getView(projectId: string, url: URL, route: Page['route'], fallback: View): View {
+ return (url.searchParams.get('view') ?? preferences.get(projectId, route).view) === View.Grid
? View.Grid
: (View.Table ?? fallback);
}
-export function getColumns(route: Page['route'], fallback: string[]): string[] {
- return preferences.get(route).columns ?? fallback;
+export function getColumns(projectId: string, route: Page['route'], fallback: string[]): string[] {
+ return preferences.get(projectId, route).columns ?? fallback;
}
export function getSearch(url: URL): string | undefined {
diff --git a/src/lib/stores/preferences.ts b/src/lib/stores/preferences.ts
index 419cf3b4b9..84c00a0be3 100644
--- a/src/lib/stores/preferences.ts
+++ b/src/lib/stores/preferences.ts
@@ -1,5 +1,4 @@
import { browser } from '$app/environment';
-import { page } from '$app/stores';
import type { View } from '$lib/helpers/load';
import type { Page } from '@sveltejs/kit';
import { get, writable } from 'svelte/store';
@@ -48,81 +47,62 @@ function createPreferences() {
subscribe,
set,
update,
- get: (route?: Page['route']): Preferences => {
- const $page = get(page);
- const projectId = $page.params.project;
- const routeId = route?.id ?? $page.route.id;
-
- return (
- preferences[projectId]?.[routeId] ?? {
- limit: null,
- view: null,
- columns: null
- }
- );
- },
-
- getCustomCollectionColumns: (collectionId: string): Preferences['columns'] => {
- const $page = get(page);
- const projectId = $page.params.project;
-
- return preferences[projectId]?.collections?.[collectionId] ?? null;
- },
- setLimit: (limit: Preferences['limit']) =>
+ get: (projectId: string, route: Page['route']): Preferences =>
+ preferences[projectId]?.[route.id] ?? {
+ limit: null,
+ view: null,
+ columns: null
+ },
+
+ getCustomCollectionColumns: (
+ projectId: string,
+ collectionId: string
+ ): Preferences['columns'] => preferences[projectId]?.collections?.[collectionId] ?? null,
+ setLimit: (projectId: string, route: Page['route'], limit: Preferences['limit']) =>
update((n) => {
- const $page = get(page);
- const path = $page.route.id;
- const project = $page.params.project;
-
- if (!n[project]?.[path]) {
- n[project] ??= {};
- n[project][path] ??= {};
+ if (!n[projectId]?.[route.id]) {
+ n[projectId] ??= {};
+ n[projectId][route.id] ??= {};
}
- n[project][path].limit = limit;
+ n[projectId][route.id].limit = limit;
return n;
}),
- setView: (view: Preferences['view']) =>
+ setView: (projectId: string, route: Page['route'], view: Preferences['view']) =>
update((n) => {
- const $page = get(page);
- const path = $page.route.id;
- const project = $page.params.project;
- if (!n[project]?.[path]) {
- n[project] ??= {};
- n[project][path] ??= {};
+ if (!n[projectId]?.[route.id]) {
+ n[projectId] ??= {};
+ n[projectId][route.id] ??= {};
}
- n[project][path].view = view;
+ n[projectId][route.id].view = view;
return n;
}),
- setColumns: (columns: Preferences['columns']) =>
+ setColumns: (projectId: string, route: Page['route'], columns: Preferences['columns']) =>
update((n) => {
- const $page = get(page);
- const path = $page.route.id;
- const project = $page.params.project;
- if (!n[project]?.[path]) {
- n[project] ??= {};
- n[project][path] ??= {};
+ if (!n[projectId]?.[route.id]) {
+ n[projectId] ??= {};
+ n[projectId][route.id] ??= {};
}
- n[project][path].columns = columns;
+ n[projectId][route.id].columns = columns;
return n;
}),
- setCustomCollectionColumns: (columns: Preferences['columns']) =>
+ setCustomCollectionColumns: (
+ projectId: string,
+ route: Page['route'],
+ columns: Preferences['columns']
+ ) =>
update((n) => {
- const $page = get(page);
- const project = $page.params.project;
- const collection = $page.params.collection;
-
- if (!n[project]?.collections?.[collection]) {
- n[project] ??= {};
- n[project].collections ??= {};
+ if (!n[projectId]?.collections?.[route.id]) {
+ n[projectId] ??= {};
+ n[projectId].collections ??= {};
}
- n[project].collections[collection] = columns;
+ n[projectId].collections[route.id] = columns;
return n;
}),
diff --git a/src/lib/stores/uploader.ts b/src/lib/stores/uploader.ts
index ff78d25234..b25e3da81c 100644
--- a/src/lib/stores/uploader.ts
+++ b/src/lib/stores/uploader.ts
@@ -1,6 +1,5 @@
import { Client, type Models, Storage } from '@appwrite.io/console';
import { writable } from 'svelte/store';
-import { getProjectId } from '$lib/helpers/project';
import { getApiEndpoint } from '$lib/stores/sdk';
type UploaderFile = {
@@ -18,11 +17,10 @@ export type Uploader = {
files: UploaderFile[];
};
-const temporaryStorage = () => {
- const clientProject = new Client()
- .setEndpoint(getApiEndpoint())
- .setMode('admin')
- .setProject(getProjectId());
+const temporaryStorage = (region: string, projectId: string) => {
+ const clientProject = new Client().setMode('admin');
+ const endpoint = getApiEndpoint(region);
+ clientProject.setEndpoint(endpoint).setProject(projectId);
return new Storage(clientProject);
};
@@ -66,7 +64,14 @@ const createUploader = () => {
isCollapsed: false,
files: []
}),
- uploadFile: async (bucketId: string, id: string, file: File, permissions: string[]) => {
+ uploadFile: async (
+ region: string,
+ projectId: string,
+ bucketId: string,
+ id: string,
+ file: File,
+ permissions: string[]
+ ) => {
const newFile: UploaderFile = {
$id: id,
bucketId: bucketId,
@@ -81,7 +86,7 @@ const createUploader = () => {
n.files.unshift(newFile);
return n;
});
- const uploadedFile = await temporaryStorage().createFile(
+ const uploadedFile = await temporaryStorage(region, projectId).createFile(
bucketId,
id ?? 'unique()',
file,
diff --git a/src/routes/(console)/(migration-wizard)/index.ts b/src/routes/(console)/(migration-wizard)/index.ts
index e3dc89a318..9c065b9bf0 100644
--- a/src/routes/(console)/(migration-wizard)/index.ts
+++ b/src/routes/(console)/(migration-wizard)/index.ts
@@ -3,7 +3,6 @@ import { wizard } from '$lib/stores/wizard';
import { requestedMigration } from '$routes/store';
import { get, writable } from 'svelte/store';
import Wizard from './wizard.svelte';
-import type { Models } from '@appwrite.io/console';
export const formData = createMigrationFormStore();
diff --git a/src/routes/(console)/+layout.svelte b/src/routes/(console)/+layout.svelte
index e7f43be1f9..1d6d89e314 100644
--- a/src/routes/(console)/+layout.svelte
+++ b/src/routes/(console)/+layout.svelte
@@ -272,9 +272,9 @@
}
database.subscribe(async (database) => {
- if (!database) return;
+ if (!database || !$page.params.region || !$page.params.project) return;
// the component checks `isCloud` internally.
- await checkForDatabaseBackupPolicies(database);
+ await checkForDatabaseBackupPolicies($page.params.region, $page.params.project, database);
});
let currentOrganizationId = null;
diff --git a/src/routes/(console)/account/activity/+page.ts b/src/routes/(console)/account/activity/+page.ts
index 4f02c49120..4dfa80227f 100644
--- a/src/routes/(console)/account/activity/+page.ts
+++ b/src/routes/(console)/account/activity/+page.ts
@@ -6,7 +6,7 @@ import type { PageLoad } from './$types';
export const load: PageLoad = async ({ url, route }) => {
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit('console', url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
return {
diff --git a/src/routes/(console)/account/organizations/+page.ts b/src/routes/(console)/account/organizations/+page.ts
index 0b89b1d302..cafa665eb8 100644
--- a/src/routes/(console)/account/organizations/+page.ts
+++ b/src/routes/(console)/account/organizations/+page.ts
@@ -6,7 +6,7 @@ import type { PageLoad } from './$types';
export const load: PageLoad = async ({ url, route }) => {
const page = getPage(url);
- const limit = getLimit(url, route, CARD_LIMIT);
+ const limit = getLimit('console', url, route, CARD_LIMIT);
const offset = pageToOffset(page, limit);
return {
diff --git a/src/routes/(console)/account/sessions/+page.svelte b/src/routes/(console)/account/sessions/+page.svelte
index 38a9247213..dc443717d7 100644
--- a/src/routes/(console)/account/sessions/+page.svelte
+++ b/src/routes/(console)/account/sessions/+page.svelte
@@ -29,9 +29,8 @@
function getBrowser(clientCode: string) {
const code = clientCode.toLowerCase();
if (!isValueOfStringEnum(Browser, code)) return '';
- return sdk
- .forProject($page.params.region, $page.params.project)
- .avatars.getBrowser(code, 40, 40);
+
+ return sdk.forConsole.avatars.getBrowser(code, 40, 40);
}
function logoutSessionId(sessionId: string) {
diff --git a/src/routes/(console)/organization-[organization]/+page.ts b/src/routes/(console)/organization-[organization]/+page.ts
index 0282852c28..27056c2897 100644
--- a/src/routes/(console)/organization-[organization]/+page.ts
+++ b/src/routes/(console)/organization-[organization]/+page.ts
@@ -9,7 +9,7 @@ export const load: PageLoad = async ({ params, url, route, depends, parent }) =>
const { scopes } = await parent();
depends(Dependencies.ORGANIZATION);
const page = getPage(url);
- const limit = getLimit(url, route, CARD_LIMIT);
+ const limit = getLimit('console', url, route, CARD_LIMIT);
const offset = pageToOffset(page, limit);
if (!scopes.includes('projects.read') && scopes.includes('billing.read')) {
return redirect(301, `/console/organization-${params.organization}/billing`);
diff --git a/src/routes/(console)/organization-[organization]/members/+page.ts b/src/routes/(console)/organization-[organization]/members/+page.ts
index 69d4cb1f51..2ca1102a72 100644
--- a/src/routes/(console)/organization-[organization]/members/+page.ts
+++ b/src/routes/(console)/organization-[organization]/members/+page.ts
@@ -8,7 +8,7 @@ export const load: PageLoad = async ({ url, params, route, depends }) => {
depends(Dependencies.ORGANIZATION);
depends(Dependencies.MEMBERS);
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit('console', url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
return {
diff --git a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte
index 278f0c94fa..4da76596da 100644
--- a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte
+++ b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte
@@ -71,8 +71,8 @@
{format(project.usage)}
{:else}
-
+
+
{data.projectNames[project.projectId]?.name ?? 'Unknown'}
diff --git a/src/routes/(console)/project-[region]-[project]/auth/+page.ts b/src/routes/(console)/project-[region]-[project]/auth/+page.ts
index 74ce23f313..db6ad38c72 100644
--- a/src/routes/(console)/project-[region]-[project]/auth/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/auth/+page.ts
@@ -8,7 +8,7 @@ import { showCreateUser } from './+page.svelte';
export const load: PageLoad = async ({ url, route, params }) => {
const page = getPage(url);
const search = getSearch(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
if (typeof url.searchParams.get('create') === 'string') {
diff --git a/src/routes/(console)/project-[region]-[project]/auth/teams/+page.ts b/src/routes/(console)/project-[region]-[project]/auth/teams/+page.ts
index 3f9e017937..d24fe0665c 100644
--- a/src/routes/(console)/project-[region]-[project]/auth/teams/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/auth/teams/+page.ts
@@ -7,7 +7,7 @@ import type { PageLoad } from './$types';
export const load: PageLoad = async ({ url, route, params }) => {
const page = getPage(url);
const search = getSearch(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
return {
diff --git a/src/routes/(console)/project-[region]-[project]/auth/teams/team-[team]/activity/+page.ts b/src/routes/(console)/project-[region]-[project]/auth/teams/team-[team]/activity/+page.ts
index 7b33b57e89..c5512bfd73 100644
--- a/src/routes/(console)/project-[region]-[project]/auth/teams/team-[team]/activity/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/auth/teams/team-[team]/activity/+page.ts
@@ -6,7 +6,7 @@ import type { PageLoad } from './$types';
export const load: PageLoad = async ({ params, url, route }) => {
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
return {
diff --git a/src/routes/(console)/project-[region]-[project]/auth/teams/team-[team]/members/+page.ts b/src/routes/(console)/project-[region]-[project]/auth/teams/team-[team]/members/+page.ts
index c1094d2241..73a4cc029a 100644
--- a/src/routes/(console)/project-[region]-[project]/auth/teams/team-[team]/members/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/auth/teams/team-[team]/members/+page.ts
@@ -9,7 +9,7 @@ export const load: PageLoad = async ({ params, depends, url, route }) => {
const teamId = params.team;
const page = getPage(url);
const search = getSearch(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
return {
diff --git a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/activity/+page.ts b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/activity/+page.ts
index 29b0048219..4ef4251269 100644
--- a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/activity/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/activity/+page.ts
@@ -6,7 +6,7 @@ import type { PageLoad } from './$types';
export const load: PageLoad = async ({ params, url, route }) => {
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
return {
offset,
diff --git a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/identities/+page.ts b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/identities/+page.ts
index 475f950a56..252dceca5e 100644
--- a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/identities/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/identities/+page.ts
@@ -9,7 +9,7 @@ export const load: PageLoad = async ({ params, url, route, depends }) => {
depends(Dependencies.USER_IDENTITIES);
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
const query = getQuery(url);
const search = getSearch(url);
diff --git a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/sessions/+page.svelte b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/sessions/+page.svelte
index 1abb3d7cc5..8d15b3abd7 100644
--- a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/sessions/+page.svelte
+++ b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/sessions/+page.svelte
@@ -18,7 +18,6 @@
import DeleteAllSessions from '../deleteAllSessions.svelte';
import DeleteSessions from '../deleteSession.svelte';
import type { PageData } from './$types';
- import { page } from '$app/stores';
export let data: PageData;
@@ -29,9 +28,8 @@
function getBrowser(clientCode: string) {
const code = clientCode.toLowerCase();
if (!isValueOfStringEnum(Browser, code)) return '';
- return sdk
- .forProject($page.params.region, $page.params.project)
- .avatars.getBrowser(code, 40, 40);
+
+ return sdk.forConsole.avatars.getBrowser(code, 40, 40);
}
diff --git a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/targets/+page.ts b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/targets/+page.ts
index c3dab9c6a9..e7a6aa7fe6 100644
--- a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/targets/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/targets/+page.ts
@@ -9,7 +9,7 @@ export const load: PageLoad = async ({ params, url, route, depends }) => {
depends(Dependencies.USER_TARGETS);
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
const query = getQuery(url);
diff --git a/src/routes/(console)/project-[region]-[project]/databases/+page.ts b/src/routes/(console)/project-[region]-[project]/databases/+page.ts
index bca9575435..15f90f67d5 100644
--- a/src/routes/(console)/project-[region]-[project]/databases/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/databases/+page.ts
@@ -10,8 +10,8 @@ export const load: PageLoad = async ({ url, route, depends, params }) => {
depends(Dependencies.DATABASES);
const page = getPage(url);
- const limit = getLimit(url, route, CARD_LIMIT);
- const view = getView(url, route, View.Grid);
+ const limit = getLimit(params.project, url, route, CARD_LIMIT);
+ const view = getView(params.project, url, route, View.Grid);
const offset = pageToOffset(page, limit);
const { databases, policies, lastBackups } = await fetchDatabasesAndBackups(
diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/+page.ts b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/+page.ts
index 57d5f5f0e0..c9e4ba10bb 100644
--- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/+page.ts
@@ -7,8 +7,8 @@ import { CARD_LIMIT, Dependencies } from '$lib/constants';
export const load: PageLoad = async ({ params, url, route, depends }) => {
depends(Dependencies.COLLECTIONS);
const page = getPage(url);
- const limit = getLimit(url, route, CARD_LIMIT);
- const view = getView(url, route, View.Grid);
+ const limit = getLimit(params.project, url, route, CARD_LIMIT);
+ const view = getView(params.project, url, route, View.Grid);
const offset = pageToOffset(page, limit);
const collections = await sdk
.forProject(params.region, params.project)
diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/backups/+page.ts b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/backups/+page.ts
index 5e12a3c05f..2f7fefba43 100644
--- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/backups/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/backups/+page.ts
@@ -7,8 +7,8 @@ import type { BackupArchive, BackupArchiveList, BackupPolicyList } from '$lib/sd
export const load = async ({ params, url, route, depends }) => {
depends(Dependencies.BACKUPS);
const page = getPage(url);
- const limit = getLimit(url, route, CARD_LIMIT);
- const view = getView(url, route, View.Grid);
+ const limit = getLimit(params.project, url, route, CARD_LIMIT);
+ const view = getView(params.project, url, route, View.Grid);
const offset = pageToOffset(page, limit);
let backups: BackupArchiveList = { total: 0, archives: [] };
diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.svelte
index 5a7a96e4b7..83ea35cd1d 100644
--- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.svelte
+++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.svelte
@@ -23,7 +23,10 @@
let showCreateDropdown = false;
let selectedAttribute: Option['name'] = null;
- $: selected = preferences.getCustomCollectionColumns($page.params.collection);
+ $: selected = preferences.getCustomCollectionColumns(
+ $page.params.project,
+ $page.params.collection
+ );
$: columns.set(
$collection.attributes.map((attribute) => ({
id: attribute.key,
diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.ts b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.ts
index 107d096f6b..16860c77ff 100644
--- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.ts
@@ -8,8 +8,8 @@ import { queries, queryParamToMap } from '$lib/components/filters';
export const load: PageLoad = async ({ params, depends, url, route }) => {
depends(Dependencies.DOCUMENTS);
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
- const view = getView(url, route, View.Grid);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
+ const view = getView(params.project, url, route, View.Grid);
const offset = pageToOffset(page, limit);
const query = getQuery(url);
diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/activity/+page.ts b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/activity/+page.ts
index 955c1796c1..dc9a44c26b 100644
--- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/activity/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/activity/+page.ts
@@ -6,7 +6,7 @@ import type { PageLoad } from './$types';
export const load: PageLoad = async ({ params, url, route }) => {
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
return {
diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/createAttribute.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/createAttribute.svelte
index aa89f0b158..573ccccf54 100644
--- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/createAttribute.svelte
+++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/createAttribute.svelte
@@ -28,9 +28,16 @@
try {
await $option.create(databaseId, collectionId, key, data);
- let selectedColumns = preferences.getCustomCollectionColumns(collectionId);
+ let selectedColumns = preferences.getCustomCollectionColumns(
+ $page.params.project,
+ collectionId
+ );
selectedColumns.push(key ?? data?.key);
- preferences.setCustomCollectionColumns(selectedColumns);
+ preferences.setCustomCollectionColumns(
+ $page.params.project,
+ $page.route,
+ selectedColumns
+ );
await invalidate(Dependencies.COLLECTION);
if (!$page.url.pathname.includes('attributes')) {
await goto(
diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/activity/+page.ts b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/activity/+page.ts
index 6c59cf14f0..070f181276 100644
--- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/activity/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/activity/+page.ts
@@ -6,7 +6,7 @@ import type { PageLoad } from './$types';
export const load: PageLoad = async ({ params, url, route }) => {
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
return {
diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte
index 52643ef3ef..372ec904fc 100644
--- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte
+++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte
@@ -99,7 +99,10 @@
};
}
- $: selected = preferences.getCustomCollectionColumns($page.params.collection);
+ $: selected = preferences.getCustomCollectionColumns(
+ $page.params.project,
+ $page.params.collection
+ );
$: {
columns.set(
diff --git a/src/routes/(console)/project-[region]-[project]/functions/+page.ts b/src/routes/(console)/project-[region]-[project]/functions/+page.ts
index 0019ac1039..7fa73f2629 100644
--- a/src/routes/(console)/project-[region]-[project]/functions/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/functions/+page.ts
@@ -4,11 +4,11 @@ import { getLimit, getPage, pageToOffset } from '$lib/helpers/load';
import { CARD_LIMIT, Dependencies } from '$lib/constants';
import type { PageLoad } from './$types';
-export const load: PageLoad = async ({ url, depends, route }) => {
+export const load: PageLoad = async ({ url, depends, route, params }) => {
depends(Dependencies.FUNCTIONS);
const page = getPage(url);
- const limit = getLimit(url, route, CARD_LIMIT);
+ const limit = getLimit(params.project, url, route, CARD_LIMIT);
const offset = pageToOffset(page, limit);
return {
diff --git a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/+page.ts b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/+page.ts
index 9f666a8f34..9b23d5d084 100644
--- a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/+page.ts
@@ -9,7 +9,7 @@ export const load: PageLoad = async ({ params, depends, url, route, parent }) =>
const data = await parent();
depends(Dependencies.DEPLOYMENTS);
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
const query = getQuery(url);
diff --git a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/+page.ts b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/+page.ts
index 62766efa26..fa8be5fd01 100644
--- a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/+page.ts
@@ -8,7 +8,7 @@ import { queries, queryParamToMap } from '$lib/components/filters';
export const load: PageLoad = async ({ params, depends, url, route }) => {
depends(Dependencies.EXECUTIONS);
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
const query = getQuery(url);
diff --git a/src/routes/(console)/project-[region]-[project]/functions/templates/+page.ts b/src/routes/(console)/project-[region]-[project]/functions/templates/+page.ts
index abf21eb708..0b29728e1e 100644
--- a/src/routes/(console)/project-[region]-[project]/functions/templates/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/functions/templates/+page.ts
@@ -3,13 +3,13 @@ import { getPage, getSearch, getView, pageToOffset, View } from '$lib/helpers/lo
import { sdk } from '$lib/stores/sdk';
import type { PageLoad } from './$types';
-export const load: PageLoad = async ({ url, route, depends, parent }) => {
+export const load: PageLoad = async ({ url, route, depends, parent, params }) => {
depends(Dependencies.FUNCTIONS);
const limit = CARD_LIMIT;
const page = getPage(url);
const search = getSearch(url);
- const view = getView(url, route, View.Grid);
+ const view = getView(params.project, url, route, View.Grid);
const offset = pageToOffset(page, limit);
const filter = {
useCases: url.searchParams.getAll('useCase'),
diff --git a/src/routes/(console)/project-[region]-[project]/messaging/+page.ts b/src/routes/(console)/project-[region]-[project]/messaging/+page.ts
index 64845f1e40..1380807dfd 100644
--- a/src/routes/(console)/project-[region]-[project]/messaging/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/messaging/+page.ts
@@ -13,13 +13,13 @@ import { sdk } from '$lib/stores/sdk';
import { Query, type Models } from '@appwrite.io/console';
import type { PageLoad } from './$types';
-export const load: PageLoad = async ({ depends, url, route }) => {
+export const load: PageLoad = async ({ depends, url, route, params }) => {
depends(Dependencies.MESSAGING_MESSAGES);
const page = getPage(url);
const search = getSearch(url);
- const view = getView(url, route, View.Grid);
- const limit = getLimit(url, route, CARD_LIMIT);
+ const view = getView(params.project, url, route, View.Grid);
+ const limit = getLimit(params.project, url, route, CARD_LIMIT);
const offset = pageToOffset(page, limit);
const query = getQuery(url);
diff --git a/src/routes/(console)/project-[region]-[project]/messaging/providers/+page.ts b/src/routes/(console)/project-[region]-[project]/messaging/providers/+page.ts
index fe8003fdd7..8a2e109220 100644
--- a/src/routes/(console)/project-[region]-[project]/messaging/providers/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/messaging/providers/+page.ts
@@ -13,13 +13,13 @@ import { Dependencies, PAGE_LIMIT } from '$lib/constants';
import { queries, queryParamToMap } from '$lib/components/filters';
import type { PageLoad } from './$types';
-export const load: PageLoad = async ({ depends, url, route }) => {
+export const load: PageLoad = async ({ depends, url, route, params }) => {
depends(Dependencies.MESSAGING_PROVIDERS);
const page = getPage(url);
const search = getSearch(url);
- const view = getView(url, route, View.Grid);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const view = getView(params.project, url, route, View.Grid);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
const query = getQuery(url);
diff --git a/src/routes/(console)/project-[region]-[project]/messaging/topics/+page.ts b/src/routes/(console)/project-[region]-[project]/messaging/topics/+page.ts
index 4e314b90af..2f3c2d76b6 100644
--- a/src/routes/(console)/project-[region]-[project]/messaging/topics/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/messaging/topics/+page.ts
@@ -5,11 +5,11 @@ import { Dependencies, PAGE_LIMIT } from '$lib/constants';
import { queryParamToMap, queries } from '$lib/components/filters';
import type { PageLoad } from './$types';
-export const load: PageLoad = async ({ depends, url, route }) => {
+export const load: PageLoad = async ({ depends, url, route, params }) => {
depends(Dependencies.MESSAGING_TOPICS);
const page = getPage(url);
const search = getSearch(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
const query = getQuery(url);
diff --git a/src/routes/(console)/project-[region]-[project]/messaging/topics/topic-[topic]/+page.ts b/src/routes/(console)/project-[region]-[project]/messaging/topics/topic-[topic]/+page.ts
index d4b3e9cc84..34a9e0eb6b 100644
--- a/src/routes/(console)/project-[region]-[project]/messaging/topics/topic-[topic]/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/messaging/topics/topic-[topic]/+page.ts
@@ -9,7 +9,7 @@ export const load: PageLoad = async ({ params, url, route, depends }) => {
depends(Dependencies.MESSAGING_TOPIC_SUBSCRIBERS);
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
const search = getSearch(url);
const query = getQuery(url);
diff --git a/src/routes/(console)/project-[region]-[project]/messaging/topics/topic-[topic]/activity/+page.ts b/src/routes/(console)/project-[region]-[project]/messaging/topics/topic-[topic]/activity/+page.ts
index 933026955d..f60702362c 100644
--- a/src/routes/(console)/project-[region]-[project]/messaging/topics/topic-[topic]/activity/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/messaging/topics/topic-[topic]/activity/+page.ts
@@ -6,7 +6,7 @@ import type { PageLoad } from './$types';
export const load: PageLoad = async ({ params, url, route }) => {
const page = getPage(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
return {
diff --git a/src/routes/(console)/project-[region]-[project]/settings/migrations/(import)/step2.svelte b/src/routes/(console)/project-[region]-[project]/settings/migrations/(import)/step2.svelte
index a786481319..cf0ade6672 100644
--- a/src/routes/(console)/project-[region]-[project]/settings/migrations/(import)/step2.svelte
+++ b/src/routes/(console)/project-[region]-[project]/settings/migrations/(import)/step2.svelte
@@ -1,7 +1,7 @@
@@ -18,5 +18,8 @@
Learn about which resources are supported.
-
+
diff --git a/src/routes/(console)/project-[region]-[project]/settings/webhooks/+page.ts b/src/routes/(console)/project-[region]-[project]/settings/webhooks/+page.ts
index 10e665b003..048eb91ce5 100644
--- a/src/routes/(console)/project-[region]-[project]/settings/webhooks/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/settings/webhooks/+page.ts
@@ -7,7 +7,7 @@ export const load: PageLoad = async ({ params, url, route, depends }) => {
depends(Dependencies.WEBHOOKS);
const page = getPage(url);
- const view = getView(url, route, View.Grid);
+ const view = getView(params.project, url, route, View.Grid);
return {
page,
diff --git a/src/routes/(console)/project-[region]-[project]/storage/+page.ts b/src/routes/(console)/project-[region]-[project]/storage/+page.ts
index b09a9ce595..6fe61a15bb 100644
--- a/src/routes/(console)/project-[region]-[project]/storage/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/storage/+page.ts
@@ -6,7 +6,7 @@ import type { PageLoad } from './$types';
export const load: PageLoad = async ({ url, route, params }) => {
const page = getPage(url);
- const limit = getLimit(url, route, CARD_LIMIT);
+ const limit = getLimit(params.project, url, route, CARD_LIMIT);
const offset = pageToOffset(page, limit);
return {
diff --git a/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/+page.ts b/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/+page.ts
index e95212ec0c..daf8d39e49 100644
--- a/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/+page.ts
+++ b/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/+page.ts
@@ -10,7 +10,7 @@ export const load: PageLoad = async ({ params, depends, url, route, parent }) =>
depends(Dependencies.FILES);
const page = getPage(url);
const search = getSearch(url);
- const limit = getLimit(url, route, PAGE_LIMIT);
+ const limit = getLimit(params.project, url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
const [files, organizationUsage] = await Promise.all([
diff --git a/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/create-file/create.svelte b/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/create-file/create.svelte
index 92a1e965d5..0c0ce134a5 100644
--- a/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/create-file/create.svelte
+++ b/src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/create-file/create.svelte
@@ -32,6 +32,8 @@
try {
const uploadPromise = uploader.uploadFile(
+ $page.params.region,
+ $page.params.project,
bucketId,
fileId,
$createFile.files[0],