mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
refactor: URL management for project route area!
This commit is contained in:
@@ -9,8 +9,7 @@
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { page } from '$app/state';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { base } from '$app/paths';
|
||||
import { getProjectId } from '$lib/helpers/project';
|
||||
import { getProjectId, getProjectRoute } from '$lib/helpers/project';
|
||||
import { toLocaleDate } from '$lib/helpers/date';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
|
||||
@@ -34,8 +33,6 @@
|
||||
|
||||
function showRestoreNotification(newDatabaseId: string, newDatabaseName: string) {
|
||||
if (newDatabaseId && newDatabaseName && lastDatabaseRestorationId !== newDatabaseId) {
|
||||
const region = page.params.region;
|
||||
const project = page.params.project;
|
||||
lastDatabaseRestorationId = newDatabaseId;
|
||||
|
||||
addNotification({
|
||||
@@ -46,9 +43,7 @@
|
||||
{
|
||||
name: 'View restored data',
|
||||
method: () => {
|
||||
goto(
|
||||
`${base}/project-${region}-${project}/databases/database-${newDatabaseId}`
|
||||
);
|
||||
goto(getProjectRoute(`/databases/database-${newDatabaseId}`));
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
import { newOrgModal } from '$lib/stores/organization';
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
import { page } from '$app/stores';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
type Project = {
|
||||
name: string;
|
||||
@@ -141,7 +142,7 @@
|
||||
if (index < 4) {
|
||||
return {
|
||||
name: project.name,
|
||||
href: `${base}/project-${project.region}-${project.$id}/overview`
|
||||
href: getProjectRoute(project, '/overview')
|
||||
};
|
||||
} else if (index === 4) {
|
||||
return {
|
||||
@@ -317,8 +318,7 @@
|
||||
{#if index < 4}
|
||||
<div use:melt={$itemProjects}>
|
||||
<ActionMenu.Root>
|
||||
<ActionMenu.Item.Anchor
|
||||
href={`${base}/project-${project.region}-${project.$id}`}>
|
||||
<ActionMenu.Item.Anchor href={getProjectRoute(project)}>
|
||||
{project.name}
|
||||
</ActionMenu.Item.Anchor>
|
||||
</ActionMenu.Root>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { getProjectId } from '$lib/helpers/project';
|
||||
import { getProjectId, getProjectRoute } from '$lib/helpers/project';
|
||||
import { writable, type Writable } from 'svelte/store';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Layout, Typography } from '@appwrite.io/pink-svelte';
|
||||
@@ -32,7 +31,7 @@
|
||||
importData: Payload
|
||||
) {
|
||||
await invalidate(Dependencies.DOCUMENTS);
|
||||
const url = `${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${collectionId}`;
|
||||
const url = getProjectRoute(`/databases/database-${databaseId}/collection-${collectionId}`);
|
||||
|
||||
// extract clean message from nested backend error.
|
||||
const match = importData.errors.join('').match(/message: '(.*)' Message:/i);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { EmptySearch, Id } from '.';
|
||||
import { onMount } from 'svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { goto } from '$app/navigation';
|
||||
@@ -30,6 +29,7 @@
|
||||
import { isSmallViewport } from '$lib/stores/viewport';
|
||||
import { IconViewGrid, IconViewList } from '@appwrite.io/pink-icons-svelte';
|
||||
import { showCreateBucket } from '$routes/(console)/project-[region]-[project]/storage/+page.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let show: boolean;
|
||||
export let mimeTypeQuery: string = 'image/';
|
||||
@@ -531,9 +531,7 @@
|
||||
<Button
|
||||
secondary
|
||||
on:click={async () => {
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/storage`
|
||||
);
|
||||
await goto(getProjectRoute('/storage'));
|
||||
$showCreateBucket = true;
|
||||
}}>
|
||||
Create bucket
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Link } from '$lib/elements';
|
||||
import { Alert } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let product: 'site' | 'function';
|
||||
</script>
|
||||
@@ -10,16 +10,14 @@
|
||||
{#if product === 'site'}
|
||||
<Alert.Inline status="info" title="Your logs are disabled">
|
||||
To view logs and errors, enable them in your
|
||||
<Link
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/sites/site-${page.params.site}/settings`}>
|
||||
<Link href={getProjectRoute(`/sites/site-${page.params.site}/settings`)}>
|
||||
site settings</Link
|
||||
>.
|
||||
</Alert.Inline>
|
||||
{:else if product === 'function'}
|
||||
<Alert.Inline status="info" title="Your execution logs are disabled">
|
||||
To view execution logs and errors, enable them in your
|
||||
<Link
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/settings`}>
|
||||
<Link href={getProjectRoute(`/functions/function-${page.params.function}/settings`)}>
|
||||
function settings</Link
|
||||
>.
|
||||
</Alert.Inline>
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
import { user } from '$lib/stores/user';
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
import type { HTMLAttributes } from 'svelte/elements';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
let showSupport = false;
|
||||
|
||||
@@ -135,9 +136,9 @@
|
||||
{#if selectedProject && selectedProject.pingCount === 0}
|
||||
<div class="only-desktop" style:margin-inline-start="-16px">
|
||||
<Button.Anchor
|
||||
href={`${base}/project-${selectedProject.region}-${selectedProject.$id}/get-started`}
|
||||
size="xs"
|
||||
variant="secondary"
|
||||
size="xs">Connect</Button.Anchor>
|
||||
href={getProjectRoute(selectedProject, '/get-started')}>Connect</Button.Anchor>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
} from '@appwrite.io/pink-svelte';
|
||||
import Avatar from '../avatar.svelte';
|
||||
import { IconAnonymous, IconExternalLink, IconMinusSm } from '@appwrite.io/pink-icons-svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let role: string;
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
{/if}
|
||||
<div>
|
||||
<Button.Anchor
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/auth/user-${data?.$id}`}
|
||||
href={getProjectRoute(`/auth/user-${data?.$id}`)}
|
||||
size="xs"
|
||||
target="_blank"
|
||||
variant="secondary">
|
||||
@@ -100,7 +100,7 @@
|
||||
<Typography.Text>Members: {data?.total}</Typography.Text>
|
||||
<div>
|
||||
<Button.Anchor
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/auth/teams/team-${data?.$id}`}
|
||||
href={getProjectRoute(`/auth/teams/team-${data?.$id}`)}
|
||||
size="s"
|
||||
target="_blank"
|
||||
variant="secondary">
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { get } from 'svelte/store';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { projectRegion } from '$routes/(console)/project-[region]-[project]/store';
|
||||
|
||||
/**
|
||||
@@ -42,3 +44,48 @@ export function getProjectEndpoint(): string {
|
||||
|
||||
return currentProjectRegion ? `${protocol}//${currentProjectRegion.$id}.${hostname}/v1` : href;
|
||||
}
|
||||
|
||||
/**
|
||||
* A minimal project shape with -
|
||||
* 1. `$id` and
|
||||
* 2. optional `region`.
|
||||
*
|
||||
* Compatible with full `Models.Project`.
|
||||
*/
|
||||
type CompatibleProjectInstance =
|
||||
| Models.Project
|
||||
| {
|
||||
$id: string;
|
||||
region?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Generates the project route URL, optionally using a custom project and/or path.
|
||||
* Falls back to the current route's project and region if not provided.
|
||||
*
|
||||
* @param projectOrPath Either a project object or a path string (e.g., "/databases").
|
||||
* @param maybePath Optional path string if the first argument is a project.
|
||||
*
|
||||
* @returns Project route URL (e.g., "/project-fra-console/databases").
|
||||
*/
|
||||
export function getProjectRoute(
|
||||
projectOrPath?: string | CompatibleProjectInstance,
|
||||
maybePath?: string
|
||||
): string {
|
||||
let withPath: string | undefined;
|
||||
let projectInstance: CompatibleProjectInstance | undefined;
|
||||
|
||||
if (typeof projectOrPath === 'string') {
|
||||
withPath = projectOrPath;
|
||||
projectInstance = undefined;
|
||||
} else {
|
||||
withPath = maybePath;
|
||||
projectInstance = projectOrPath;
|
||||
}
|
||||
|
||||
const projectId = projectInstance?.$id ?? page?.params?.project;
|
||||
const projectRegion = projectInstance?.region ?? page?.params?.region ?? 'default';
|
||||
const suffix = withPath?.trim() ? (withPath.startsWith('/') ? withPath : `/${withPath}`) : '';
|
||||
|
||||
return `${base}/project-${projectRegion}-${projectId}${suffix}`;
|
||||
}
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
IconRefresh,
|
||||
IconTrash
|
||||
} from '@appwrite.io/pink-icons-svelte';
|
||||
import { page } from '$app/state';
|
||||
import { base } from '$app/paths';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let rules: Models.ProxyRuleList;
|
||||
export let dependency: Dependencies;
|
||||
@@ -60,10 +59,7 @@
|
||||
<SearchQuery placeholder="Search by name" />
|
||||
</Layout.Stack>
|
||||
<Layout.Stack direction="row" alignItems="center" justifyContent="flex-end">
|
||||
<Button
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/settings/domains/create`}
|
||||
event="create_user"
|
||||
size="s">
|
||||
<Button href={getProjectRoute('/settings/domains/create')} event="create_user" size="s">
|
||||
<Icon size="s" icon={IconPlus} slot="start" />
|
||||
<span class="text">Create domain</span>
|
||||
</Button>
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
import { regions } from '$lib/stores/organization';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { migrationFormToResources } from '$lib/stores/migration';
|
||||
import { EyebrowHeading } from '$lib/components';
|
||||
import {
|
||||
@@ -35,6 +34,7 @@
|
||||
} from '@appwrite.io/pink-icons-svelte';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { filterRegions } from '$lib/helpers/regions';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const onExit = () => {
|
||||
formData.reset();
|
||||
@@ -123,9 +123,7 @@
|
||||
});
|
||||
onExit();
|
||||
await invalidate(Dependencies.PROJECTS);
|
||||
await goto(
|
||||
`${base}/project-${currentSelectedProject.region}-${currentSelectedProject.$id}/settings/migrations`
|
||||
);
|
||||
await goto(`${getProjectRoute(currentSelectedProject, '/settings/migrations')}`);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
} from '@appwrite.io/pink-icons-svelte';
|
||||
import type { LayoutData } from './$types';
|
||||
import type { NavbarProject } from '$lib/components/navbar.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
function kebabToSentenceCase(str: string) {
|
||||
return str
|
||||
@@ -175,9 +176,7 @@
|
||||
({
|
||||
label: kebabToSentenceCase(heading),
|
||||
async callback() {
|
||||
await goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/auth/security#${heading}`
|
||||
);
|
||||
await goto(getProjectRoute($project, `/auth/security#${heading}`));
|
||||
scrollBy({ top: -100 });
|
||||
},
|
||||
disabled: !$project?.$id,
|
||||
@@ -191,7 +190,7 @@
|
||||
|
||||
keys: isOnSettingsLayout ? ['g', 'o'] : undefined,
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/settings`);
|
||||
goto(getProjectRoute('/settings'));
|
||||
},
|
||||
disabled:
|
||||
!$project?.$id || (isOnSettingsLayout && page.url.pathname.endsWith('settings')),
|
||||
@@ -203,7 +202,7 @@
|
||||
|
||||
keys: isOnSettingsLayout ? ['g', 'd'] : undefined,
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/settings/domains`);
|
||||
goto(getProjectRoute('/settings/domains'));
|
||||
},
|
||||
disabled:
|
||||
!$project?.$id || (isOnSettingsLayout && page.url.pathname.includes('domains')),
|
||||
@@ -214,7 +213,7 @@
|
||||
label: 'Go to webhooks',
|
||||
keys: isOnSettingsLayout ? ['g', 'w'] : undefined,
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/settings/webhooks`);
|
||||
goto(getProjectRoute('/settings/webhooks'));
|
||||
},
|
||||
disabled:
|
||||
!$project?.$id || (isOnSettingsLayout && page.url.pathname.includes('webhooks')),
|
||||
@@ -226,7 +225,7 @@
|
||||
label: 'Go to migrations',
|
||||
keys: isOnSettingsLayout ? ['g', 'm'] : undefined,
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/settings/migrations`);
|
||||
goto(getProjectRoute('/settings/migrations'));
|
||||
},
|
||||
disabled:
|
||||
!$project?.$id || (isOnSettingsLayout && page.url.pathname.includes('migrations')),
|
||||
@@ -238,7 +237,7 @@
|
||||
label: 'Go to SMTP settings',
|
||||
keys: isOnSettingsLayout ? ['g', 's'] : undefined,
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/settings/smtp`);
|
||||
goto(getProjectRoute('/settings/smtp'));
|
||||
},
|
||||
disabled: !$project?.$id || (isOnSettingsLayout && page.url.pathname.includes('smtp')),
|
||||
group: isOnSettingsLayout ? 'navigation' : 'settings',
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import CreateProject from '$lib/layout/createProject.svelte';
|
||||
import { loadAvailableRegions } from '$routes/(console)/regions';
|
||||
import { regions as regionsStore } from '$lib/stores/organization';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
let isLoading = false;
|
||||
let id: string;
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
setTimeout(async () => {
|
||||
await invalidate(Dependencies.ACCOUNT);
|
||||
goto(`${base}/project-${project.region ?? 'default'}-${project.$id}`);
|
||||
goto(getProjectRoute(project));
|
||||
}, 3000);
|
||||
} catch (e) {
|
||||
trackError(e, Submit.ProjectCreate);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { Container } from '$lib/layout';
|
||||
import CreateProject from './createProject.svelte';
|
||||
@@ -39,6 +38,7 @@
|
||||
import { getPlatformInfo } from '$lib/helpers/platform';
|
||||
import CreateProjectCloud from './createProjectCloud.svelte';
|
||||
import { regions as regionsStore } from '$lib/stores/organization';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
trackEvent(Submit.ProjectCreate, {
|
||||
teamId: page.params.organization
|
||||
});
|
||||
await goto(`${base}/project-${project.region}-${project.$id}/settings/migrations`);
|
||||
await goto(getProjectRoute(project, '/settings/migrations'));
|
||||
openImportWizard();
|
||||
loading.set(false);
|
||||
} catch (e) {
|
||||
@@ -155,7 +155,7 @@
|
||||
{@const platforms = filterPlatforms(
|
||||
project.platforms.map((platform) => getPlatformInfo(platform.type))
|
||||
)}
|
||||
<GridItem1 href={`${base}/project-${project.region}-${project.$id}`}>
|
||||
<GridItem1 href={getProjectRoute(project)}>
|
||||
<svelte:fragment slot="eyebrow">
|
||||
{project?.platforms?.length ? project?.platforms?.length : 'No'} apps
|
||||
</svelte:fragment>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { Modal, CustomId } from '$lib/components';
|
||||
import { InputText, Button } from '$lib/elements/forms';
|
||||
@@ -10,6 +9,7 @@
|
||||
import { IconPencil } from '@appwrite.io/pink-icons-svelte';
|
||||
import { Icon, Layout, Tag } from '@appwrite.io/pink-svelte';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let show = false;
|
||||
export let teamId: string;
|
||||
@@ -36,7 +36,7 @@
|
||||
type: 'success',
|
||||
message: `${name} has been created`
|
||||
});
|
||||
await goto(`${base}/project-${project.region ?? 'default'}-${project.$id}`);
|
||||
await goto(getProjectRoute(project));
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.ProjectCreate);
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { ID, Region as ConsoleRegion, type Models, Region } from '@appwrite.io/console';
|
||||
import { Button } from '@appwrite.io/pink-svelte';
|
||||
import { base } from '$app/paths';
|
||||
import CreateProject from '$lib/layout/createProject.svelte';
|
||||
import { Modal } from '$lib/components';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const teamId = page.params.organization;
|
||||
export let regions: Array<Models.ConsoleRegion> = [];
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
let id: string = null;
|
||||
let name: string = 'Appwrite project';
|
||||
let region: string = Region.Fra;
|
||||
let region: ConsoleRegion = Region.Fra;
|
||||
|
||||
async function onFinish() {
|
||||
await invalidate(Dependencies.FUNCTIONS);
|
||||
@@ -27,12 +27,7 @@
|
||||
async function create() {
|
||||
try {
|
||||
// TODO: fix typing once SDK is updated
|
||||
const project = await sdk.forConsole.projects.create(
|
||||
id ?? ID.unique(),
|
||||
name,
|
||||
teamId,
|
||||
region as ConsoleRegion
|
||||
);
|
||||
await sdk.forConsole.projects.create(id ?? ID.unique(), name, teamId, region);
|
||||
trackEvent(Submit.ProjectCreate, {
|
||||
customId: !!id,
|
||||
teamId,
|
||||
@@ -43,7 +38,7 @@
|
||||
message: `${name} has been created`
|
||||
});
|
||||
await onFinish();
|
||||
await goto(`${base}/project-${project.region}-${project.$id}`);
|
||||
await goto(getProjectRoute());
|
||||
} catch (e) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -56,7 +51,7 @@
|
||||
onDestroy(() => {
|
||||
id = null;
|
||||
name = null;
|
||||
region = 'fra';
|
||||
region = ConsoleRegion.Fra;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { BackupRestoreBox, MigrationBox, UploadBox } from '$lib/components';
|
||||
import { realtime } from '$lib/stores/sdk';
|
||||
import { onMount } from 'svelte';
|
||||
import { project, stats } from './store';
|
||||
import { stats } from './store';
|
||||
|
||||
import { goto } from '$app/navigation';
|
||||
import { registerCommands, registerSearchers } from '$lib/commandCenter';
|
||||
@@ -15,7 +15,6 @@
|
||||
userSearcher
|
||||
} from '$lib/commandCenter/searchers';
|
||||
import { page } from '$app/state';
|
||||
import { base } from '$app/paths';
|
||||
import {
|
||||
canSeeBuckets,
|
||||
canSeeDatabases,
|
||||
@@ -25,6 +24,7 @@
|
||||
canWriteSites
|
||||
} from '$lib/stores/roles';
|
||||
import CsvImportBox from '$lib/components/csvImportBox.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
onMount(() => {
|
||||
return realtime
|
||||
@@ -42,7 +42,7 @@
|
||||
{
|
||||
label: 'Go to Auth',
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/auth`);
|
||||
goto(getProjectRoute('/auth'));
|
||||
},
|
||||
keys: ['g', 'a'],
|
||||
group: 'navigation'
|
||||
@@ -50,7 +50,7 @@
|
||||
{
|
||||
label: 'Go to Databases',
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/databases`);
|
||||
goto(getProjectRoute('/databases'));
|
||||
},
|
||||
keys: ['g', 'd'],
|
||||
group: 'navigation',
|
||||
@@ -59,7 +59,7 @@
|
||||
{
|
||||
label: 'Go to Functions',
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/functions`);
|
||||
goto(getProjectRoute('/functions'));
|
||||
},
|
||||
keys: ['g', 'f'],
|
||||
group: 'navigation',
|
||||
@@ -68,7 +68,7 @@
|
||||
{
|
||||
label: 'Go to Messaging',
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/messaging`);
|
||||
goto(getProjectRoute('/messaging'));
|
||||
},
|
||||
keys: ['g', 'm'],
|
||||
disabled: page.url.pathname.endsWith('messaging') || !$canSeeMessages,
|
||||
@@ -77,7 +77,7 @@
|
||||
{
|
||||
label: 'Go to Storage',
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/storage`);
|
||||
goto(getProjectRoute('/storage'));
|
||||
},
|
||||
keys: ['g', 's'],
|
||||
group: 'navigation',
|
||||
@@ -86,7 +86,7 @@
|
||||
{
|
||||
label: 'Go to Settings',
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/settings`);
|
||||
goto(getProjectRoute('/settings'));
|
||||
},
|
||||
keys: ['g', 'e'],
|
||||
group: 'navigation',
|
||||
@@ -95,7 +95,7 @@
|
||||
{
|
||||
label: 'Go to Sites',
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/sites`);
|
||||
goto(getProjectRoute('/sites'));
|
||||
},
|
||||
keys: ['g', 'i'],
|
||||
group: 'navigation',
|
||||
@@ -104,7 +104,7 @@
|
||||
{
|
||||
label: 'Go to Overview',
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}`);
|
||||
goto(getProjectRoute());
|
||||
},
|
||||
keys: ['g', 'o'],
|
||||
group: 'navigation'
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { addSubPanel, registerCommands, updateCommandGroupRanks } from '$lib/commandCenter';
|
||||
import { TeamsPanel, UsersPanel } from '$lib/commandCenter/panels';
|
||||
import { readOnly } from '$lib/stores/billing';
|
||||
import { canWriteTeams, canWriteUsers } from '$lib/stores/roles';
|
||||
import { GRACE_PERIOD_OVERRIDE } from '$lib/system';
|
||||
import { project } from '../store';
|
||||
import { showCreateUser } from './+page.svelte';
|
||||
import { showCreateTeam } from './teams/+page.svelte';
|
||||
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: $registerCommands([
|
||||
{
|
||||
label: 'Create user',
|
||||
callback: async () => {
|
||||
if (!page.url.pathname.endsWith('auth')) {
|
||||
await goto(`${base}/project-${$project.region}-${$project.$id}/auth`);
|
||||
await goto(getProjectRoute('/auth'));
|
||||
}
|
||||
showCreateUser.set(true);
|
||||
},
|
||||
@@ -31,7 +30,7 @@
|
||||
label: 'Create team',
|
||||
callback: async () => {
|
||||
if (!page.url.pathname.endsWith('teams')) {
|
||||
await goto(`${base}/project-${$project.region}-${$project.$id}/auth/teams`);
|
||||
await goto(getProjectRoute('/auth/teams'));
|
||||
}
|
||||
showCreateTeam.set(true);
|
||||
},
|
||||
@@ -46,7 +45,7 @@
|
||||
label: 'Go to teams',
|
||||
keys: ['g', 't'],
|
||||
callback() {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/auth/teams`);
|
||||
goto(getProjectRoute('/auth/teams'));
|
||||
},
|
||||
group: 'navigation',
|
||||
rank: 1,
|
||||
@@ -56,7 +55,7 @@
|
||||
label: 'Go to usage',
|
||||
keys: ['g', 'u'],
|
||||
callback() {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/auth/usage`);
|
||||
goto(getProjectRoute('/auth/usage'));
|
||||
},
|
||||
group: 'navigation',
|
||||
rank: 1,
|
||||
@@ -66,7 +65,7 @@
|
||||
label: 'Go to security',
|
||||
keys: ['g', 'e'],
|
||||
callback() {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/auth/security`);
|
||||
goto(getProjectRoute('/auth/security'));
|
||||
},
|
||||
group: 'navigation',
|
||||
rank: 1,
|
||||
@@ -76,7 +75,7 @@
|
||||
label: 'Go to settings',
|
||||
keys: ['g', 's'],
|
||||
callback() {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/auth/settings`);
|
||||
goto(getProjectRoute('/auth/settings'));
|
||||
},
|
||||
group: 'navigation',
|
||||
rank: 1,
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import {
|
||||
AvatarInitials,
|
||||
Copy,
|
||||
@@ -27,6 +25,7 @@
|
||||
import type { Column } from '$lib/helpers/types';
|
||||
import ViewSelector from '$lib/components/viewSelector.svelte';
|
||||
import { View } from '$lib/helpers/load';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -47,9 +46,7 @@
|
||||
]);
|
||||
|
||||
async function userCreated(event: CustomEvent<Models.User<Record<string, unknown>>>) {
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/auth/user-${event.detail.$id}`
|
||||
);
|
||||
await goto(getProjectRoute(`/auth/user-${event.detail.$id}`));
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -75,9 +72,7 @@
|
||||
{/each}
|
||||
</svelte:fragment>
|
||||
{#each data.users.users as user}
|
||||
<Table.Row.Link
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/auth/user-${user.$id}`}
|
||||
{root}>
|
||||
<Table.Row.Link href={getProjectRoute(`/auth/user-${user.$id}`)} {root}>
|
||||
{#each $columns as { id } (id)}
|
||||
<Table.Cell column={id} {root}>
|
||||
{#if id === '$id'}
|
||||
@@ -162,10 +157,7 @@
|
||||
total={data.users.total} />
|
||||
{:else if data.search}
|
||||
<EmptySearch target="users" hidePagination>
|
||||
<Button
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/auth`}
|
||||
size="s"
|
||||
secondary>Clear Search</Button>
|
||||
<Button href={getProjectRoute('/auth')} size="s" secondary>Clear Search</Button>
|
||||
</EmptySearch>
|
||||
{:else}
|
||||
<Empty
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { Breadcrumbs } from '$lib/layout';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { project } from '../store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: breadcrumbs = [
|
||||
{
|
||||
@@ -10,11 +11,11 @@
|
||||
title: $organization?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${$project.region}-${$project?.$id}`,
|
||||
href: getProjectRoute(),
|
||||
title: $project?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${$project.region}-${$project?.$id}/auth`,
|
||||
href: getProjectRoute('/auth'),
|
||||
title: 'Auth'
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Tab, Tabs } from '$lib/components';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover } from '$lib/layout';
|
||||
import { canWriteProjects } from '$lib/stores/roles';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const path = `${base}/project-${page.params.region}-${page.params.project}/auth`;
|
||||
const path = getProjectRoute('/auth');
|
||||
const tabs = [
|
||||
{
|
||||
href: path,
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import {
|
||||
Empty,
|
||||
@@ -15,20 +14,18 @@
|
||||
import Create from '../createTeam.svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { Container } from '$lib/layout';
|
||||
import { base } from '$app/paths';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { writable } from 'svelte/store';
|
||||
import { canWriteTeams } from '$lib/stores/roles';
|
||||
import { Icon, Layout, Table } from '@appwrite.io/pink-svelte';
|
||||
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
|
||||
import DualTimeView from '$lib/components/dualTimeView.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
const region = page.params.region;
|
||||
const project = page.params.project;
|
||||
const teamCreated = async (event: CustomEvent<Models.Team<Record<string, unknown>>>) => {
|
||||
await goto(`${base}/project-${region}-${project}/auth/teams/team-${event.detail.$id}`);
|
||||
await goto(getProjectRoute(`/auth/teams/team-${event.detail.$id}`));
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -53,9 +50,7 @@
|
||||
<Table.Header.Cell {root}>Created</Table.Header.Cell>
|
||||
</svelte:fragment>
|
||||
{#each data.teams.teams as team}
|
||||
<Table.Row.Link
|
||||
{root}
|
||||
href={`${base}/project-${region}-${project}/auth/teams/team-${team.$id}`}>
|
||||
<Table.Row.Link {root} href={getProjectRoute(`/auth/teams/team-${team.$id}`)}>
|
||||
<Table.Cell {root}>
|
||||
<Layout.Stack direction="row" alignItems="center">
|
||||
<AvatarInitials size="xs" name={team.name} />
|
||||
@@ -79,9 +74,7 @@
|
||||
total={data.teams.total} />
|
||||
{:else if data.search}
|
||||
<EmptySearch target="teams" search={data.search} hidePagination={data.teams.total === 0}>
|
||||
<Button secondary size="s" href={`${base}/project-${region}-${project}/auth/teams`}>
|
||||
Clear Search
|
||||
</Button>
|
||||
<Button secondary size="s" href={getProjectRoute('/auth/teams')}>Clear Search</Button>
|
||||
</EmptySearch>
|
||||
{:else}
|
||||
<Empty
|
||||
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Breadcrumbs } from '$lib/layout';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { project } from '../../../store';
|
||||
import { team } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: breadcrumbs = [
|
||||
{
|
||||
@@ -12,15 +12,15 @@
|
||||
title: $organization?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}`,
|
||||
href: getProjectRoute(),
|
||||
title: $project?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/auth`,
|
||||
href: getProjectRoute('/auth'),
|
||||
title: 'Auth'
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/auth/teams/team-${$team?.$id}`,
|
||||
href: getProjectRoute(`/auth/teams/team-${$team?.$id}`),
|
||||
title: $team?.name
|
||||
}
|
||||
];
|
||||
|
||||
+2
-4
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
@@ -8,6 +7,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
showDelete = false;
|
||||
dispatch('deleted');
|
||||
trackEvent(Submit.MemberDelete);
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/auth/teams/team-${selectedMembership.teamId}/members`
|
||||
);
|
||||
await goto(getProjectRoute(`/auth/teams/team-${selectedMembership.teamId}/members`));
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.MemberDelete);
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let showDelete = false;
|
||||
export let team: Models.Team<Record<string, unknown>>;
|
||||
@@ -18,7 +18,7 @@
|
||||
await sdk.forProject(page.params.region, page.params.project).teams.delete(team.$id);
|
||||
showDelete = false;
|
||||
trackEvent(Submit.TeamDelete);
|
||||
await goto(`${base}/project-${page.params.region}-${page.params.project}/auth/teams`);
|
||||
await goto(getProjectRoute('/auth/teams'));
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.TeamDelete);
|
||||
|
||||
+3
-4
@@ -1,12 +1,12 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Id, Tab, Tabs } from '$lib/components';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { team } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const path = `${base}/project-${page.params.region}-${page.params.project}/auth/teams/team-${page.params.team}`;
|
||||
const path = getProjectRoute(`/auth/teams/team-${page.params.team}`);
|
||||
const tabs = [
|
||||
{
|
||||
href: path,
|
||||
@@ -30,8 +30,7 @@
|
||||
|
||||
<Cover>
|
||||
<svelte:fragment slot="header">
|
||||
<CoverTitle
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/auth/teams`}>
|
||||
<CoverTitle href={getProjectRoute('/auth/teams')}>
|
||||
{$team?.name}
|
||||
</CoverTitle>
|
||||
<Id value={$team?.$id} event="team">{$team?.$id}</Id>
|
||||
|
||||
+2
-7
@@ -5,7 +5,6 @@
|
||||
import { Container } from '$lib/layout';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import type { PageData } from './$types';
|
||||
import CreateMember from '../createMembership.svelte';
|
||||
@@ -14,6 +13,7 @@
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
import { Table, Layout, Icon } from '@appwrite.io/pink-svelte';
|
||||
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
let showDelete = false;
|
||||
let selectedMembership: Models.Membership;
|
||||
|
||||
const region = page.params.region;
|
||||
const project = page.params.project;
|
||||
|
||||
async function memberCreated() {
|
||||
invalidate(Dependencies.MEMBERSHIPS);
|
||||
}
|
||||
@@ -54,9 +51,7 @@
|
||||
</svelte:fragment>
|
||||
{#each data.memberships.memberships as membership}
|
||||
{@const username = membership.userName ? membership.userName : '-'}
|
||||
<Table.Row.Link
|
||||
{root}
|
||||
href={`${base}/project-${region}-${project}/auth/user-${membership.userId}`}>
|
||||
<Table.Row.Link {root} href={getProjectRoute(`/auth/user-${membership.userId}`)}>
|
||||
<Table.Cell column="name" {root}>
|
||||
<Layout.Stack direction="row" alignItems="center">
|
||||
<AvatarInitials size="xs" name={username} />
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { CardGrid } from '$lib/components';
|
||||
import { Container } from '$lib/layout';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
@@ -59,7 +58,7 @@
|
||||
EmailTemplateLocale
|
||||
} from '@appwrite.io/console';
|
||||
import { Accordion, Alert, Badge, Layout, Link, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { page } from '$app/state';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -76,7 +75,7 @@
|
||||
|
||||
async function openEmail(type: string) {
|
||||
type === emailOpen ? (emailOpen = null) : (emailOpen = type);
|
||||
$emailTemplate = await loadEmailTemplate(page.params.project, type, 'en');
|
||||
// $emailTemplate = await loadEmailTemplate(page.params.project, type, 'en');
|
||||
$baseEmailTemplate = { ...$emailTemplate };
|
||||
}
|
||||
</script>
|
||||
@@ -89,10 +88,7 @@
|
||||
title="Custom SMTP server is required for customizing emails">
|
||||
Configure a custom SMTP server to enable custom email templates and prevent emails from
|
||||
being labeled as spam.
|
||||
<Button
|
||||
compact
|
||||
slot="actions"
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/settings/smtp`}>
|
||||
<Button compact slot="actions" href={getProjectRoute('/settings/smtp')}>
|
||||
SMTP settings
|
||||
</Button>
|
||||
</Alert.Inline>
|
||||
@@ -187,6 +183,7 @@
|
||||
<Email2FaTemplate /></Layout.Stack>
|
||||
</Accordion>
|
||||
<Accordion
|
||||
hideDivider
|
||||
title="Session alert"
|
||||
bind:open={emailSessionAlertOpen}
|
||||
on:click={(e) => {
|
||||
@@ -201,11 +198,7 @@
|
||||
</Layout.Stack>
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="actions">
|
||||
<Button
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/settings/smtp`}
|
||||
secondary>
|
||||
SMTP settings
|
||||
</Button>
|
||||
<Button href={getProjectRoute('/settings/smtp')} secondary>SMTP settings</Button>
|
||||
</svelte:fragment>
|
||||
</CardGrid>
|
||||
{#if isCloud && $currentPlan.emailBranding}
|
||||
|
||||
+2
-2
@@ -21,12 +21,12 @@
|
||||
{#if $app.themeInUse === 'dark'}
|
||||
<img
|
||||
src={EmailMobileDark}
|
||||
class="u-image-object-fit-cover u-only-dark u-width-full-line u-height-100-percent"
|
||||
class="u-image-object-fit-cover u-only-dark u-width-full-line"
|
||||
alt="Email Signature Example" />
|
||||
{:else}
|
||||
<img
|
||||
src={EmailMobileLight}
|
||||
class="u-image-object-fit-cover u-only-light u-width-full-line u-height-100-percent"
|
||||
class="u-image-object-fit-cover u-only-light u-width-full-line"
|
||||
alt="Email Signature Example" />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Container, Usage } from '$lib/layout';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
$: total = data.usersTotal;
|
||||
@@ -10,7 +9,7 @@
|
||||
|
||||
<Container>
|
||||
<Usage
|
||||
path={`${base}/project-${page.params.region}-${page.params.project}/auth/usage`}
|
||||
path={getProjectRoute('/auth/usage')}
|
||||
countMetadata={{
|
||||
legend: 'Users',
|
||||
title: 'Registered users'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Breadcrumbs } from '$lib/layout';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { project } from '../../store';
|
||||
import { user } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: breadcrumbs = [
|
||||
{
|
||||
@@ -12,15 +12,15 @@
|
||||
title: $organization?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}`,
|
||||
href: getProjectRoute(),
|
||||
title: $project?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/auth`,
|
||||
href: getProjectRoute('/auth'),
|
||||
title: 'Auth'
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/auth/user-${$user?.$id}`,
|
||||
href: getProjectRoute(`/auth/user-${$user?.$id}`),
|
||||
title: $user?.name
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<script lang="ts" context="module">
|
||||
import { page } from '$app/state';
|
||||
import { base } from '$app/paths';
|
||||
import { goto } from '$app/navigation';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
let showDelete = writable(false);
|
||||
|
||||
export const promptDeleteUser = (id: string) => {
|
||||
showDelete.set(true);
|
||||
goto(`${base}/project-${page.params.region}-${page.params.project}/auth/user-${id}`);
|
||||
goto(getProjectRoute(`/auth/user-${id}`));
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
+2
-4
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
@@ -9,6 +8,7 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let showDelete = false;
|
||||
export let selectedMembership: Models.Membership;
|
||||
@@ -27,9 +27,7 @@
|
||||
message: `Membership has been deleted`
|
||||
});
|
||||
trackEvent(Submit.MemberDelete);
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/auth/user-${selectedMembership.userId}/memberships`
|
||||
);
|
||||
await goto(getProjectRoute(`/auth/user-${selectedMembership.userId}/memberships`));
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.MemberDelete);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
@@ -9,6 +8,7 @@
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
import { user } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let showDelete = false;
|
||||
let error: string;
|
||||
@@ -21,7 +21,7 @@
|
||||
message: `${$user.name ? $user.name : 'User'} has been deleted`
|
||||
});
|
||||
trackEvent(Submit.UserDelete);
|
||||
await goto(`${base}/project-${page.params.region}-${page.params.project}/auth`);
|
||||
await goto(getProjectRoute('/auth'));
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.UserDelete);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Id, Tab, Tabs } from '$lib/components';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { user } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const path = `${base}/project-${page.params.region}-${page.params.project}/auth/user-${page.params.user}`;
|
||||
const path = getProjectRoute(`/auth/user-${page.params.user}`);
|
||||
const tabs = [
|
||||
{
|
||||
href: path,
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
<Cover>
|
||||
<svelte:fragment slot="header">
|
||||
<CoverTitle href={`${base}/project-${page.params.region}-${page.params.project}/auth`}>
|
||||
<CoverTitle href={getProjectRoute('/auth')}>
|
||||
{$user.name ? $user.name : '-'}
|
||||
</CoverTitle>
|
||||
<Id value={$user.$id} event="user">{$user.$id}</Id>
|
||||
|
||||
+2
-6
@@ -1,6 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import { base } from '$app/paths';
|
||||
import { AvatarInitials } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { Container } from '$lib/layout';
|
||||
@@ -9,14 +7,12 @@
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import { Table, Layout, Empty, Card } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
let selectedMembership: Models.Membership;
|
||||
let showDelete = false;
|
||||
|
||||
const region = page.params.region;
|
||||
const project = page.params.project;
|
||||
</script>
|
||||
|
||||
<Container>
|
||||
@@ -38,7 +34,7 @@
|
||||
{#each data.memberships.memberships as membership}
|
||||
<Table.Row.Link
|
||||
{root}
|
||||
href={`${base}/project-${region}-${project}/auth/teams/team-${membership.teamId}`}>
|
||||
href={getProjectRoute(`/auth/teams/team-${membership.teamId}`)}>
|
||||
<Table.Cell column="name" {root}>
|
||||
<Layout.Stack direction="row" alignItems="center">
|
||||
<AvatarInitials size="xs" name={membership.teamName} />
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
import { InputText } from '$lib/elements/forms';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { project } from './store';
|
||||
import { base } from '$app/paths';
|
||||
import { Alert, Layout, Selector, Button as PinkButton, Icon } from '@appwrite.io/pink-svelte';
|
||||
import { Link } from '$lib/elements';
|
||||
import { IconPlus, IconX } from '@appwrite.io/pink-icons-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let isGlobal: boolean;
|
||||
export let product: 'function' | 'site' = 'function';
|
||||
@@ -61,7 +60,7 @@
|
||||
{#if !isGlobal}
|
||||
<Alert.Inline>
|
||||
When there is a naming conflict with a global variable in your <Link
|
||||
href={`${base}/project-${$project.region}-${$project.$id}/settings/variables`}>
|
||||
href={getProjectRoute('/settings/variables')}>
|
||||
project settings</Link>
|
||||
and a {product} environment variable, the global variable will be ignored.
|
||||
</Alert.Inline>
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { addSubPanel, registerCommands, updateCommandGroupRanks } from '$lib/commandCenter';
|
||||
import { DatabasesPanel } from '$lib/commandCenter/panels';
|
||||
import { project } from '../store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: $registerCommands([
|
||||
{
|
||||
label: 'Go to usage',
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/databases/usage`);
|
||||
goto(getProjectRoute('/databases/usage'));
|
||||
},
|
||||
keys: ['g', 'u'],
|
||||
disabled:
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Empty, PaginationWithLimit, SearchQuery, ViewSelector } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { Container } from '$lib/layout';
|
||||
@@ -17,18 +15,16 @@
|
||||
import { Icon, Layout } from '@appwrite.io/pink-svelte';
|
||||
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
|
||||
import EmptySearch from '$lib/components/emptySearch.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
let showCreate = false;
|
||||
let isCreationDisabled = false;
|
||||
const project = page.params.project;
|
||||
|
||||
async function handleCreate(event: CustomEvent<Models.Database>) {
|
||||
showCreate = false;
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${project}/databases/database-${event.detail.$id}`
|
||||
);
|
||||
await goto(getProjectRoute(`/databases/database-${event.detail.$id}`));
|
||||
}
|
||||
|
||||
$: $registerCommands([
|
||||
@@ -83,10 +79,7 @@
|
||||
total={data.databases.total} />
|
||||
{:else if data.search}
|
||||
<EmptySearch target="databases" hidePagination>
|
||||
<Button
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/databases`}
|
||||
size="s"
|
||||
secondary>Clear Search</Button>
|
||||
<Button href={getProjectRoute('/databases')} size="s" secondary>Clear Search</Button>
|
||||
</EmptySearch>
|
||||
{:else}
|
||||
<Empty
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { Breadcrumbs } from '$lib/layout';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { project } from '../store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: breadcrumbs = [
|
||||
{
|
||||
@@ -11,11 +12,11 @@
|
||||
title: $organization?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}`,
|
||||
href: getProjectRoute(),
|
||||
title: $project?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/databases`,
|
||||
href: getProjectRoute('/databases'),
|
||||
title: 'Databases'
|
||||
}
|
||||
];
|
||||
|
||||
+9
-24
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import {
|
||||
addSubPanel,
|
||||
@@ -19,15 +18,15 @@
|
||||
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
|
||||
import { currentPlan } from '$lib/stores/organization';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const project = page.params.project;
|
||||
const databaseId = page.params.database;
|
||||
|
||||
async function handleCreate(event: CustomEvent<Models.Collection>) {
|
||||
$showCreate = false;
|
||||
await invalidate(Dependencies.DATABASE);
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${project}/databases/database-${databaseId}/collection-${event.detail.$id}`
|
||||
getProjectRoute(`/databases/database-${databaseId}/collection-${event.detail.$id}`)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -37,9 +36,7 @@
|
||||
callback() {
|
||||
$showCreate = true;
|
||||
if (!page.url.pathname.endsWith(databaseId)) {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${project}/databases/database-${databaseId}`
|
||||
);
|
||||
goto(getProjectRoute(`/databases/database-${databaseId}`));
|
||||
}
|
||||
},
|
||||
keys: page.url.pathname.endsWith(databaseId) ? ['c'] : ['c', 'c'],
|
||||
@@ -51,9 +48,7 @@
|
||||
label: 'Create backup policy',
|
||||
callback: async () => {
|
||||
if (!page.url.pathname.endsWith('backups')) {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${project}/databases/database-${databaseId}/backups`
|
||||
);
|
||||
goto(getProjectRoute(`/databases/database-${databaseId}/backups`));
|
||||
}
|
||||
showCreatePolicy.set(true);
|
||||
},
|
||||
@@ -67,9 +62,7 @@
|
||||
label: 'Create manual backup',
|
||||
callback: async () => {
|
||||
if (!page.url.pathname.endsWith('backups')) {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${project}/databases/database-${databaseId}/backups`
|
||||
);
|
||||
goto(getProjectRoute(`/databases/database-${databaseId}/backups`));
|
||||
}
|
||||
showCreateBackup.set(true);
|
||||
},
|
||||
@@ -82,9 +75,7 @@
|
||||
{
|
||||
label: 'Go to collections',
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${project}/databases/database-${databaseId}`
|
||||
);
|
||||
goto(getProjectRoute(`/databases/database-${databaseId}`));
|
||||
},
|
||||
disabled:
|
||||
page.url.pathname.endsWith(databaseId) || page.url.pathname.includes('collection-'),
|
||||
@@ -94,9 +85,7 @@
|
||||
{
|
||||
label: 'Go to usage',
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${project}/databases/database-${databaseId}/usage`
|
||||
);
|
||||
goto(getProjectRoute(`/databases/database-${databaseId}/usage`));
|
||||
},
|
||||
disabled:
|
||||
page.url.pathname.includes('/usage') || page.url.pathname.includes('collection-'),
|
||||
@@ -106,9 +95,7 @@
|
||||
{
|
||||
label: 'Go to backups',
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${project}/databases/database-${databaseId}/backups`
|
||||
);
|
||||
goto(getProjectRoute(`/databases/database-${databaseId}/backups`));
|
||||
},
|
||||
disabled:
|
||||
page.url.pathname.includes('/backups') || page.url.pathname.includes('collection-'),
|
||||
@@ -118,9 +105,7 @@
|
||||
{
|
||||
label: 'Go to settings',
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${project}/databases/database-${databaseId}/settings`
|
||||
);
|
||||
goto(getProjectRoute(`/databases/database-${databaseId}/settings`));
|
||||
},
|
||||
disabled:
|
||||
page.url.pathname.includes('/settings') ||
|
||||
|
||||
+4
-3
@@ -4,6 +4,7 @@
|
||||
import { Breadcrumbs } from '$lib/layout';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { database } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: breadcrumbs = [
|
||||
{
|
||||
@@ -11,15 +12,15 @@
|
||||
title: $organization.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}`,
|
||||
href: getProjectRoute(),
|
||||
title: page.data.project.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/databases`,
|
||||
href: getProjectRoute('/databases'),
|
||||
title: 'Databases'
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database.$id}`,
|
||||
href: getProjectRoute(`/databases/database-${$database.$id}`),
|
||||
title: $database.name
|
||||
}
|
||||
];
|
||||
|
||||
+31
-12
@@ -26,12 +26,11 @@
|
||||
import type { Option } from './attributes/store';
|
||||
import { CreateAttributePanel } from '$lib/commandCenter/panels';
|
||||
import { database } from '../store';
|
||||
import { project } from '$routes/(console)/project-[region]-[project]/store';
|
||||
import { page } from '$app/state';
|
||||
import CreateIndex from './indexes/createIndex.svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { canWriteCollections } from '$lib/stores/roles';
|
||||
import { IconEye, IconLockClosed, IconPlus, IconPuzzle } from '@appwrite.io/pink-icons-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
onMount(() => {
|
||||
return realtime
|
||||
@@ -52,7 +51,9 @@
|
||||
keys: page.url.pathname.endsWith($collection.$id) ? ['c'] : ['c', 'd'],
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database?.$id}/collection-${$collection?.$id}/create`
|
||||
getProjectRoute(
|
||||
`/databases/database-${$database?.$id}/collection-${$collection?.$id}/create`
|
||||
)
|
||||
);
|
||||
},
|
||||
icon: IconPlus,
|
||||
@@ -73,7 +74,9 @@
|
||||
keys: ['g', 'd'],
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database?.$id}/collection-${$collection?.$id}`
|
||||
getProjectRoute(
|
||||
`/databases/database-${$database?.$id}/collection-${$collection?.$id}`
|
||||
)
|
||||
);
|
||||
},
|
||||
disabled: page.url.pathname.endsWith($collection.$id),
|
||||
@@ -84,7 +87,9 @@
|
||||
keys: ['g', 'a'],
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database?.$id}/collection-${$collection?.$id}/attributes`
|
||||
getProjectRoute(
|
||||
`/databases/database-${$database?.$id}/collection-${$collection?.$id}/attributes`
|
||||
)
|
||||
);
|
||||
},
|
||||
disabled: page.url.pathname.endsWith('attributes'),
|
||||
@@ -95,7 +100,9 @@
|
||||
keys: ['g', 'i'],
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database?.$id}/collection-${$collection?.$id}/indexes`
|
||||
getProjectRoute(
|
||||
`/databases/database-${$database?.$id}/collection-${$collection?.$id}/indexes`
|
||||
)
|
||||
);
|
||||
},
|
||||
disabled: page.url.pathname.endsWith('indexes'),
|
||||
@@ -106,7 +113,9 @@
|
||||
keys: ['g', 'c'],
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database?.$id}/collection-${$collection?.$id}/activity`
|
||||
getProjectRoute(
|
||||
`/databases/database-${$database?.$id}/collection-${$collection?.$id}/activity`
|
||||
)
|
||||
);
|
||||
},
|
||||
disabled: page.url.pathname.endsWith('activity'),
|
||||
@@ -117,7 +126,9 @@
|
||||
keys: ['g', 'u'],
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database?.$id}/collection-${$collection?.$id}/usage`
|
||||
getProjectRoute(
|
||||
`/databases/database-${$database?.$id}/collection-${$collection?.$id}/usage`
|
||||
)
|
||||
);
|
||||
},
|
||||
disabled: page.url.pathname.endsWith('usage'),
|
||||
@@ -128,7 +139,9 @@
|
||||
keys: ['g', 's'],
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database?.$id}/collection-${$collection?.$id}/settings`
|
||||
getProjectRoute(
|
||||
`/databases/database-${$database?.$id}/collection-${$collection?.$id}/settings`
|
||||
)
|
||||
);
|
||||
},
|
||||
disabled: page.url.pathname.endsWith('settings') || !$canWriteCollections,
|
||||
@@ -138,7 +151,9 @@
|
||||
label: 'Display Name',
|
||||
async callback() {
|
||||
await goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/databases/database-${$database.$id}/collection-${$collection.$id}/settings#display-name`
|
||||
getProjectRoute(
|
||||
`/databases/database-${$database.$id}/collection-${$collection.$id}/settings#display-name`
|
||||
)
|
||||
);
|
||||
},
|
||||
group: 'collections',
|
||||
@@ -152,7 +167,9 @@
|
||||
label: 'Permissions',
|
||||
async callback() {
|
||||
await goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/databases/database-${$database.$id}/collection-${$collection.$id}/settings#permissions`
|
||||
getProjectRoute(
|
||||
`/databases/database-${$database.$id}/collection-${$collection.$id}/settings#permissions`
|
||||
)
|
||||
);
|
||||
},
|
||||
group: 'collections',
|
||||
@@ -166,7 +183,9 @@
|
||||
label: 'Document security',
|
||||
async callback() {
|
||||
await goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/databases/database-${$database.$id}/collection-${$collection.$id}/settings#document-security`
|
||||
getProjectRoute(
|
||||
`/databases/database-${$database.$id}/collection-${$collection.$id}/settings#document-security`
|
||||
)
|
||||
);
|
||||
},
|
||||
group: 'collections',
|
||||
|
||||
+10
-4
@@ -21,11 +21,11 @@
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Click, Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { isSmallViewport } from '$lib/stores/viewport';
|
||||
import { base } from '$app/paths';
|
||||
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { APPWRITE_OFFICIALS_ORG, isCloud } from '$lib/system';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -121,7 +121,9 @@
|
||||
{#if !$isSmallViewport}
|
||||
<Button
|
||||
disabled={!(hasAttributes && hasValidAttributes)}
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${page.params.database}/collection-${page.params.collection}/create`}
|
||||
href={getProjectRoute(
|
||||
`/databases/database-${page.params.database}/collection-${page.params.collection}/create`
|
||||
)}
|
||||
event="create_document">
|
||||
<Icon icon={IconPlus} slot="start" size="s" />
|
||||
Create document
|
||||
@@ -132,7 +134,9 @@
|
||||
{#if $isSmallViewport}
|
||||
<Button
|
||||
disabled={!(hasAttributes && hasValidAttributes)}
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${page.params.database}/collection-${page.params.collection}/create`}
|
||||
href={getProjectRoute(
|
||||
`/databases/database-${page.params.database}/collection-${page.params.collection}/create`
|
||||
)}
|
||||
event="create_document">
|
||||
<Icon icon={IconPlus} slot="start" size="s" />
|
||||
Create document
|
||||
@@ -186,7 +190,9 @@
|
||||
size="s"
|
||||
ariaLabel="create document">Documentation</Button>
|
||||
<Button
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${page.params.database}/collection-${page.params.collection}/create`}
|
||||
href={getProjectRoute(
|
||||
`/databases/database-${page.params.database}/collection-${page.params.collection}/create`
|
||||
)}
|
||||
secondary
|
||||
disabled={!$canWriteDocuments}
|
||||
size="s">
|
||||
|
||||
+4
-3
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Empty } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
@@ -38,6 +37,7 @@
|
||||
import type { ComponentProps } from 'svelte';
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
import CsvDisabled from '../csvDisabled.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const databaseId = page.params.database;
|
||||
|
||||
@@ -141,8 +141,9 @@
|
||||
{#if isRelationship(attribute)}
|
||||
<span>
|
||||
with <a
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${attribute?.relatedCollection}`}
|
||||
><b data-private>{attribute?.key}</b></a>
|
||||
href={getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${attribute?.relatedCollection}`
|
||||
)}><b data-private>{attribute?.key}</b></a>
|
||||
</span>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
+4
-2
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { InputChoice } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
@@ -11,6 +10,7 @@
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { isRelationship } from '../document-[document]/attributes/store';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let showDelete = false;
|
||||
export let selectedAttribute: Attributes;
|
||||
@@ -30,7 +30,9 @@
|
||||
});
|
||||
trackEvent(Submit.AttributeDelete);
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${page.params.collection}/attributes`
|
||||
getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${page.params.collection}/attributes`
|
||||
)
|
||||
);
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
|
||||
+4
-2
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
@@ -10,6 +9,7 @@
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import type { Attributes } from '../store';
|
||||
import { attributeOptions, type Option } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let showEdit = false;
|
||||
export let selectedAttribute: Attributes;
|
||||
@@ -37,7 +37,9 @@
|
||||
await invalidate(Dependencies.COLLECTION);
|
||||
if (!page.url.pathname.includes('attributes')) {
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${collectionId}/attributes`
|
||||
getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${collectionId}/attributes`
|
||||
)
|
||||
);
|
||||
}
|
||||
addNotification({
|
||||
|
||||
+6
-5
@@ -1,24 +1,25 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Breadcrumbs } from '$lib/layout';
|
||||
import { database } from '../store';
|
||||
import { collection } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: breadcrumbs = [
|
||||
{
|
||||
title: '...'
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/databases`,
|
||||
href: getProjectRoute('/databases'),
|
||||
title: 'Databases'
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database?.$id}`,
|
||||
href: getProjectRoute(`/databases/database-${$database?.$id}`),
|
||||
title: $database?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database?.$id}/collection-${$collection?.$id}`,
|
||||
href: getProjectRoute(
|
||||
`/databases/database-${$database?.$id}/collection-${$collection?.$id}`
|
||||
),
|
||||
title: $collection?.name
|
||||
}
|
||||
];
|
||||
|
||||
+7
-3
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Wizard } from '$lib/layout';
|
||||
import { Alert, Fieldset, Layout, Typography } from '@appwrite.io/pink-svelte';
|
||||
@@ -15,6 +14,7 @@
|
||||
import type { PageData } from './$types';
|
||||
import type { Attributes } from '../store';
|
||||
import { ID } from '@appwrite.io/console';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -71,7 +71,9 @@
|
||||
customId: !!$createDocument.id
|
||||
});
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${page.params.database}/collection-${page.params.collection}/document-${$id}`
|
||||
getProjectRoute(
|
||||
`/databases/database-${page.params.database}/collection-${page.params.collection}/document-${$id}`
|
||||
)
|
||||
);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
@@ -85,7 +87,9 @@
|
||||
|
||||
<Wizard
|
||||
title="Create document"
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${page.params.database}/collection-${page.params.collection}/`}
|
||||
href={getProjectRoute(
|
||||
`/databases/database-${page.params.database}/collection-${page.params.collection}/`
|
||||
)}
|
||||
bind:showExitModal
|
||||
column
|
||||
columnSize="s"
|
||||
|
||||
+4
-2
@@ -6,10 +6,10 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { page } from '$app/state';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { base } from '$app/paths';
|
||||
import type { Attributes } from './store';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { preferences } from '$lib/stores/preferences';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let showCreate = false;
|
||||
export let selectedOption: Option['name'] = null;
|
||||
@@ -34,7 +34,9 @@
|
||||
await invalidate(Dependencies.COLLECTION);
|
||||
if (!page.url.pathname.includes('attributes')) {
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${collectionId}/attributes`
|
||||
getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${collectionId}/attributes`
|
||||
)
|
||||
);
|
||||
}
|
||||
addNotification({
|
||||
|
||||
+8
-5
@@ -1,25 +1,28 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Breadcrumbs } from '$lib/layout';
|
||||
import { database } from '../../store';
|
||||
import { collection } from '../store';
|
||||
import { doc } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: breadcrumbs = [
|
||||
{
|
||||
title: '...'
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database?.$id}`,
|
||||
href: getProjectRoute(`/databases/database-${$database?.$id}`),
|
||||
title: $database?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database?.$id}/collection-${$collection?.$id}`,
|
||||
href: getProjectRoute(
|
||||
`/databases/database-${$database?.$id}/collection-${$collection?.$id}`
|
||||
),
|
||||
title: $collection?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/databases/database-${$database?.$id}/collection-${$collection?.$id}/document-${$doc?.$id}`,
|
||||
href: getProjectRoute(
|
||||
`/databases/database-${$database?.$id}/collection-${$collection?.$id}/document-${$doc?.$id}`
|
||||
),
|
||||
title: $doc?.$id
|
||||
}
|
||||
];
|
||||
|
||||
+4
-2
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { Confirm, Trim } from '$lib/components';
|
||||
@@ -11,6 +10,7 @@
|
||||
import { attributes, collection } from '../store';
|
||||
import { isRelationship, isRelationshipToMany } from './attributes/store';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let showDelete = false;
|
||||
const databaseId = page.params.database;
|
||||
@@ -28,7 +28,9 @@
|
||||
});
|
||||
trackEvent(Submit.DocumentDelete);
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${page.params.database}/collection-${page.params.collection}`
|
||||
getProjectRoute(
|
||||
`/databases/database-${page.params.database}/collection-${page.params.collection}`
|
||||
)
|
||||
);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
|
||||
+5
-4
@@ -1,16 +1,17 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Id, Tab, Tabs } from '$lib/components';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { doc } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const projectId = page.params.project;
|
||||
const databaseId = page.params.database;
|
||||
const collectionId = page.params.collection;
|
||||
const documentId = page.params.document;
|
||||
const path = `${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${collectionId}/document-${documentId}`;
|
||||
const path = getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${collectionId}/document-${documentId}`
|
||||
);
|
||||
const tabs = [
|
||||
{
|
||||
href: path,
|
||||
@@ -35,7 +36,7 @@
|
||||
<Cover>
|
||||
<svelte:fragment slot="header">
|
||||
<CoverTitle
|
||||
href={`${base}/project-${page.params.region}-${projectId}/databases/database-${databaseId}/collection-${collectionId}`}>
|
||||
href={getProjectRoute(`/databases/database-${databaseId}/collection-${collectionId}`)}>
|
||||
{$doc?.$id}
|
||||
</CoverTitle>
|
||||
<Id value={$doc?.$id} event="document">Document ID</Id>
|
||||
|
||||
+3
-4
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Id, Tab, Tabs } from '$lib/components';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
@@ -7,6 +6,7 @@
|
||||
import { canWriteCollections } from '$lib/stores/roles';
|
||||
import { collection } from './store';
|
||||
import { isTabletViewport } from '$lib/stores/viewport';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
let databaseId = $derived.by(() => {
|
||||
return page.params.database;
|
||||
@@ -16,7 +16,7 @@
|
||||
});
|
||||
|
||||
let path = $derived.by(() => {
|
||||
return `${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${collectionId}`;
|
||||
return getProjectRoute(`/databases/database-${databaseId}/collection-${collectionId}`);
|
||||
});
|
||||
|
||||
let tabs = $derived.by(() => {
|
||||
@@ -62,8 +62,7 @@
|
||||
<div style:margin-top={$isTabletViewport ? '48px' : 0}>
|
||||
<Cover>
|
||||
<svelte:fragment slot="header">
|
||||
<CoverTitle
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}`}>
|
||||
<CoverTitle href={getProjectRoute(`/databases/database-${databaseId}`)}>
|
||||
{$collection?.name}
|
||||
</CoverTitle>
|
||||
{#key $collection?.$id}
|
||||
|
||||
+4
-2
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
@@ -14,6 +13,7 @@
|
||||
import { type Attributes, collection, indexes } from '../store';
|
||||
import { Icon, Layout } from '@appwrite.io/pink-svelte';
|
||||
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let showCreateIndex = false;
|
||||
export let externalAttribute: Attributes = null;
|
||||
@@ -86,7 +86,9 @@
|
||||
]);
|
||||
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${$collection.$id}/indexes`
|
||||
getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${$collection.$id}/indexes`
|
||||
)
|
||||
);
|
||||
|
||||
addNotification({
|
||||
|
||||
+4
-2
@@ -1,11 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Modal, Paginator } from '$lib/components';
|
||||
import Id from '$lib/components/id.svelte';
|
||||
import { preferences } from '$lib/stores/preferences';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Table } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let show = false;
|
||||
export let data: Partial<Models.Document>[];
|
||||
@@ -42,7 +42,9 @@
|
||||
{#each paginatedItems as doc}
|
||||
<Table.Row.Link
|
||||
{root}
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${selectedRelationship.relatedCollection}/document-${doc.$id}`}
|
||||
href={getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${selectedRelationship.relatedCollection}/document-${doc.$id}`
|
||||
)}
|
||||
on:click={() => (show = false)}>
|
||||
<Table.Cell column="$id" {root}>
|
||||
<Id value={doc.$id}>{doc.$id}</Id>
|
||||
|
||||
+2
-4
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
@@ -9,6 +8,7 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
import { collection } from '../store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let showDelete = false;
|
||||
|
||||
@@ -27,9 +27,7 @@
|
||||
message: `${$collection.name} has been deleted`
|
||||
});
|
||||
trackEvent(Submit.CollectionDelete);
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${page.params.database}`
|
||||
);
|
||||
await goto(getProjectRoute(`/databases/database-${page.params.database}`));
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.CollectionDelete);
|
||||
|
||||
+11
-9
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { showCreate } from '../store';
|
||||
import type { PageData } from './$types';
|
||||
@@ -13,10 +12,9 @@
|
||||
} from '@appwrite.io/pink-icons-svelte';
|
||||
import { isTabletViewport } from '$lib/stores/viewport';
|
||||
import { BottomSheet } from '$lib/components';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
let data = $derived(page.data) as PageData;
|
||||
let region = $derived(page.params.region);
|
||||
let project = $derived(page.params.project);
|
||||
let databaseId = $derived(page.params.database);
|
||||
let collectionId = $derived(page.params.collection);
|
||||
|
||||
@@ -42,7 +40,7 @@
|
||||
<Sidebar.Base state="open" resizable={false}>
|
||||
<section class="list-container" slot="top" style:width="100%">
|
||||
<a
|
||||
href={`${base}/project-${region}-${project}/databases/database-${databaseId}`}
|
||||
href={getProjectRoute(`/databases/database-${databaseId}`)}
|
||||
class="database-name u-flex u-cross-center body-text-2 u-gap-8 is-not-mobile is-selected">
|
||||
<Icon icon={IconDatabase} size="s" color="--fgcolor-neutral-weak" />
|
||||
{data.database?.name}
|
||||
@@ -51,7 +49,9 @@
|
||||
{#if data?.allCollections?.total}
|
||||
<ul class="drop-list u-margin-inline-start-8 u-margin-block-start-8">
|
||||
{#each sortedCollections as collection}
|
||||
{@const href = `${base}/project-${region}-${project}/databases/database-${databaseId}/collection-${collection.$id}`}
|
||||
{@const href = getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${collection.$id}`
|
||||
)}
|
||||
{@const isSelected = collectionId === collection.$id}
|
||||
<li class:is-selected={isSelected}>
|
||||
<a
|
||||
@@ -89,7 +89,7 @@
|
||||
<Layout.Stack direction="row" alignItems="center" gap="s">
|
||||
<Icon icon={IconDatabase} size="s" color="--neutral-300" />
|
||||
<Link.Anchor
|
||||
href={`${base}/project-${region}-${project}/databases/database-${databaseId}`}
|
||||
href={getProjectRoute(`/databases/database-${databaseId}`)}
|
||||
variant="quiet-muted">{data.database.name}</Link.Anchor>
|
||||
<span style:margin-left="8px">/</span>
|
||||
<button
|
||||
@@ -99,7 +99,7 @@
|
||||
onclick={() => {
|
||||
openBottomSheet = !openBottomSheet;
|
||||
}}>
|
||||
<span class="orgName">{selectedCollection.name}</span>
|
||||
<span class="orgName">{selectedCollection?.name}</span>
|
||||
<Icon icon={IconChevronDown} size="s" />
|
||||
</button>
|
||||
</Layout.Stack>
|
||||
@@ -115,7 +115,9 @@
|
||||
return {
|
||||
name: collection.name,
|
||||
leadingIcon: IconTable,
|
||||
href: `${base}/project-${region}-${project}/databases/database-${databaseId}/collection-${collection.$id}`
|
||||
href: getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${collection.$id}`
|
||||
)
|
||||
};
|
||||
})
|
||||
},
|
||||
@@ -126,7 +128,7 @@
|
||||
{
|
||||
name: 'All collections',
|
||||
leadingIcon: IconTable,
|
||||
href: `${base}/project-${region}-${project}/databases/database-${databaseId}`
|
||||
href: getProjectRoute(`/databases/database-${databaseId}`)
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+7
-3
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Alert, Confirm, Id } from '$lib/components';
|
||||
@@ -26,6 +25,7 @@
|
||||
Typography
|
||||
} from '@appwrite.io/pink-svelte';
|
||||
import DualTimeView from '$lib/components/dualTimeView.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -186,7 +186,9 @@
|
||||
<Table.Row.Link
|
||||
{root}
|
||||
id={document.$id}
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${$collection.$id}/document-${document.$id}`}>
|
||||
href={getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${$collection.$id}/document-${document.$id}`
|
||||
)}>
|
||||
<Table.Cell column="$id" {root}>
|
||||
{#key document.$id}
|
||||
<Id value={document.$id}>
|
||||
@@ -209,7 +211,9 @@
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${attr.relatedCollection}/document-${related.$id}`
|
||||
getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${attr.relatedCollection}/document-${related.$id}`
|
||||
)
|
||||
);
|
||||
}}>
|
||||
{#each args as arg, i}
|
||||
|
||||
+4
-2
@@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Usage } from '$lib/layout';
|
||||
import Container from '$lib/layout/container.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
$: total = data.documentsTotal;
|
||||
@@ -11,7 +11,9 @@
|
||||
|
||||
<Container>
|
||||
<Usage
|
||||
path={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${page.params.database}/collection-${page.params.collection}/usage`}
|
||||
path={getProjectRoute(
|
||||
`/databases/database-${page.params.database}/collection-${page.params.collection}/usage`
|
||||
)}
|
||||
{total}
|
||||
{count}
|
||||
countMetadata={{
|
||||
|
||||
+2
-2
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
@@ -11,6 +10,7 @@
|
||||
import { toLocaleDate } from '$lib/helpers/date';
|
||||
import { type Models, Query } from '@appwrite.io/console';
|
||||
import { Spinner, Table } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const databaseId = page.params.database;
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
type: 'success',
|
||||
message: `${$database.name} has been deleted`
|
||||
});
|
||||
await goto(`${base}/project-${page.params.region}-${page.params.project}/databases`);
|
||||
await goto(getProjectRoute('/databases'));
|
||||
trackEvent(Submit.DatabaseDelete);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
|
||||
+6
-3
@@ -1,13 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { CardContainer, GridItem1, Id } from '$lib/components';
|
||||
import { Pill } from '$lib/elements';
|
||||
import { canWriteCollections } from '$lib/stores/roles';
|
||||
import type { PageData } from './$types';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data: PageData;
|
||||
export let showCreate = false;
|
||||
const projectId = page.params.project;
|
||||
|
||||
const databaseId = page.params.database;
|
||||
</script>
|
||||
|
||||
@@ -18,7 +19,9 @@
|
||||
event="collection">
|
||||
{#each data.collections.collections as collection}
|
||||
<GridItem1
|
||||
href={`${base}/project-${page.params.region}-${projectId}/databases/database-${databaseId}/collection-${collection.$id}`}>
|
||||
href={getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${collection.$id}`
|
||||
)}>
|
||||
<svelte:fragment slot="title">{collection.name}</svelte:fragment>
|
||||
<svelte:fragment slot="status">
|
||||
{#if !collection.enabled}
|
||||
|
||||
+3
-4
@@ -1,15 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Id, Tab, Tabs } from '$lib/components';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { canWriteDatabases } from '$lib/stores/roles';
|
||||
import { database } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const projectId = page.params.project;
|
||||
const databaseId = page.params.database;
|
||||
const path = `${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}`;
|
||||
const path = getProjectRoute(`/databases/database-${databaseId}`);
|
||||
const tabs = [
|
||||
{
|
||||
href: path,
|
||||
@@ -40,7 +39,7 @@
|
||||
|
||||
<Cover>
|
||||
<svelte:fragment slot="header">
|
||||
<CoverTitle href={`${base}/project-${page.params.region}-${projectId}/databases`}>
|
||||
<CoverTitle href={getProjectRoute('/databases')}>
|
||||
{$database.name}
|
||||
</CoverTitle>
|
||||
<Id value={$database.$id}>{$database.$id}</Id>
|
||||
|
||||
+4
-2
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Id } from '$lib/components';
|
||||
@@ -14,6 +13,7 @@
|
||||
import type { PageData } from './$types';
|
||||
import { columns } from './store';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data: PageData;
|
||||
const databaseId = page.params.database;
|
||||
@@ -61,7 +61,9 @@
|
||||
<Table.Row.Link
|
||||
{root}
|
||||
id={collection.$id}
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${collection.$id}`}>
|
||||
href={getProjectRoute(
|
||||
`/databases/database-${databaseId}/collection-${collection.$id}`
|
||||
)}>
|
||||
{#each $columns as column}
|
||||
<Table.Cell column={column.id} {root}>
|
||||
{#if column.id === '$id'}
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Container, Usage, UsageMultiple } from '$lib/layout';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
<Container>
|
||||
<Layout.Stack gap="l">
|
||||
<Usage
|
||||
path={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${page.params.database}/usage`}
|
||||
{total}
|
||||
{count}
|
||||
countMetadata={{
|
||||
legend: 'Collections',
|
||||
title: 'Total collections'
|
||||
}} />
|
||||
}}
|
||||
path={getProjectRoute(`/databases/database-${page.params.database}/usage`)} />
|
||||
|
||||
<UsageMultiple
|
||||
title="Reads and writes"
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { CardContainer, GridItem1, Id } from '$lib/components';
|
||||
import { canWriteDatabases } from '$lib/stores/roles';
|
||||
import type { PageData } from './$types';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
export let data: PageData;
|
||||
export let showCreate = false;
|
||||
const project = page.params.project;
|
||||
</script>
|
||||
|
||||
<CardContainer
|
||||
@@ -16,8 +14,7 @@
|
||||
event="database"
|
||||
service="databases">
|
||||
{#each data.databases.databases as database}
|
||||
<GridItem1
|
||||
href={`${base}/project-${page.params.region}-${project}/databases/database-${database.$id}`}>
|
||||
<GridItem1 href={getProjectRoute(`/databases/database-${database.$id}`)}>
|
||||
<svelte:fragment slot="title">{database.name}</svelte:fragment>
|
||||
<svelte:fragment slot="subtitle">
|
||||
{#if data.lastBackups && data.lastBackups[database.$id]}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Tab, Tabs } from '$lib/components';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover } from '$lib/layout';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const projectId = page.params.project;
|
||||
const path = `${base}/project-${page.params.region}-${projectId}/databases`;
|
||||
const path = getProjectRoute('/databases');
|
||||
const tabs = [
|
||||
{
|
||||
href: path,
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Id } from '$lib/components';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import { columns } from './store';
|
||||
import { Tooltip, Table } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -25,9 +24,7 @@
|
||||
{/each}
|
||||
</svelte:fragment>
|
||||
{#each data.databases.databases as database (database.$id)}
|
||||
<Table.Row.Link
|
||||
{root}
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${database.$id}`}>
|
||||
<Table.Row.Link {root} href={getProjectRoute(`/databases/database-${database.$id}`)}>
|
||||
{#each $columns as column}
|
||||
<Table.Cell column={column.id} {root}>
|
||||
{#if column.id === '$id'}
|
||||
|
||||
+4
-5
@@ -1,9 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Container, Usage, UsageMultiple } from '$lib/layout';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
import type { PageData } from './$types';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
import { Container, Usage, UsageMultiple } from '$lib/layout';
|
||||
|
||||
export let data: PageData;
|
||||
$: total = data.databasesTotal;
|
||||
@@ -19,7 +18,7 @@
|
||||
<Container>
|
||||
<Layout.Stack gap="l">
|
||||
<Usage
|
||||
path={`${base}/project-${page.params.region}-${page.params.project}/databases/usage`}
|
||||
path={getProjectRoute('/databases/usage')}
|
||||
{total}
|
||||
{count}
|
||||
countMetadata={{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { registerCommands, updateCommandGroupRanks } from '$lib/commandCenter';
|
||||
import {
|
||||
@@ -27,13 +26,12 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import Avatar from '$lib/components/avatar.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
let offset = 0;
|
||||
|
||||
const project = page.params.project;
|
||||
|
||||
onMount(async () => {
|
||||
const from = page.url.searchParams.get('from');
|
||||
if (from === 'github') {
|
||||
@@ -43,14 +41,14 @@
|
||||
const template = page.url.searchParams.get('template');
|
||||
const templateConfig = page.url.searchParams.get('templateConfig');
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${project}/functions/create-function/template-${template}?templateConfig=${templateConfig}`
|
||||
getProjectRoute(
|
||||
`/functions/create-function/template-${template}?templateConfig=${templateConfig}`
|
||||
)
|
||||
);
|
||||
break;
|
||||
}
|
||||
case 'cover':
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${project}/functions/create-function`
|
||||
);
|
||||
goto(getProjectRoute('/functions/create-function'));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -63,8 +61,7 @@
|
||||
$: $registerCommands([
|
||||
{
|
||||
label: 'Create function',
|
||||
callback: () =>
|
||||
goto(`${base}/project-${page.params.region}-${project}/functions/create-function`),
|
||||
callback: () => goto(getProjectRoute('/functions/create-function')),
|
||||
keys: ['c'],
|
||||
disabled:
|
||||
$wizard.show ||
|
||||
@@ -82,7 +79,7 @@
|
||||
<Layout.Stack direction="row" justifyContent="space-between">
|
||||
<SearchQuery placeholder="Search by name or ID" />
|
||||
|
||||
<Button href={`${base}/project-${page.params.region}-${project}/functions/create-function`}>
|
||||
<Button href={getProjectRoute('/functions/create-function')}>
|
||||
<Icon icon={IconPlus} slot="start" />
|
||||
Create function
|
||||
</Button>
|
||||
@@ -95,11 +92,9 @@
|
||||
event="functions"
|
||||
total={data.functions.total}
|
||||
service="functions"
|
||||
on:click={() =>
|
||||
goto(`${base}/project-${page.params.region}-${project}/functions/create-function`)}>
|
||||
on:click={() => goto(getProjectRoute('/functions/create-function'))}>
|
||||
{#each data.functions.functions as func (func.$id)}
|
||||
<GridItem1
|
||||
href={`${base}/project-${page.params.region}-${project}/functions/function-${func.$id}`}>
|
||||
<GridItem1 href={getProjectRoute(`/functions/function-${func.$id}`)}>
|
||||
<svelte:fragment slot="title">
|
||||
<Layout.Stack gap="l" alignItems="center" direction="row" inline>
|
||||
<Avatar alt={func.name} size="m">
|
||||
@@ -133,11 +128,7 @@
|
||||
total={data.functions.total} />
|
||||
{:else if data?.search}
|
||||
<EmptySearch hidePages bind:search={data.search} target="functions">
|
||||
<Button
|
||||
secondary
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions`}>
|
||||
Clear search
|
||||
</Button>
|
||||
<Button secondary href={getProjectRoute('/functions')}>Clear search</Button>
|
||||
</EmptySearch>
|
||||
{:else}
|
||||
<Empty
|
||||
@@ -145,9 +136,6 @@
|
||||
allowCreate={$canWriteFunctions}
|
||||
href="https://appwrite.io/docs/products/functions"
|
||||
target="function"
|
||||
on:click={() =>
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${project}/functions/create-function`
|
||||
)} />
|
||||
on:click={() => goto(getProjectRoute('/functions/create-function'))} />
|
||||
{/if}
|
||||
</Container>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Breadcrumbs } from '$lib/layout';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { project } from '../store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: breadcrumbs = [
|
||||
{
|
||||
@@ -11,11 +11,11 @@
|
||||
title: $organization?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}`,
|
||||
href: getProjectRoute(),
|
||||
title: $project?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/functions`,
|
||||
href: getProjectRoute('/functions'),
|
||||
title: 'Functions'
|
||||
}
|
||||
];
|
||||
|
||||
+3
-3
@@ -1,7 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { SvgIcon } from '$lib/components';
|
||||
import { page } from '$app/state';
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { isSelfHosted } from '$lib/system';
|
||||
@@ -22,11 +20,13 @@
|
||||
import Wizard from '$lib/layout/wizard.svelte';
|
||||
import { Link } from '$lib/elements';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
const wizardBase = getProjectRoute('/functions');
|
||||
const isVcsEnabled = $consoleVariables?._APP_VCS_ENABLED === true;
|
||||
const wizardBase = `${base}/project-${page.params.region}-${page.params.project}/functions`;
|
||||
|
||||
let previousPage: string = wizardBase;
|
||||
afterNavigate(({ from }) => {
|
||||
previousPage = from?.url?.pathname || previousPage;
|
||||
|
||||
+3
-5
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Button, Form } from '$lib/elements/forms';
|
||||
@@ -23,6 +22,7 @@
|
||||
import { isCloud } from '$lib/system';
|
||||
import { humanFileSize } from '$lib/helpers/sizeConvertion';
|
||||
import { currentPlan } from '$lib/stores/organization';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -115,9 +115,7 @@
|
||||
runtime: runtime
|
||||
});
|
||||
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/functions/function-${func.$id}`
|
||||
);
|
||||
await goto(getProjectRoute(`/functions/function-${func.$id}`));
|
||||
|
||||
invalidate(Dependencies.FUNCTION);
|
||||
} catch (e) {
|
||||
@@ -176,7 +174,7 @@
|
||||
<Wizard
|
||||
title="Create function"
|
||||
bind:showExitModal
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions`}
|
||||
href={getProjectRoute('/functions')}
|
||||
column
|
||||
columnSize="s"
|
||||
confirmExit>
|
||||
|
||||
+3
-9
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Button, Form } from '$lib/elements/forms';
|
||||
@@ -22,6 +21,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import RepoCard from './repoCard.svelte';
|
||||
import { getIconFromRuntime } from '$lib/stores/runtimes';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -118,9 +118,7 @@
|
||||
runtime: runtime
|
||||
});
|
||||
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/functions/function-${func.$id}`
|
||||
);
|
||||
await goto(getProjectRoute(`/functions/function-${func.$id}`));
|
||||
|
||||
invalidate(Dependencies.FUNCTION);
|
||||
} catch (e) {
|
||||
@@ -137,11 +135,7 @@
|
||||
<title>Create function - Appwrite</title>
|
||||
</svelte:head>
|
||||
|
||||
<Wizard
|
||||
title="Create function"
|
||||
bind:showExitModal
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions`}
|
||||
confirmExit>
|
||||
<Wizard title="Create function" bind:showExitModal href={getProjectRoute('/functions')} confirmExit>
|
||||
<Form bind:this={formComponent} onSubmit={create} bind:isSubmitting>
|
||||
<Layout.Stack gap="xl">
|
||||
<RepoCard repository={data.repository} />
|
||||
|
||||
+2
-7
@@ -1,10 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { IconGithub } from '@appwrite.io/pink-icons-svelte';
|
||||
import { Card, Icon, Layout, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let repository: Models.ProviderRepository;
|
||||
</script>
|
||||
@@ -17,10 +16,6 @@
|
||||
{repository?.organization}/{repository?.name}
|
||||
</Typography.Text>
|
||||
</Layout.Stack>
|
||||
<Button
|
||||
secondary
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions/create-function`}>
|
||||
Change
|
||||
</Button>
|
||||
<Button secondary href={getProjectRoute('/functions/create-function')}>Change</Button>
|
||||
</Layout.Stack>
|
||||
</Card.Base>
|
||||
|
||||
+3
-9
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Click, Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Card } from '$lib/components';
|
||||
@@ -31,6 +30,7 @@
|
||||
import RepoCard from './repoCard.svelte';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { getIconFromRuntime } from '$lib/stores/runtimes';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -184,9 +184,7 @@
|
||||
framework: data.template.name
|
||||
});
|
||||
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/functions/function-${func.$id}`
|
||||
);
|
||||
await goto(getProjectRoute(`/functions/function-${func.$id}`));
|
||||
invalidate(Dependencies.FUNCTION);
|
||||
} catch (e) {
|
||||
addNotification({
|
||||
@@ -216,11 +214,7 @@
|
||||
<title>Create function - Appwrite</title>
|
||||
</svelte:head>
|
||||
|
||||
<Wizard
|
||||
title="Create function"
|
||||
bind:showExitModal
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions`}
|
||||
confirmExit>
|
||||
<Wizard title="Create function" bind:showExitModal href={getProjectRoute('/functions')} confirmExit>
|
||||
<Form bind:this={formComponent} onSubmit={create} bind:isSubmitting>
|
||||
<Layout.Stack gap="xl">
|
||||
{#if selectedRepository && showConfig}
|
||||
|
||||
+4
-3
@@ -18,9 +18,8 @@
|
||||
import { isCloud } from '$lib/system';
|
||||
import { IconInfo } from '@appwrite.io/pink-icons-svelte';
|
||||
import Link from '$lib/elements/link.svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import type { Snippet } from 'svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
let {
|
||||
deployment,
|
||||
@@ -114,7 +113,9 @@
|
||||
{:else}
|
||||
<Typography.Text variant="m-400" color="--fgcolor-neutral-primary">
|
||||
Only the <Link
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${$func.$id}/deployment-${$func.deploymentId}`}
|
||||
href={getProjectRoute(
|
||||
`/functions/function-${$func.$id}/deployment-${$func.deploymentId}`
|
||||
)}
|
||||
variant="default">active deployment</Link> has a domain.
|
||||
</Typography.Text>
|
||||
{/if}
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { page } from '$app/state';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { base } from '$app/paths';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let show = false;
|
||||
export let selectedDeployment: Models.Deployment = null;
|
||||
@@ -36,7 +36,7 @@
|
||||
invalidate(Dependencies.DEPLOYMENTS);
|
||||
if (redirect) {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/functions/function-${$func.$id}/deployment-${deployment.$id}`
|
||||
getProjectRoute(`/functions/function-${$func.$id}/deployment-${deployment.$id}`)
|
||||
);
|
||||
}
|
||||
show = false;
|
||||
|
||||
+11
-30
@@ -6,9 +6,7 @@
|
||||
import { invalidate, goto } from '$app/navigation';
|
||||
import { registerCommands } from '$lib/commandCenter';
|
||||
import { func, showCreateDeployment } from './store';
|
||||
import { project } from '../../store';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { base } from '$app/paths';
|
||||
import { canWriteFunctions } from '$lib/stores/roles';
|
||||
import {
|
||||
IconCalendar,
|
||||
@@ -18,6 +16,7 @@
|
||||
IconSearch,
|
||||
IconXCircle
|
||||
} from '@appwrite.io/pink-icons-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
onMount(() => {
|
||||
let previousStatus = null;
|
||||
@@ -49,9 +48,7 @@
|
||||
label: 'Create deployment',
|
||||
async callback() {
|
||||
if (!page.url.pathname.endsWith($func.$id)) {
|
||||
await goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/functions/function-${$func.$id}`
|
||||
);
|
||||
await goto(getProjectRoute(`/functions/function-${$func.$id}`));
|
||||
}
|
||||
showCreateDeployment.set(true);
|
||||
},
|
||||
@@ -64,7 +61,7 @@
|
||||
label: 'Permissions',
|
||||
async callback() {
|
||||
await goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/functions/function-${$func.$id}/settings#permissions`
|
||||
getProjectRoute(`/functions/function-${$func.$id}/settings#permissions`)
|
||||
);
|
||||
scrollBy({ top: -100 });
|
||||
},
|
||||
@@ -75,9 +72,7 @@
|
||||
{
|
||||
label: 'Events',
|
||||
async callback() {
|
||||
await goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/functions/function-${$func.$id}/settings#events`
|
||||
);
|
||||
await goto(getProjectRoute(`/functions/function-${$func.$id}/settings#events`));
|
||||
scrollBy({ top: -100 });
|
||||
},
|
||||
icon: IconCalendar,
|
||||
@@ -87,9 +82,7 @@
|
||||
{
|
||||
label: 'Variables',
|
||||
async callback() {
|
||||
await goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/functions/function-${$func.$id}/settings#variables`
|
||||
);
|
||||
await goto(getProjectRoute(`/functions/function-${$func.$id}/settings#variables`));
|
||||
},
|
||||
icon: IconList,
|
||||
group: 'functions',
|
||||
@@ -98,9 +91,7 @@
|
||||
{
|
||||
label: 'Timeout',
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/functions/function-${$func.$id}/settings#timeout`
|
||||
);
|
||||
goto(getProjectRoute(`/functions/function-${$func.$id}/settings#timeout`));
|
||||
},
|
||||
icon: IconXCircle,
|
||||
group: 'functions',
|
||||
@@ -109,9 +100,7 @@
|
||||
{
|
||||
label: 'Schedule',
|
||||
async callback() {
|
||||
await goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/functions/function-${$func.$id}/settings#schedule`
|
||||
);
|
||||
await goto(getProjectRoute(`/functions/function-${$func.$id}/settings#schedule`));
|
||||
scrollBy({ top: -100 });
|
||||
},
|
||||
icon: IconClock,
|
||||
@@ -121,9 +110,7 @@
|
||||
{
|
||||
label: 'Go to deployments',
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/functions/function-${$func.$id}`
|
||||
);
|
||||
goto(getProjectRoute(`/functions/function-${$func.$id}`));
|
||||
},
|
||||
keys: ['g', 'd'],
|
||||
group: 'navigation',
|
||||
@@ -133,9 +120,7 @@
|
||||
{
|
||||
label: 'Go to usage',
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/functions/function-${$func.$id}/usage`
|
||||
);
|
||||
goto(getProjectRoute(`/functions/function-${$func.$id}/usage`));
|
||||
},
|
||||
keys: ['g', 'u'],
|
||||
group: 'navigation',
|
||||
@@ -145,9 +130,7 @@
|
||||
{
|
||||
label: 'Go to executions',
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/functions/function-${$func.$id}/executions`
|
||||
);
|
||||
goto(getProjectRoute(`/functions/function-${$func.$id}/executions`));
|
||||
},
|
||||
keys: ['g', 'e'],
|
||||
group: 'navigation',
|
||||
@@ -157,9 +140,7 @@
|
||||
{
|
||||
label: 'Go to settings',
|
||||
callback() {
|
||||
goto(
|
||||
`${base}/project-${$project.region}-${$project.$id}/functions/function-${$func.$id}/settings`
|
||||
);
|
||||
goto(getProjectRoute(`/functions/function-${$func.$id}/settings`));
|
||||
},
|
||||
keys: ['g', 's'],
|
||||
group: 'navigation',
|
||||
|
||||
+10
-3
@@ -24,6 +24,7 @@
|
||||
import CreateActionMenu from './(components)/createActionMenu.svelte';
|
||||
import { Menu } from '$lib/components/menu';
|
||||
import DownloadActionMenuItem from './(components)/downloadActionMenuItem.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -115,7 +116,9 @@
|
||||
{toggle} />
|
||||
<ActionMenu.Item.Anchor
|
||||
trailingIcon={IconTerminal}
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/deployment-${activeDeployment.$id}`}>
|
||||
href={getProjectRoute(
|
||||
`/functions/function-${page.params.function}/deployment-${activeDeployment.$id}`
|
||||
)}>
|
||||
Build logs
|
||||
</ActionMenu.Item.Anchor>
|
||||
</ActionMenu.Root>
|
||||
@@ -123,7 +126,9 @@
|
||||
</Menu>
|
||||
<Button
|
||||
secondary
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${$func.$id}/executions/execute-function`}
|
||||
href={getProjectRoute(
|
||||
`/functions/function-${$func.$id}/executions/execute-function`
|
||||
)}
|
||||
disabled={isCloud && $readOnly && !GRACE_PERIOD_OVERRIDE}>
|
||||
Execute
|
||||
</Button>
|
||||
@@ -150,7 +155,9 @@
|
||||
ariaLabel={`create deployment`}>Documentation</Button>
|
||||
<Button
|
||||
secondary
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/deployments/deplyoment-${activeDeployment?.$id}`}>
|
||||
href={getProjectRoute(
|
||||
`/functions/function-${page.params.function}/deployments/deplyoment-${activeDeployment?.$id}`
|
||||
)}>
|
||||
View logs</Button>
|
||||
</span>
|
||||
</Empty>
|
||||
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Breadcrumbs } from '$lib/layout';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { project } from '../../store';
|
||||
import { func } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: breadcrumbs = [
|
||||
{
|
||||
@@ -12,15 +12,15 @@
|
||||
title: $organization?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}`,
|
||||
href: getProjectRoute(),
|
||||
title: $project?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/functions`,
|
||||
href: getProjectRoute('/functions'),
|
||||
title: 'Functions'
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/functions/function-${$func?.$id}`,
|
||||
href: getProjectRoute(`/functions/function-${$func?.$id}`),
|
||||
title: $func?.name
|
||||
}
|
||||
];
|
||||
|
||||
+4
-2
@@ -30,10 +30,10 @@
|
||||
import { canWriteFunctions } from '$lib/stores/roles';
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
import DownloadActionMenuItem from '../(components)/downloadActionMenuItem.svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { readOnly } from '$lib/stores/billing';
|
||||
import RedeployModal from '../(modals)/redeployModal.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -116,7 +116,9 @@
|
||||
</Menu>
|
||||
{#if data.func.deploymentId === data.deployment.$id && data.deployment.status === 'ready'}
|
||||
<Button
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/executions/execute-function`}
|
||||
href={getProjectRoute(
|
||||
`/functions/function-${page.params.function}/executions/execute-function`
|
||||
)}
|
||||
disabled={isCloud && $readOnly}>
|
||||
Execute
|
||||
</Button>
|
||||
|
||||
+6
-5
@@ -1,24 +1,25 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Breadcrumbs } from '$lib/layout';
|
||||
import { func } from '../store';
|
||||
import { deployment } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: breadcrumbs = [
|
||||
{
|
||||
title: '...'
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/functions`,
|
||||
href: getProjectRoute('/functions'),
|
||||
title: 'Functions'
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/functions/function-${$func?.$id}`,
|
||||
href: getProjectRoute(`/functions/function-${$func?.$id}`),
|
||||
title: $func?.name
|
||||
},
|
||||
{
|
||||
href: `${base}/project-${page.params.region}-${page.params.project}/functions/function-${$func?.$id}/deployment-${$deployment?.$id}`,
|
||||
href: getProjectRoute(
|
||||
`/functions/function-${$func?.$id}/deployment-${$deployment?.$id}`
|
||||
),
|
||||
title: 'Deployment'
|
||||
}
|
||||
];
|
||||
|
||||
+3
-5
@@ -1,18 +1,16 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Id } from '$lib/components';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { deployment } from './store';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: projectId = page.params.project;
|
||||
$: functionId = page.params.function;
|
||||
</script>
|
||||
|
||||
<Cover>
|
||||
<svelte:fragment slot="header">
|
||||
<CoverTitle
|
||||
href={`${base}/project-${page.params.region}-${projectId}/functions/function-${functionId}`}>
|
||||
<CoverTitle href={getProjectRoute(`/functions/function-${functionId}`)}>
|
||||
Deployment
|
||||
</CoverTitle>
|
||||
<Id value={$deployment.$id}>{$deployment.$id}</Id>
|
||||
|
||||
+5
-2
@@ -13,6 +13,7 @@
|
||||
import { app } from '$lib/stores/app';
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
import Table from './table.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
@@ -25,7 +26,7 @@
|
||||
<Layout.Stack direction="row" justifyContent="space-between">
|
||||
<SearchQuery placeholder="Search domain" />
|
||||
<Button
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/domains/add-domain`}
|
||||
href={getProjectRoute(`/functions/function-${page.params.function}/domains/add-domain`)}
|
||||
on:click={() => {
|
||||
trackEvent(Click.DomainCreateClick, {
|
||||
source: 'functions_domain_overview'
|
||||
@@ -72,7 +73,9 @@
|
||||
|
||||
<Button
|
||||
secondary
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/domains/add-domain`}
|
||||
href={getProjectRoute(
|
||||
`/functions/function-${page.params.function}/domains/add-domain`
|
||||
)}
|
||||
size="s">
|
||||
Add domain
|
||||
</Button>
|
||||
|
||||
+2
-2
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Button, Form, InputDomain, InputSelect, InputURL } from '$lib/elements/forms';
|
||||
import { Wizard } from '$lib/layout';
|
||||
@@ -21,8 +20,9 @@
|
||||
import { isCloud } from '$lib/system';
|
||||
import { project } from '$routes/(console)/project-[region]-[project]/store';
|
||||
import { getApexDomain } from '$lib/helpers/tlds';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const routeBase = `${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/domains`;
|
||||
const routeBase = getProjectRoute(`/functions/function-${page.params.function}/domains`);
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
|
||||
+2
-2
@@ -18,12 +18,12 @@
|
||||
import { isCloud } from '$lib/system';
|
||||
import { page } from '$app/state';
|
||||
import Wizard from '$lib/layout/wizard.svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { writable } from 'svelte/store';
|
||||
import { isASubdomain } from '$lib/helpers/tlds';
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
import NameserverTable from '$lib/components/domains/nameserverTable.svelte';
|
||||
import RecordTable from '$lib/components/domains/recordTable.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
});
|
||||
let verified = $state(false);
|
||||
|
||||
let routeBase = `${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/domains`;
|
||||
let routeBase = getProjectRoute(`/functions/function-${page.params.function}/domains`);
|
||||
let isSubmitting = $state(writable(false));
|
||||
|
||||
async function verify() {
|
||||
|
||||
+7
-4
@@ -6,12 +6,11 @@
|
||||
import { Container, ResponsiveContainerHeader } from '$lib/layout';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { onMount } from 'svelte';
|
||||
import { project } from '$routes/(console)/project-[region]-[project]/store';
|
||||
import { base } from '$app/paths';
|
||||
import { Icon, Tooltip } from '@appwrite.io/pink-svelte';
|
||||
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
|
||||
import Table from './table.svelte';
|
||||
import { columns } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -30,7 +29,9 @@
|
||||
<div>
|
||||
<Button
|
||||
event="execute_function"
|
||||
href={`${base}/project-${$project.region}-${$project.$id}/functions/function-${data.func.$id}/executions/execute-function`}
|
||||
href={getProjectRoute(
|
||||
`/functions/function-${data.func.$id}/executions/execute-function`
|
||||
)}
|
||||
disabled={!data.func.$id || !data.func?.deploymentId}>
|
||||
<Icon icon={IconPlus} size="s" slot="start" />
|
||||
Create execution
|
||||
@@ -67,7 +68,9 @@
|
||||
<Button
|
||||
secondary
|
||||
event="execute_function"
|
||||
href={`${base}/project-${$project.region}-${$project.$id}/functions/function-${data.func.$id}/executions/execute-function`}
|
||||
href={getProjectRoute(
|
||||
`/functions/function-${data.func.$id}/executions/execute-function`
|
||||
)}
|
||||
disabled={!data.func.$id || !data.func?.deploymentId}>
|
||||
Create execution
|
||||
</Button>
|
||||
|
||||
+5
-5
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { afterNavigate, goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
@@ -38,8 +37,11 @@
|
||||
import { IconInfo, IconPlus, IconX } from '@appwrite.io/pink-icons-svelte';
|
||||
import Wizard from '$lib/layout/wizard.svelte';
|
||||
import Aside from './aside.svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
let previousPage: string = `${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/executions`;
|
||||
let previousPage: string = getProjectRoute(
|
||||
`/functions/function-${page.params.function}/executions`
|
||||
);
|
||||
|
||||
afterNavigate(({ from }) => {
|
||||
previousPage = from?.url?.pathname || previousPage;
|
||||
@@ -104,9 +106,7 @@
|
||||
headersObject,
|
||||
isScheduled ? dateTime.toISOString() : undefined
|
||||
);
|
||||
await goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/functions/function-${func.$id}/executions`
|
||||
);
|
||||
await goto(getProjectRoute(`/functions/function-${func.$id}/executions`));
|
||||
invalidate(Dependencies.EXECUTIONS);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
|
||||
+3
-4
@@ -1,15 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Id, Tab, Tabs } from '$lib/components';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { canWriteFunctions } from '$lib/stores/roles';
|
||||
import { func } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
const projectId = page.params.project;
|
||||
const functionId = page.params.function;
|
||||
const path = `${base}/project-${page.params.region}-${projectId}/functions/function-${functionId}`;
|
||||
const path = getProjectRoute(`/functions/function-${functionId}`);
|
||||
const tabs = [
|
||||
{
|
||||
href: path,
|
||||
@@ -45,7 +44,7 @@
|
||||
|
||||
<Cover>
|
||||
<svelte:fragment slot="header">
|
||||
<CoverTitle href={`${base}/project-${page.params.region}-${projectId}/functions`}>
|
||||
<CoverTitle href={getProjectRoute('/functions')}>
|
||||
{$func?.name}
|
||||
</CoverTitle>
|
||||
{#if $func?.$id}
|
||||
|
||||
+4
-2
@@ -9,7 +9,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { page } from '$app/state';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { base } from '$app/paths';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let show = false;
|
||||
export let selectedDeployment: Models.Deployment = null;
|
||||
@@ -37,7 +37,9 @@
|
||||
});
|
||||
if (redirect) {
|
||||
goto(
|
||||
`${base}/project-${page.params.region}-${page.params.project}/functions/function-${$func.$id}/deployments/deployment-${deployment.$id}`
|
||||
getProjectRoute(
|
||||
`/functions/function-${$func.$id}/deployments/deployment-${deployment.$id}`
|
||||
)
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
+2
-2
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
@@ -8,6 +7,7 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { type Models } from '@appwrite.io/console';
|
||||
import { InputCheckbox } from '$lib/elements/forms';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let showDelete = false;
|
||||
export let projectFunction: Models.Function;
|
||||
@@ -25,7 +25,7 @@
|
||||
type: 'success',
|
||||
message: `Function has been deleted`
|
||||
});
|
||||
await goto(`${base}/project-${page.params.region}-${page.params.project}/functions`);
|
||||
await goto(getProjectRoute('/functions'));
|
||||
trackEvent(Submit.FunctionDelete);
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
|
||||
+2
-3
@@ -1,12 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { CardGrid, SvgIcon } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import { project } from '$routes/(console)/project-[region]-[project]/store';
|
||||
import { Layout, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { func } from '../store';
|
||||
import { capitalize } from '$lib/helpers/string';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
</script>
|
||||
|
||||
<CardGrid>
|
||||
@@ -41,7 +40,7 @@
|
||||
<svelte:fragment slot="actions">
|
||||
<Button
|
||||
secondary
|
||||
href={`${base}/project-${$project.region}-${$project.$id}/functions/function-${$func.$id}/executions/execute-function`}>
|
||||
href={getProjectRoute(`/functions/function-${$func.$id}/executions/execute-function`)}>
|
||||
Execute
|
||||
</Button>
|
||||
</svelte:fragment>
|
||||
|
||||
+4
-2
@@ -13,7 +13,6 @@
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import Cancel from './(modals)/cancelDeploymentModal.svelte';
|
||||
import { base } from '$app/paths';
|
||||
import {
|
||||
ActionMenu,
|
||||
Badge,
|
||||
@@ -39,6 +38,7 @@
|
||||
import { Menu } from '$lib/components/menu';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let columns: Column[];
|
||||
export let data: PageData;
|
||||
@@ -103,7 +103,9 @@
|
||||
<Table.Row.Link
|
||||
{root}
|
||||
id={deployment.$id}
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/deployment-${deployment.$id}`}>
|
||||
href={getProjectRoute(
|
||||
`/functions/function-${page.params.function}/deployment-${deployment.$id}`
|
||||
)}>
|
||||
{#each columns as column}
|
||||
<Table.Cell column={column.id} {root}>
|
||||
{#if column.id === '$id'}
|
||||
|
||||
+6
-6
@@ -1,21 +1,21 @@
|
||||
<script lang="ts">
|
||||
import { Container, Usage } from '$lib/layout';
|
||||
import { page } from '$app/state';
|
||||
import { base } from '$app/paths';
|
||||
import { Container, Usage } from '$lib/layout';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
$: total = data.executionsTotal;
|
||||
$: count = data.executions;
|
||||
$: gbHoursTotal = data.executionsMbSecondsTotal / 1000 / 3600;
|
||||
$: total = data.executionsTotal;
|
||||
$: mbSecondsCount = data.executionsMbSeconds;
|
||||
$: gbHoursTotal = data.executionsMbSecondsTotal / 1000 / 3600;
|
||||
</script>
|
||||
|
||||
<Container>
|
||||
<Layout.Stack gap="l">
|
||||
{#if count}
|
||||
<Usage
|
||||
path={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/usage`}
|
||||
path={getProjectRoute(`/functions/function-${page.params.function}/usage`)}
|
||||
countMetadata={{
|
||||
legend: 'Executions',
|
||||
title: 'Total executions'
|
||||
@@ -27,7 +27,7 @@
|
||||
{#if mbSecondsCount}
|
||||
<Usage
|
||||
hidePeriodSelect
|
||||
path={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/usage`}
|
||||
path={getProjectRoute(`/functions/function-${page.params.function}/usage`)}
|
||||
countMetadata={{
|
||||
legend: 'GB hours',
|
||||
title: 'Total GB hours'
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Tab, Tabs } from '$lib/components';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover } from '$lib/layout';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: projectId = page.params.project;
|
||||
$: path = `${base}/project-${page.params.region}-${projectId}/functions`;
|
||||
$: path = getProjectRoute('/functions');
|
||||
$: tabs = [
|
||||
{
|
||||
href: path,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { EmptyFilter, EmptySearch, Paginator, SearchQuery, SvgIcon } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
@@ -24,6 +23,7 @@
|
||||
import Link from '$lib/elements/link.svelte';
|
||||
import Avatar from '$lib/components/avatar.svelte';
|
||||
import { getIconFromRuntime } from '$lib/stores/runtimes';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -210,7 +210,9 @@
|
||||
alignItems="center"
|
||||
inline>
|
||||
<Button
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions/templates/template-${template.id}`}
|
||||
href={getProjectRoute(
|
||||
`/functions/templates/template-${template.id}`
|
||||
)}
|
||||
text>
|
||||
<span class="text">Details</span>
|
||||
</Button>
|
||||
@@ -219,7 +221,9 @@
|
||||
title="functions"
|
||||
disabled={buttonDisabled}
|
||||
buttonType="secondary"
|
||||
buttonHref={`${base}/project-${page.params.region}-${page.params.project}/functions/create-function/template-${template.id}`}
|
||||
buttonHref={getProjectRoute(
|
||||
`/functions/create-function/template-${template.id}`
|
||||
)}
|
||||
showIcon={false}
|
||||
buttonText="Create"
|
||||
buttonEventData={{
|
||||
|
||||
+4
-3
@@ -20,10 +20,9 @@
|
||||
Divider,
|
||||
Icon
|
||||
} from '@appwrite.io/pink-svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { capitalize } from '$lib/helpers/string';
|
||||
import { IconExternalLink } from '@appwrite.io/pink-icons-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
$: buttonDisabled =
|
||||
isCloud && isServiceLimited('functions', $organization?.billingPlan, $functionsList?.total);
|
||||
@@ -92,7 +91,9 @@
|
||||
<ContainerButton
|
||||
title="functions"
|
||||
disabled={buttonDisabled}
|
||||
buttonHref={`${base}/project-${page.params.region}-${page.params.project}/functions/create-function/template-${$template.id}`}
|
||||
buttonHref={getProjectRoute(
|
||||
`/functions/create-function/template-${$template.id}`
|
||||
)}
|
||||
showIcon={false}
|
||||
buttonText="Create function"
|
||||
buttonEvent="create_function" />
|
||||
|
||||
+2
-4
@@ -1,15 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Id } from '$lib/components';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { template } from './store';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
</script>
|
||||
|
||||
<Cover>
|
||||
<svelte:fragment slot="header">
|
||||
<CoverTitle
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/functions/templates`}>
|
||||
<CoverTitle href={getProjectRoute('/functions/templates')}>
|
||||
{$template.name}
|
||||
</CoverTitle>
|
||||
<Id value={$template.id} event="user">{$template.id}</Id>
|
||||
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Container, Usage } from '$lib/layout';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
export let data;
|
||||
$: total = data.deploymentsTotal;
|
||||
@@ -10,7 +9,7 @@
|
||||
|
||||
<Container>
|
||||
<Usage
|
||||
path={`${base}/project-${page.params.region}-${page.params.project}/functions/usage`}
|
||||
path={getProjectRoute('/functions/usage')}
|
||||
countMetadata={{
|
||||
legend: 'Functions',
|
||||
title: 'Total functions'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import {
|
||||
addSubPanel,
|
||||
@@ -13,8 +12,8 @@
|
||||
import { providersSearcher } from '$lib/commandCenter/searchers/providers';
|
||||
import { topicsSearcher } from '$lib/commandCenter/searchers/topics';
|
||||
import { canWriteMessages } from '$lib/stores/roles';
|
||||
import { project } from '../store';
|
||||
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
|
||||
import { getProjectRoute } from '$lib/helpers/project';
|
||||
|
||||
// TODO: finalize the commands
|
||||
$: $registerCommands([
|
||||
@@ -32,7 +31,7 @@
|
||||
label: 'Go to Topics',
|
||||
keys: ['g', 't'],
|
||||
callback() {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/messaging/topics`);
|
||||
goto(getProjectRoute('/messaging/topics'));
|
||||
},
|
||||
disabled:
|
||||
page.url.pathname.endsWith('topics') || page.url.pathname.includes('message-'),
|
||||
@@ -43,7 +42,7 @@
|
||||
label: 'Go to Providers',
|
||||
keys: ['g', 'p'],
|
||||
callback() {
|
||||
goto(`${base}/project-${$project.region}-${$project.$id}/messaging/providers`);
|
||||
goto(getProjectRoute('/messaging/providers'));
|
||||
},
|
||||
disabled:
|
||||
page.url.pathname.endsWith('providers') || page.url.pathname.includes('message-'),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user