mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Merge pull request #1771 from appwrite/svelte5-migration
Refactor: `$page` usage to `page`
This commit is contained in:
312 files changed
+998
-1008
No files matched your search
@@ -9,6 +9,7 @@
|
||||
"build": "node build.js",
|
||||
"preview": "vite preview",
|
||||
"prepare": "svelte-kit sync || echo ''",
|
||||
"clean": "rm -rf node_modules && rm -rf .svelte_kit && pnpm i --force",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"format": "prettier --write .",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Analytics, { type AnalyticsPlugin } from 'analytics';
|
||||
import Plausible from 'plausible-tracker';
|
||||
import { get } from 'svelte/store';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { user } from '$lib/stores/user';
|
||||
import { ENV, MODE, VARS, isCloud } from '$lib/system';
|
||||
import { AppwriteException } from '@appwrite.io/console';
|
||||
@@ -55,13 +55,12 @@ export function trackEvent(name: string, data: object = null): void {
|
||||
return;
|
||||
}
|
||||
|
||||
const currentPage = get(page);
|
||||
const path = currentPage.route.id;
|
||||
const path = page.route.id;
|
||||
|
||||
if (currentPage.params?.project) {
|
||||
if (page.params?.project) {
|
||||
data = {
|
||||
...data,
|
||||
project: currentPage.params.project
|
||||
project: page.params.project
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -164,8 +164,7 @@
|
||||
|
||||
{#if !$preferences.hideAiDisclaimer}
|
||||
<div style="padding: 1rem; padding-block-end: 0;">
|
||||
<Alert
|
||||
type="default"
|
||||
<Alert.Inline
|
||||
dismissible
|
||||
on:dismiss={() => {
|
||||
$preferences.hideAiDisclaimer = true;
|
||||
@@ -173,7 +172,7 @@
|
||||
<span slot="title">
|
||||
We collect user responses to refine our experimental AI feature.
|
||||
</span>
|
||||
</Alert>
|
||||
</Alert.Inline>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { BillingPlan } from '$lib/constants';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if $showPolicyAlert && isCloud && $organization?.$id && $page.url.pathname.match(/\/databases\/database-[^/]+$/)}
|
||||
{#if $showPolicyAlert && isCloud && $organization?.$id && page.url.pathname.match(/\/databases\/database-[^/]+$/)}
|
||||
{@const isFreePlan = $organization?.billingPlan === BillingPlan.FREE}
|
||||
|
||||
{@const subtitle = isFreePlan
|
||||
@@ -25,7 +25,7 @@
|
||||
: 'Protect your data by quickly adding a backup policy'}
|
||||
|
||||
{@const ctaText = isFreePlan ? 'Upgrade plan' : 'Create policy'}
|
||||
{@const ctaURL = isFreePlan ? $upgradeURL : `${$page.url.pathname}/backups`}
|
||||
{@const ctaURL = isFreePlan ? $upgradeURL : `${page.url.pathname}/backups`}
|
||||
|
||||
<HeaderAlert type="warning" title="Your database has no backup policy">
|
||||
<svelte:fragment>{subtitle}</svelte:fragment>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { BillingPlan, Dependencies } from '$lib/constants';
|
||||
import type { BackupArchive, BackupRestoration } from '$lib/sdk/backups';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { base } from '$app/paths';
|
||||
import { getProjectId } from '$lib/helpers/project';
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
function showRestoreNotification(newDatabaseId: string, newDatabaseName: string) {
|
||||
if (newDatabaseId && newDatabaseName && lastDatabaseRestorationId !== newDatabaseId) {
|
||||
const project = $page.params.project;
|
||||
const project = page.params.project;
|
||||
lastDatabaseRestorationId = newDatabaseId;
|
||||
|
||||
addNotification({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
import { BillingPlan } from '$lib/constants';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
@@ -9,7 +9,7 @@
|
||||
import { organization } from '$lib/stores/organization';
|
||||
</script>
|
||||
|
||||
{#if $organization?.$id && $organization?.billingPlan === BillingPlan.FREE && $readOnly && !hideBillingHeaderRoutes.includes($page.url.pathname)}
|
||||
{#if $organization?.$id && $organization?.billingPlan === BillingPlan.FREE && $readOnly && !hideBillingHeaderRoutes.includes(page.url.pathname)}
|
||||
<HeaderAlert
|
||||
type="error"
|
||||
title={`${$organization.name} usage has reached the ${tierToPlan($organization.billingPlan).name} plan limit`}>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { HeaderAlert } from '$lib/layout';
|
||||
import { hideBillingHeaderRoutes } from '$lib/stores/billing';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
</script>
|
||||
|
||||
{#if $organization?.markedForDeletion && !hideBillingHeaderRoutes.includes($page.url.pathname)}
|
||||
{#if $organization?.markedForDeletion && !hideBillingHeaderRoutes.includes(page.url.pathname)}
|
||||
<HeaderAlert title="Organization flagged for deletion">
|
||||
<svelte:fragment>
|
||||
All existing projects in the {$organization.name} organization have been paused. This organization
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { BillingPlan } from '$lib/constants';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { HeaderAlert } from '$lib/layout';
|
||||
@@ -8,7 +8,7 @@
|
||||
import { orgMissingPaymentMethod } from '$routes/(console)/store';
|
||||
</script>
|
||||
|
||||
{#if ($orgMissingPaymentMethod.billingPlan === BillingPlan.PRO || $orgMissingPaymentMethod.billingPlan === BillingPlan.SCALE) && !$orgMissingPaymentMethod.paymentMethodId && !$orgMissingPaymentMethod.backupPaymentMethodId && !hideBillingHeaderRoutes.includes($page.url.pathname)}
|
||||
{#if ($orgMissingPaymentMethod.billingPlan === BillingPlan.PRO || $orgMissingPaymentMethod.billingPlan === BillingPlan.SCALE) && !$orgMissingPaymentMethod.paymentMethodId && !$orgMissingPaymentMethod.backupPaymentMethodId && !hideBillingHeaderRoutes.includes(page.url.pathname)}
|
||||
<HeaderAlert
|
||||
type="error"
|
||||
title={`Payment method required for ${$orgMissingPaymentMethod.name}`}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
import { BillingPlan } from '$lib/constants';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if show && $organization?.$id && $organization?.billingPlan === BillingPlan.FREE && !$page.url.pathname.includes('/console/account')}
|
||||
{#if show && $organization?.$id && $organization?.billingPlan === BillingPlan.FREE && !page.url.pathname.includes('/console/account')}
|
||||
<GradientBanner on:close={handleClose}>
|
||||
<div class="u-flex u-gap-24 u-main-center u-cross-center u-flex-vertical-mobile">
|
||||
<span class="body-text-1">Get $50 Cloud credits for Appwrite Pro.</span>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { HeaderAlert } from '$lib/layout';
|
||||
import { actionRequiredInvoices, hideBillingHeaderRoutes } from '$lib/stores/billing';
|
||||
@@ -9,7 +9,7 @@
|
||||
const endpoint = getApiEndpoint();
|
||||
</script>
|
||||
|
||||
{#if $actionRequiredInvoices && $actionRequiredInvoices?.invoices?.length && !hideBillingHeaderRoutes.includes($page.url.pathname)}
|
||||
{#if $actionRequiredInvoices && $actionRequiredInvoices?.invoices?.length && !hideBillingHeaderRoutes.includes(page.url.pathname)}
|
||||
<HeaderAlert title="Authorization required" type="error">
|
||||
Please authorize your upcoming payment for {$organization.name}. Your bank requires this
|
||||
security measure to proceed with payment.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { HeaderAlert } from '$lib/layout';
|
||||
import { hideBillingHeaderRoutes, paymentMissingMandate } from '$lib/stores/billing';
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if $paymentMissingMandate && $paymentMissingMandate?.country?.toLowerCase() === 'in' && $paymentMissingMandate.mandateId === null && !hideBillingHeaderRoutes.includes($page.url.pathname)}
|
||||
{#if $paymentMissingMandate && $paymentMissingMandate?.country?.toLowerCase() === 'in' && $paymentMissingMandate.mandateId === null && !hideBillingHeaderRoutes.includes(page.url.pathname)}
|
||||
<HeaderAlert title="Authorization required" type="info">
|
||||
The payment method for {$organization.name} needs to be verified.
|
||||
<svelte:fragment slot="buttons">
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { diffDays, toLocaleDate } from '$lib/helpers/date';
|
||||
import { HeaderAlert } from '$lib/layout';
|
||||
import { failedInvoice, hideBillingHeaderRoutes } from '$lib/stores/billing';
|
||||
</script>
|
||||
|
||||
{#if $failedInvoice && !hideBillingHeaderRoutes.includes($page.url.pathname)}
|
||||
{#if $failedInvoice && !hideBillingHeaderRoutes.includes(page.url.pathname)}
|
||||
{@const daysPassed = diffDays(new Date($failedInvoice.dueAt), new Date())}
|
||||
<HeaderAlert title="Your projects are at risk">
|
||||
<svelte:fragment>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Spinner } from '@appwrite.io/pink-svelte';
|
||||
|
||||
export let show = false;
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const card = await submitStripeCard(name, $page?.params?.organization ?? null);
|
||||
const card = await submitStripeCard(name, page?.params?.organization ?? null);
|
||||
invalidate(Dependencies.PAYMENT_METHODS);
|
||||
dispatch('submit', card);
|
||||
show = false;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
import { upgradeURL } from '$lib/stores/billing';
|
||||
import { addBottomModalAlerts } from '$routes/(console)/bottomAlerts';
|
||||
import { project } from '$routes/(console)/project-[project]/store';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let currentIndex = 0;
|
||||
@@ -46,7 +46,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
$: filteredModalAlerts = filterModalAlerts($bottomModalAlerts, $page.route.id);
|
||||
$: filteredModalAlerts = filterModalAlerts($bottomModalAlerts, page.route.id);
|
||||
|
||||
$: currentModalAlert = filteredModalAlerts[currentIndex] as BottomModalAlertItem;
|
||||
|
||||
@@ -93,7 +93,10 @@
|
||||
<div class="alert-container">
|
||||
<article class="card">
|
||||
{#key currentModalAlert.id}
|
||||
<button class="icon-inline-tag" on:click={() => handleClose()}>
|
||||
<button
|
||||
aria-label="Close modal"
|
||||
class="icon-inline-tag"
|
||||
on:click={() => handleClose()}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="20"
|
||||
@@ -129,12 +132,14 @@
|
||||
|
||||
<div class="u-flex u-gap-10">
|
||||
<button
|
||||
aria-label="Previous"
|
||||
class="icon-cheveron-left"
|
||||
on:click={showPrevious}
|
||||
disabled={currentIndex === 0}
|
||||
class:active={currentIndex > 0}></button>
|
||||
|
||||
<button
|
||||
aria-label="Next"
|
||||
class="icon-cheveron-right"
|
||||
on:click={showNext}
|
||||
disabled={currentIndex === filteredModalAlerts.length - 1}
|
||||
@@ -203,7 +208,10 @@
|
||||
<div class="alert-container">
|
||||
<article class="card">
|
||||
{#key currentModalAlert.id}
|
||||
<button class="icon-inline-tag" on:click={() => handleClose()}>
|
||||
<button
|
||||
aria-label="Close modal"
|
||||
class="icon-inline-tag"
|
||||
on:click={() => handleClose()}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="20"
|
||||
@@ -239,12 +247,14 @@
|
||||
|
||||
<div class="u-flex u-gap-10">
|
||||
<button
|
||||
aria-label="Previous"
|
||||
class="icon-cheveron-left"
|
||||
on:click={showPrevious}
|
||||
disabled={currentIndex === 0}
|
||||
class:active={currentIndex > 0}></button>
|
||||
|
||||
<button
|
||||
aria-label="Next"
|
||||
class="icon-cheveron-right"
|
||||
on:click={showNext}
|
||||
disabled={currentIndex ===
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Empty } from '$lib/components';
|
||||
import { CARD_LIMIT } from '$lib/constants';
|
||||
import { getServiceLimit, type PlanServices } from '$lib/stores/billing';
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
$: planLimit = getServiceLimit(serviceId) || Infinity;
|
||||
|
||||
$: limit = preferences.get($page.route)?.limit ?? CARD_LIMIT;
|
||||
$: limit = preferences.get(page.route)?.limit ?? CARD_LIMIT;
|
||||
</script>
|
||||
|
||||
<ul class="grid-box" style={`--grid-item-size:${total > 3 ? '22rem' : '25rem'};`} data-private>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { user } from '$lib/stores/user';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
|
||||
$: $selectedFeedback = feedbackOptions.find((option) => option.type === $feedback.type);
|
||||
@@ -21,7 +21,7 @@
|
||||
await feedback.submitFeedback(
|
||||
`feedback-${$feedback.type}`,
|
||||
$feedbackData.message,
|
||||
$page.url.href,
|
||||
page.url.href,
|
||||
$user.name,
|
||||
$user.email,
|
||||
$organization.billingPlan,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { writable } from 'svelte/store';
|
||||
import { onMount } from 'svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import DualTimeView from './dualTimeView.svelte';
|
||||
import {
|
||||
Layout,
|
||||
@@ -355,7 +355,7 @@
|
||||
slot="actions"
|
||||
secondary
|
||||
external
|
||||
href={`${base}/project-${$page.params.project}/storage`}>
|
||||
href={`${base}/project-${page.params.project}/storage`}>
|
||||
Create bucket
|
||||
</Button>
|
||||
</Empty>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { page as pageStore } from '$app/stores';
|
||||
import { page as pageStore } from '$app/state';
|
||||
import { InputSelect } from '$lib/elements/forms';
|
||||
import { preferences } from '$lib/stores/preferences';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
@@ -18,7 +18,7 @@
|
||||
];
|
||||
|
||||
async function limitChange() {
|
||||
const url = new URL($pageStore.url);
|
||||
const url = new URL(pageStore.url);
|
||||
const previousLimit = Number(url.searchParams.get('limit'));
|
||||
url.searchParams.set('limit', limit.toString());
|
||||
preferences.setLimit(limit);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Link } from '$lib/elements';
|
||||
import { Alert } from '@appwrite.io/pink-svelte';
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<Alert.Inline status="info" title="Your logs are disabled">
|
||||
To view logs and errors, enable them in your
|
||||
<Link
|
||||
href={`${base}/project-${$page.params.project}/sites/site-${$page.params.site}/settings`}>
|
||||
href={`${base}/project-${page.params.project}/sites/site-${page.params.site}/settings`}>
|
||||
site settings</Link
|
||||
>.
|
||||
</Alert.Inline>
|
||||
@@ -19,7 +19,7 @@
|
||||
<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.project}/functions/function-${$page.params.function}/settings`}>
|
||||
href={`${base}/project-${page.params.project}/functions/function-${page.params.function}/settings`}>
|
||||
function settings</Link
|
||||
>.
|
||||
</Alert.Inline>
|
||||
|
||||
@@ -272,6 +272,7 @@
|
||||
</div>
|
||||
<button
|
||||
class="account-backdrop"
|
||||
aria-label="Account menu"
|
||||
on:click={() => {
|
||||
showAccountMenu = false;
|
||||
}}></button>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page as pageStore } from '$app/stores';
|
||||
import { page as pageStore } from '$app/state';
|
||||
import { Pagination } from '@appwrite.io/pink-svelte';
|
||||
|
||||
export let sum: number;
|
||||
@@ -9,7 +9,7 @@
|
||||
$: currentPage = Math.floor(offset / limit + 1);
|
||||
|
||||
function getLink(page: number): string {
|
||||
const url = new URL($pageStore.url);
|
||||
const url = new URL(pageStore.url);
|
||||
if (page === 1) {
|
||||
url.searchParams.delete('page');
|
||||
} else {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
import Avatar from '../avatar.svelte';
|
||||
import { IconAnonymous, IconExternalLink, IconMinusSm } from '@appwrite.io/pink-icons-svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let role: string;
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
{/if}
|
||||
<div>
|
||||
<Button.Anchor
|
||||
href={`${base}/project-${$page.params.project}/auth/user-${data?.$id}`}
|
||||
href={`${base}/project-${page.params.project}/auth/user-${data?.$id}`}
|
||||
size="xs"
|
||||
target="_blank"
|
||||
variant="secondary">
|
||||
@@ -94,7 +94,7 @@
|
||||
<Typography.Text>Members: {data?.total}</Typography.Text>
|
||||
<div>
|
||||
<Button.Anchor
|
||||
href={`${base}/project-${$page.params.project}/auth/teams/team-${data?.$id}`}
|
||||
href={`${base}/project-${page.params.project}/auth/teams/team-${data?.$id}`}
|
||||
size="s"
|
||||
target="_blank"
|
||||
variant="secondary">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { onMount } from 'svelte';
|
||||
import { onDestroy } from 'svelte';
|
||||
@@ -35,14 +35,14 @@
|
||||
function valueChange(value: string) {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
const url = new URL($page.url);
|
||||
const url = new URL(page.url);
|
||||
const previous = url.searchParams.get('search') ?? '';
|
||||
|
||||
if (previous === value) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($page.data.page > 1) {
|
||||
if (page.data.page > 1) {
|
||||
url.searchParams.delete('page');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { fade } from 'svelte/transition';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { app } from '$lib/stores/app';
|
||||
import {
|
||||
Icon,
|
||||
@@ -70,7 +70,7 @@
|
||||
}
|
||||
|
||||
$: state = $isTabletViewport ? 'closed' : getSidebarState();
|
||||
$: pathname = $page.url.pathname;
|
||||
$: pathname = page.url.pathname;
|
||||
$: isOnProjectSettings = /^\/console\/project-[a-zA-Z0-9-]+\/settings$/.test(pathname);
|
||||
|
||||
const projectOptions = [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { InputCheckbox } from '$lib/elements/forms';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import type { Writable } from 'svelte/store';
|
||||
import { preferences } from '$lib/stores/preferences';
|
||||
import { onMount } from 'svelte';
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
onMount(async () => {
|
||||
if (isCustomCollection) {
|
||||
const prefs = preferences.getCustomCollectionColumns($page.params.collection);
|
||||
const prefs = preferences.getCustomCollectionColumns(page.params.collection);
|
||||
columns.set(
|
||||
$columns.map((column) => {
|
||||
column.hide = prefs?.includes(column.id) ?? false;
|
||||
@@ -34,7 +34,7 @@
|
||||
})
|
||||
);
|
||||
} else {
|
||||
const prefs = preferences.get($page.route);
|
||||
const prefs = preferences.get(page.route);
|
||||
|
||||
// Override the shown columns only if a preference was set
|
||||
if (prefs?.columns) {
|
||||
@@ -59,7 +59,7 @@
|
||||
});
|
||||
|
||||
function getViewLink(view: View): string {
|
||||
const url = new URL($page.url);
|
||||
const url = new URL(page.url);
|
||||
url.searchParams.set('view', view);
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
helper={error || helper}
|
||||
state={error ? 'error' : 'default'}
|
||||
{spellcheck}
|
||||
autocorrect={spellcheck ? undefined : 'off'}
|
||||
on:invalid={handleInvalid}
|
||||
on:input
|
||||
bind:value>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { getContext } from 'svelte';
|
||||
import type { Writable } from 'svelte/store';
|
||||
|
||||
export let subNavigation;
|
||||
|
||||
$: subNavigation = $page.data.subNavigation;
|
||||
$: subNavigation = page.data.subNavigation;
|
||||
// We need to have this second variable, because we only want narrow
|
||||
// to change automatically if we change from having a second side nav to
|
||||
// not having one, not when the second side nav changes to a different value.
|
||||
|
||||
@@ -175,6 +175,7 @@
|
||||
<button
|
||||
type="button"
|
||||
class="overlay-button"
|
||||
aria-label="Close sidebar"
|
||||
class:overlay={$isSidebarOpen}
|
||||
on:click={() => {
|
||||
$isSidebarOpen = false;
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
import { formatNumberWithCommas } from '$lib/helpers/numbers';
|
||||
import { Card } from '$lib/components';
|
||||
import { ProjectUsageRange, type Models } from '@appwrite.io/console';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Layout, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { InputSelect } from '$lib/elements/forms';
|
||||
@@ -101,7 +101,7 @@
|
||||
value: '90d'
|
||||
}
|
||||
]}
|
||||
value={$page.params.period ?? '30d'} />
|
||||
value={page.params.period ?? '30d'} />
|
||||
</div>
|
||||
{/if}
|
||||
<Card>
|
||||
@@ -112,7 +112,7 @@
|
||||
</Layout.Stack>
|
||||
<div class="chart-container">
|
||||
<BarChart
|
||||
formatted={$page.params.period === '24h' ? 'hours' : 'days'}
|
||||
formatted={page.params.period === '24h' ? 'hours' : 'days'}
|
||||
series={[
|
||||
{
|
||||
name: countMetadata.legend,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { BarChart, Legend, type LegendData } from '$lib/charts';
|
||||
import { accumulateFromEndingTotal } from '$lib/layout/usage.svelte';
|
||||
import { Card, SecondaryTabs, SecondaryTabsItem } from '$lib/components';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { type Models } from '@appwrite.io/console';
|
||||
import { formatNumberWithCommas } from '$lib/helpers/numbers';
|
||||
import { Layout, Typography } from '@appwrite.io/pink-svelte';
|
||||
@@ -22,19 +22,15 @@
|
||||
|
||||
{#if path}
|
||||
<SecondaryTabs>
|
||||
<SecondaryTabsItem
|
||||
href={`${path}/24h`}
|
||||
disabled={$page.params.period === '24h'}>
|
||||
<SecondaryTabsItem href={`${path}/24h`} disabled={page.params.period === '24h'}>
|
||||
24h
|
||||
</SecondaryTabsItem>
|
||||
<SecondaryTabsItem
|
||||
href={`${path}/30d`}
|
||||
disabled={!$page.params.period || $page.params.period === '30d'}>
|
||||
disabled={!page.params.period || page.params.period === '30d'}>
|
||||
30d
|
||||
</SecondaryTabsItem>
|
||||
<SecondaryTabsItem
|
||||
href={`${path}/90d`}
|
||||
disabled={$page.params.period === '90d'}>
|
||||
<SecondaryTabsItem href={`${path}/90d`} disabled={page.params.period === '90d'}>
|
||||
90d
|
||||
</SecondaryTabsItem>
|
||||
</SecondaryTabs>
|
||||
@@ -52,7 +48,7 @@
|
||||
</Layout.Stack>
|
||||
<div class="multiple-chart-container u-flex-vertical u-gap-16">
|
||||
<BarChart
|
||||
formatted={$page.params.period === '24h' ? 'hours' : 'days'}
|
||||
formatted={page.params.period === '24h' ? 'hours' : 'days'}
|
||||
series={count.map((c, index) => ({
|
||||
name: legendData[index].name,
|
||||
data: accumulateFromEndingTotal(c, total[index])
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
IconRefresh,
|
||||
IconTrash
|
||||
} from '@appwrite.io/pink-icons-svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { base } from '$app/paths';
|
||||
|
||||
export let search: string = null;
|
||||
@@ -62,7 +62,7 @@
|
||||
</Layout.Stack>
|
||||
<Layout.Stack direction="row" alignItems="center" justifyContent="flex-end">
|
||||
<Button
|
||||
href={`${base}/project-${$page.params.project}/settings/domains/create`}
|
||||
href={`${base}/project-${page.params.project}/settings/domains/create`}
|
||||
event="create_user"
|
||||
size="s">
|
||||
<Icon size="s" icon={IconPlus} slot="start" />
|
||||
|
||||
@@ -114,7 +114,6 @@ function createFeedbackStore() {
|
||||
name?: string,
|
||||
email?: string,
|
||||
// eslint-disable-next-line
|
||||
// @ts-expect-error
|
||||
billingPlan?: string,
|
||||
value?: number
|
||||
) => {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { get } from 'svelte/store';
|
||||
import { sdk } from './sdk';
|
||||
|
||||
export function connectGitHub(callbackState: Record<string, string> = null) {
|
||||
const redirect = new URL(get(page).url);
|
||||
const redirect = new URL(page.url);
|
||||
if (callbackState) {
|
||||
Object.keys(callbackState).forEach((key) => {
|
||||
redirect.searchParams.append(key, callbackState[key]);
|
||||
});
|
||||
}
|
||||
const target = new URL(`${sdk.forProject.client.config.endpoint}/vcs/github/authorize`);
|
||||
target.searchParams.set('project', get(page).params.project);
|
||||
target.searchParams.set('project', page.params.project);
|
||||
target.searchParams.set('success', redirect.toString());
|
||||
target.searchParams.set('failure', redirect.toString());
|
||||
target.searchParams.set('mode', 'admin');
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { afterNavigate, goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { get, writable } from 'svelte/store';
|
||||
|
||||
export function createPersistentPagination(limit: number) {
|
||||
const url = get(page).url;
|
||||
const url = page.url;
|
||||
const current = +(url.searchParams.get('page') ?? 1);
|
||||
const offset = current * limit - limit;
|
||||
const { subscribe, set } = writable<number>(offset < 0 ? 0 : offset);
|
||||
|
||||
let keepHistory = false;
|
||||
const apply = (n: number) => {
|
||||
const { pathname, searchParams, href } = get(page).url;
|
||||
const { pathname, searchParams, href } = page.url;
|
||||
const newPage = n / limit + 1;
|
||||
|
||||
if (newPage > 1) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { app } from '$lib/stores/app';
|
||||
import AppwriteLogoDark from '$lib/images/appwrite-logo-dark.svg';
|
||||
import AppwriteLogoLight from '$lib/images/appwrite-logo-light.svg';
|
||||
@@ -20,12 +20,12 @@
|
||||
let success = '';
|
||||
|
||||
onMount(async () => {
|
||||
const projectId = $page.url.searchParams.get('projectId');
|
||||
const projectId = page.url.searchParams.get('projectId');
|
||||
client.setEndpoint(endpoint).setProject(projectId).setMode('admin');
|
||||
|
||||
installationId = $page.url.searchParams.get('installationId');
|
||||
repositoryId = $page.url.searchParams.get('repositoryId');
|
||||
providerPullRequestId = $page.url.searchParams.get('providerPullRequestId') + '';
|
||||
installationId = page.url.searchParams.get('installationId');
|
||||
repositoryId = page.url.searchParams.get('repositoryId');
|
||||
providerPullRequestId = page.url.searchParams.get('providerPullRequestId') + '';
|
||||
});
|
||||
|
||||
async function approveDeployment() {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { Unauthenticated } from '$lib/layout';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import MfaChallengeFormList, { verify } from '$lib/components/mfaChallengeFormList.svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { addNotification } from '$lib/stores/notifications.js';
|
||||
import { Icon, Layout } from '@appwrite.io/pink-svelte';
|
||||
import { IconChevronLeft } from '@appwrite.io/pink-icons-svelte';
|
||||
@@ -28,13 +28,13 @@
|
||||
disabled = true;
|
||||
try {
|
||||
await verify(challenge, code);
|
||||
if ($page.url.searchParams) {
|
||||
const redirect = $page.url.searchParams.get('redirect');
|
||||
$page.url.searchParams.delete('redirect');
|
||||
if (page.url.searchParams) {
|
||||
const redirect = page.url.searchParams.get('redirect');
|
||||
page.url.searchParams.delete('redirect');
|
||||
if (redirect) {
|
||||
await goto(`${redirect}${$page.url.search}`);
|
||||
await goto(`${redirect}${page.url.search}`);
|
||||
} else {
|
||||
await goto(`${base}/${$page.url.search ?? ''}`);
|
||||
await goto(`${base}/${page.url.search ?? ''}`);
|
||||
}
|
||||
} else {
|
||||
await goto(base);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { InputSelect } from '$lib/elements/forms';
|
||||
import InputText from '$lib/elements/forms/inputText.svelte';
|
||||
import { WizardStep } from '$lib/layout';
|
||||
@@ -7,7 +7,7 @@
|
||||
import { selectedProject } from '.';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
|
||||
const organizations = $page.data.organizations
|
||||
const organizations = page.data.organizations
|
||||
.teams as Models.TeamList<Models.Preferences>['teams'];
|
||||
let selectedOrg = organizations.length ? organizations[0].$id : null;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { Container } from '$lib/layout';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
<Container>
|
||||
<div>
|
||||
<Typography.Title size="xl">{$page.error.status || 'Invalid Argument'}</Typography.Title>
|
||||
<Typography.Title>{$page.error.message}</Typography.Title>
|
||||
<Typography.Title size="xl">{page.error.status || 'Invalid Argument'}</Typography.Title>
|
||||
<Typography.Title>{page.error.message}</Typography.Title>
|
||||
</div>
|
||||
<div>
|
||||
<Button href={base}>Back to the console</Button>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { BillingPlan, INTERVAL } from '$lib/constants';
|
||||
import Footer from '$lib/layout/footer.svelte';
|
||||
import Shell from '$lib/layout/shell.svelte';
|
||||
@@ -74,7 +74,7 @@
|
||||
});
|
||||
|
||||
$: isOnSettingsLayout = $project?.$id
|
||||
? $page.url.pathname.includes(`project-${$project.$id}/settings`)
|
||||
? page.url.pathname.includes(`project-${$project.$id}/settings`)
|
||||
: false;
|
||||
|
||||
$: $registerCommands([
|
||||
@@ -86,9 +86,9 @@
|
||||
keys: ['g', 'p'],
|
||||
group: 'navigation',
|
||||
disabled:
|
||||
($page.url.pathname.includes('/console/organization-') &&
|
||||
!$page.url.pathname.endsWith('/members') &&
|
||||
!$page.url.pathname.endsWith('/settings')) ||
|
||||
(page.url.pathname.includes('/console/organization-') &&
|
||||
!page.url.pathname.endsWith('/members') &&
|
||||
!page.url.pathname.endsWith('/settings')) ||
|
||||
!$canSeeProjects,
|
||||
rank: -1
|
||||
},
|
||||
@@ -188,7 +188,7 @@
|
||||
goto(`${base}/project-${$project.$id}/settings`);
|
||||
},
|
||||
disabled:
|
||||
!$project?.$id || (isOnSettingsLayout && $page.url.pathname.endsWith('settings')),
|
||||
!$project?.$id || (isOnSettingsLayout && page.url.pathname.endsWith('settings')),
|
||||
group: isOnSettingsLayout ? 'navigation' : 'settings',
|
||||
rank: isOnSettingsLayout ? 40 : -1
|
||||
},
|
||||
@@ -200,7 +200,7 @@
|
||||
goto(`${base}/project-${$project.$id}/settings/domains`);
|
||||
},
|
||||
disabled:
|
||||
!$project?.$id || (isOnSettingsLayout && $page.url.pathname.includes('domains')),
|
||||
!$project?.$id || (isOnSettingsLayout && page.url.pathname.includes('domains')),
|
||||
group: isOnSettingsLayout ? 'navigation' : 'settings',
|
||||
rank: isOnSettingsLayout ? 30 : -1
|
||||
},
|
||||
@@ -211,7 +211,7 @@
|
||||
goto(`${base}/project-${$project.$id}/settings/webhooks`);
|
||||
},
|
||||
disabled:
|
||||
!$project?.$id || (isOnSettingsLayout && $page.url.pathname.includes('webhooks')),
|
||||
!$project?.$id || (isOnSettingsLayout && page.url.pathname.includes('webhooks')),
|
||||
group: isOnSettingsLayout ? 'navigation' : 'settings',
|
||||
|
||||
rank: isOnSettingsLayout ? 20 : -1
|
||||
@@ -223,7 +223,7 @@
|
||||
goto(`${base}/project-${$project.$id}/settings/migrations`);
|
||||
},
|
||||
disabled:
|
||||
!$project?.$id || (isOnSettingsLayout && $page.url.pathname.includes('migrations')),
|
||||
!$project?.$id || (isOnSettingsLayout && page.url.pathname.includes('migrations')),
|
||||
group: isOnSettingsLayout ? 'navigation' : 'settings',
|
||||
|
||||
rank: isOnSettingsLayout ? 10 : -1
|
||||
@@ -234,7 +234,7 @@
|
||||
callback: () => {
|
||||
goto(`${base}/project-${$project.$id}/settings/smtp`);
|
||||
},
|
||||
disabled: !$project?.$id || (isOnSettingsLayout && $page.url.pathname.includes('smtp')),
|
||||
disabled: !$project?.$id || (isOnSettingsLayout && page.url.pathname.includes('smtp')),
|
||||
group: isOnSettingsLayout ? 'navigation' : 'settings',
|
||||
rank: -1
|
||||
},
|
||||
@@ -330,13 +330,13 @@
|
||||
|
||||
<CommandCenter />
|
||||
<Shell
|
||||
showSideNavigation={$page.url.pathname !== '/console' &&
|
||||
!$page?.params.organization &&
|
||||
!$page.url.pathname.includes('/console/account') &&
|
||||
!$page.url.pathname.includes('/console/card') &&
|
||||
!$page.url.pathname.includes('/console/onboarding')}
|
||||
showHeader={!$page.url.pathname.includes('/console/onboarding')}
|
||||
showFooter={!$page.url.pathname.includes('/console/onboarding')}
|
||||
showSideNavigation={page.url.pathname !== '/console' &&
|
||||
!page?.params.organization &&
|
||||
!page.url.pathname.includes('/console/account') &&
|
||||
!page.url.pathname.includes('/console/card') &&
|
||||
!page.url.pathname.includes('/console/onboarding')}
|
||||
showHeader={!page.url.pathname.includes('/console/onboarding')}
|
||||
showFooter={!page.url.pathname.includes('/console/onboarding')}
|
||||
bind:loadedProjects
|
||||
bind:projects={data.projects}>
|
||||
<!-- <Header slot="header" />-->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Tab, Tabs } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
@@ -62,7 +62,7 @@
|
||||
{#each tabs as tab}
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
selected={isTabSelected(tab, page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
import PaymentMethods from './paymentMethods.svelte';
|
||||
import BillingAddress from './billingAddress.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { confirmPayment } from '$lib/stores/stripe';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
|
||||
let showPayment = false;
|
||||
|
||||
onMount(async () => {
|
||||
if ($page.url.searchParams.has('clientSecret')) {
|
||||
const clientSecret = $page.url.searchParams.get('clientSecret');
|
||||
const paymentMethodId = $page.url.searchParams.get('paymentMethodId');
|
||||
if (page.url.searchParams.has('clientSecret')) {
|
||||
const clientSecret = page.url.searchParams.get('clientSecret');
|
||||
const paymentMethodId = page.url.searchParams.get('paymentMethodId');
|
||||
await confirmPayment('', clientSecret, paymentMethodId);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page as pageStore } from '$app/stores';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { Submit, trackEvent } from '$lib/actions/analytics';
|
||||
@@ -65,7 +65,7 @@
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
return page.subscribe(($page) => {
|
||||
return pageStore.subscribe(($page) => {
|
||||
const url = new URL($page.url);
|
||||
const sessionId = url.searchParams.get('sessionId');
|
||||
if (sessionId) {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import MfaRegenerateCodes from './mfaRegenerateCodes.svelte';
|
||||
import { Pill } from '$lib/elements';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { onMount } from 'svelte';
|
||||
import { Badge, Divider, Layout, Link, Typography } from '@appwrite.io/pink-svelte';
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
.map(([factor, _]) => factor);
|
||||
$: enabledMethods = enabledFactors.filter((factor) => factor !== 'recoveryCode');
|
||||
|
||||
$: cleanUrl = $page.url.origin + $page.url.pathname;
|
||||
$: cleanUrl = page.url.origin + page.url.pathname;
|
||||
|
||||
let creatingVerification = false;
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
}
|
||||
|
||||
async function updateEmailVerification() {
|
||||
const searchParams = $page.url.searchParams;
|
||||
const searchParams = page.url.searchParams;
|
||||
const userId = searchParams.get('userId');
|
||||
const secret = searchParams.get('secret');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { afterNavigate, goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import {
|
||||
CreditsApplied,
|
||||
@@ -78,8 +78,8 @@
|
||||
if (!$organizationList?.total || campaign?.onlyNewOrgs) {
|
||||
selectedOrgId = newOrgId;
|
||||
}
|
||||
if ($page.url.searchParams.has('org')) {
|
||||
selectedOrgId = $page.url.searchParams.get('org');
|
||||
if (page.url.searchParams.has('org')) {
|
||||
selectedOrgId = page.url.searchParams.get('org');
|
||||
canSelectOrg = false;
|
||||
}
|
||||
if (campaign?.plan) {
|
||||
@@ -147,7 +147,7 @@
|
||||
collaborator,
|
||||
undefined,
|
||||
undefined,
|
||||
`${$page.url.origin}${base}/invite`
|
||||
`${page.url.origin}${base}/invite`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { afterNavigate, goto, invalidate, preloadData } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import {
|
||||
EstimatedTotalBox,
|
||||
@@ -84,7 +84,7 @@
|
||||
collaborator,
|
||||
undefined,
|
||||
undefined,
|
||||
`${$page.url.origin}${base}/invite`
|
||||
`${page.url.origin}${base}/invite`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import CreateMember from './createMember.svelte';
|
||||
import Create from '../createOrganization.svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { registerCommands } from '$lib/commandCenter';
|
||||
import { requestedMigration } from '$routes/store';
|
||||
import { openMigrationWizard } from '../(migration-wizard)';
|
||||
@@ -23,7 +23,7 @@
|
||||
goto(`${base}/organization-${data.organization.$id}/members`);
|
||||
},
|
||||
keys: ['g', 'm'],
|
||||
disabled: $page.url.pathname.endsWith('/members') || !$isOwner,
|
||||
disabled: page.url.pathname.endsWith('/members') || !$isOwner,
|
||||
group: 'navigation'
|
||||
},
|
||||
{
|
||||
@@ -32,7 +32,7 @@
|
||||
goto(`${base}/organization-${data.organization.$id}/settings`);
|
||||
},
|
||||
keys: ['g', 's'],
|
||||
disabled: $page.url.pathname.endsWith('/settings') || !$isOwner,
|
||||
disabled: page.url.pathname.endsWith('/settings') || !$isOwner,
|
||||
group: 'navigation'
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import CreateProject from './createProject.svelte';
|
||||
import CreateOrganization from '../createOrganization.svelte';
|
||||
import { GRACE_PERIOD_OVERRIDE, isCloud } from '$lib/system';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { registerCommands } from '$lib/commandCenter';
|
||||
import {
|
||||
CardContainer,
|
||||
@@ -110,11 +110,11 @@
|
||||
const project = await sdk.forConsole.projects.create(
|
||||
ID.unique(),
|
||||
`Imported project ${new Date().toISOString()}`,
|
||||
$page.params.organization,
|
||||
page.params.organization,
|
||||
Region.Default
|
||||
);
|
||||
trackEvent(Submit.ProjectCreate, {
|
||||
teamId: $page.params.organization
|
||||
teamId: page.params.organization
|
||||
});
|
||||
await goto(`${base}/project-${project.$id}/settings/migrations`);
|
||||
openImportWizard();
|
||||
@@ -128,10 +128,10 @@
|
||||
onMount(async () => {
|
||||
if (isCloud) {
|
||||
regions = await sdk.forConsole.billing.listRegions();
|
||||
checkPricingRefAndRedirect($page.url.searchParams);
|
||||
checkPricingRefAndRedirect(page.url.searchParams);
|
||||
}
|
||||
|
||||
const searchParams = $page.url.searchParams;
|
||||
const searchParams = page.url.searchParams;
|
||||
if (searchParams.has('create-project')) {
|
||||
handleCreateProject();
|
||||
}
|
||||
@@ -232,7 +232,7 @@
|
||||
</Container>
|
||||
|
||||
<CreateOrganization bind:show={addOrganization} />
|
||||
<CreateProject bind:show={showCreate} teamId={$page.params.organization} />
|
||||
<CreateProject bind:show={showCreate} teamId={page.params.organization} />
|
||||
{#if showCreateProjectCloud}
|
||||
<CreateProjectCloud bind:showCreateProjectCloud regions={regions.regions} />
|
||||
{/if}
|
||||
@@ -12,7 +12,7 @@
|
||||
import { failedInvoice, paymentMethods, tierToPlan, upgradeURL } from '$lib/stores/billing';
|
||||
import type { PaymentMethodData } from '$lib/sdk/billing';
|
||||
import { onMount } from 'svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { confirmPayment } from '$lib/stores/stripe';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { toLocaleDate } from '$lib/helpers/date';
|
||||
@@ -33,18 +33,18 @@
|
||||
);
|
||||
|
||||
onMount(async () => {
|
||||
if ($page.url.searchParams.has('type')) {
|
||||
if ($page.url.searchParams.get('type') === 'upgrade') {
|
||||
if (page.url.searchParams.has('type')) {
|
||||
if (page.url.searchParams.get('type') === 'upgrade') {
|
||||
goto($upgradeURL);
|
||||
}
|
||||
|
||||
if (
|
||||
$page.url.searchParams.has('invoice') &&
|
||||
$page.url.searchParams.get('type') === 'confirmation'
|
||||
page.url.searchParams.has('invoice') &&
|
||||
page.url.searchParams.get('type') === 'confirmation'
|
||||
) {
|
||||
const invoiceId = $page.url.searchParams.get('invoice');
|
||||
const invoiceId = page.url.searchParams.get('invoice');
|
||||
const invoice = await sdk.forConsole.billing.getInvoice(
|
||||
$page.params.organization,
|
||||
page.params.organization,
|
||||
invoiceId
|
||||
);
|
||||
|
||||
@@ -56,20 +56,20 @@
|
||||
}
|
||||
|
||||
if (
|
||||
$page.url.searchParams.has('invoice') &&
|
||||
$page.url.searchParams.get('type') === 'retry'
|
||||
page.url.searchParams.has('invoice') &&
|
||||
page.url.searchParams.get('type') === 'retry'
|
||||
) {
|
||||
const invoiceId = $page.url.searchParams.get('invoice');
|
||||
const invoiceId = page.url.searchParams.get('invoice');
|
||||
const invoice = await sdk.forConsole.billing.getInvoice(
|
||||
$page.params.organization,
|
||||
page.params.organization,
|
||||
invoiceId
|
||||
);
|
||||
selectedInvoice.set(invoice);
|
||||
showRetryModal.set(true);
|
||||
}
|
||||
}
|
||||
if ($page.url.searchParams.has('clientSecret')) {
|
||||
const clientSecret = $page.url.searchParams.get('clientSecret');
|
||||
if (page.url.searchParams.has('clientSecret')) {
|
||||
const clientSecret = page.url.searchParams.get('clientSecret');
|
||||
await confirmPayment($organization.$id, clientSecret, $organization.paymentMethodId);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { CardGrid, PaginationInline } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { toLocaleDate } from '$lib/helpers/date';
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
async function request() {
|
||||
// isLoadingInvoices = true;
|
||||
invoiceList = await sdk.forConsole.billing.listInvoices($page.params.organization, [
|
||||
invoiceList = await sdk.forConsole.billing.listInvoices(page.params.organization, [
|
||||
Query.limit(limit),
|
||||
Query.offset(offset),
|
||||
Query.notEqual('from', $organization.billingCurrentInvoiceDate),
|
||||
@@ -135,12 +135,12 @@
|
||||
<ActionMenu.Item.Anchor
|
||||
leadingIcon={IconExternalLink}
|
||||
external
|
||||
href={`${endpoint}/organizations/${$page.params.organization}/invoices/${invoice.$id}/view`}>
|
||||
href={`${endpoint}/organizations/${page.params.organization}/invoices/${invoice.$id}/view`}>
|
||||
View invoice
|
||||
</ActionMenu.Item.Anchor>
|
||||
<ActionMenu.Item.Anchor
|
||||
leadingIcon={IconDownload}
|
||||
href={`${endpoint}/organizations/${$page.params.organization}/invoices/${invoice.$id}/download`}>
|
||||
href={`${endpoint}/organizations/${page.params.organization}/invoices/${invoice.$id}/download`}>
|
||||
Download PDF
|
||||
</ActionMenu.Item.Anchor>
|
||||
{#if status === 'overdue' || status === 'failed'}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import type { Invoice } from '$lib/sdk/billing';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { confirmPayment, isStripeInitialized, submitStripeCard } from '$lib/stores/stripe';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { toLocaleDate } from '$lib/helpers/date';
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
<Button
|
||||
external
|
||||
href={`${endpoint}/organizations/${$page.params.organization}/invoices/${invoice.$id}/view`}>
|
||||
href={`${endpoint}/organizations/${page.params.organization}/invoices/${invoice.$id}/view`}>
|
||||
View invoice
|
||||
</Button>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { afterNavigate, goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import {
|
||||
EstimatedTotalBox,
|
||||
@@ -143,7 +143,7 @@
|
||||
collaborator,
|
||||
undefined,
|
||||
undefined,
|
||||
`${$page.url.origin}${base}/invite`
|
||||
`${page.url.origin}${base}/invite`
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -185,7 +185,7 @@
|
||||
|
||||
<Wizard
|
||||
title="Change plan"
|
||||
href={`${base}/organization-${$page.params.organization}`}
|
||||
href={`${base}/organization-${page.params.organization}`}
|
||||
bind:showExitModal
|
||||
confirmExit>
|
||||
<Form bind:this={formComponent} onSubmit={handleSubmit} bind:isSubmitting>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Modal } from '$lib/components';
|
||||
import { InputText, InputEmail, Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
@@ -35,7 +35,7 @@
|
||||
email,
|
||||
undefined,
|
||||
undefined,
|
||||
`${$page.url.origin}${base}/invite`,
|
||||
`${page.url.origin}${base}/invite`,
|
||||
name || undefined
|
||||
);
|
||||
await invalidate(Dependencies.ACCOUNT);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { ID, Region as ConsoleRegion } from '@appwrite.io/console';
|
||||
import { createProject } from './wizard/store';
|
||||
@@ -14,7 +14,7 @@
|
||||
import { Modal } from '$lib/components';
|
||||
import type { Region } from '$lib/sdk/billing';
|
||||
|
||||
const teamId = $page.params.organization;
|
||||
const teamId = page.params.organization;
|
||||
export let regions: Array<Region> = [];
|
||||
export let showCreateProjectCloud: boolean;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { EmptySearch, PaginationWithLimit } from '$lib/components/index.js';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import Link from '$lib/elements/link.svelte';
|
||||
@@ -46,7 +46,7 @@
|
||||
source: 'organization_domain_overview'
|
||||
});
|
||||
}}
|
||||
href={`${base}/organization-${$page.params.organization}/domains/add-domain`}>
|
||||
href={`${base}/organization-${page.params.organization}/domains/add-domain`}>
|
||||
<Icon icon={IconPlus} size="s" />
|
||||
Add domain
|
||||
</Button>
|
||||
@@ -76,7 +76,7 @@
|
||||
{#each data.domains.domains as domain}
|
||||
<Table.Row.Link
|
||||
{root}
|
||||
href={`${base}/organization-${$page.params.organization}/domains/domain-${domain.$id}`}>
|
||||
href={`${base}/organization-${page.params.organization}/domains/domain-${domain.$id}`}>
|
||||
<Table.Cell column="domain" {root}>
|
||||
<Link external icon href={`${$protocol}${domain.domain}`} variant="quiet">
|
||||
{domain.domain}
|
||||
@@ -189,7 +189,7 @@
|
||||
source: 'organization_domain_overview'
|
||||
});
|
||||
}}
|
||||
href={`${base}/organization-${$page.params.organization}/domains/add-domain`}
|
||||
href={`${base}/organization-${page.params.organization}/domains/add-domain`}
|
||||
size="s">
|
||||
Add domain
|
||||
</Button>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Button, Form } from '$lib/elements/forms';
|
||||
import { InputDomain } from '$lib/elements/forms/index.js';
|
||||
import { Wizard } from '$lib/layout';
|
||||
@@ -12,14 +12,14 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
|
||||
let backPage = `${base}/organization-${$page.params.organization}/domains`;
|
||||
let backPage = `${base}/organization-${page.params.organization}/domains`;
|
||||
|
||||
let domainName = '';
|
||||
let domain: Domain;
|
||||
|
||||
async function addDomain() {
|
||||
try {
|
||||
domain = await sdk.forConsole.domains.create($page.params.organization, domainName);
|
||||
domain = await sdk.forConsole.domains.create(page.params.organization, domainName);
|
||||
console.log(domain);
|
||||
invalidate(Dependencies.DOMAINS);
|
||||
} catch (error) {
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@
|
||||
} from '@appwrite.io/pink-svelte';
|
||||
import SearchQuery from '$lib/components/searchQuery.svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import CertificateInfoModal from './certificateInfoModal.svelte';
|
||||
import DeleteCertificateModal from './deleteCertificateModal.svelte';
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
<svelte:fragment slot="actions">
|
||||
<Button
|
||||
secondary
|
||||
href={`${base}/organization-${$page.params.organization}/domains/domain-${$page.params.domain}/certificates`}>
|
||||
href={`${base}/organization-${page.params.organization}/domains/domain-${page.params.domain}/certificates`}>
|
||||
Clear search
|
||||
</Button>
|
||||
</svelte:fragment>
|
||||
|
||||
+8
-8
@@ -6,7 +6,7 @@
|
||||
import { Skeleton, Table } from '@appwrite.io/pink-svelte';
|
||||
import { capitalize } from '$lib/helpers/string';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import type { DnsRecordsList } from '$lib/sdk/domains';
|
||||
import { presets } from './store';
|
||||
import { invalidate } from '$app/navigation';
|
||||
@@ -19,17 +19,17 @@
|
||||
async function fetchPreset() {
|
||||
switch (selectedPreset.toLowerCase()) {
|
||||
case 'zoho':
|
||||
return await sdk.forConsole.domains.getPresetZoho($page.params.domain);
|
||||
return await sdk.forConsole.domains.getPresetZoho(page.params.domain);
|
||||
case 'mailgun':
|
||||
return await sdk.forConsole.domains.getPresetMailgun($page.params.domain);
|
||||
return await sdk.forConsole.domains.getPresetMailgun(page.params.domain);
|
||||
case 'outlook':
|
||||
return await sdk.forConsole.domains.getPresetOutlook($page.params.domain);
|
||||
return await sdk.forConsole.domains.getPresetOutlook(page.params.domain);
|
||||
case 'proton mail':
|
||||
return await sdk.forConsole.domains.getPresetProtonMail($page.params.domain);
|
||||
return await sdk.forConsole.domains.getPresetProtonMail(page.params.domain);
|
||||
case 'icloud':
|
||||
return await sdk.forConsole.domains.getPresetICloud($page.params.domain);
|
||||
return await sdk.forConsole.domains.getPresetICloud(page.params.domain);
|
||||
case 'google workspace':
|
||||
return await sdk.forConsole.domains.getPresetGoogleWorkspace($page.params.domain);
|
||||
return await sdk.forConsole.domains.getPresetGoogleWorkspace(page.params.domain);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
if (records.total) {
|
||||
const promises = records.dnsRecords.map((record) =>
|
||||
sdk.forConsole.domains.createRecordMX(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.name,
|
||||
record.value,
|
||||
record.ttl,
|
||||
|
||||
+10
-10
@@ -12,7 +12,7 @@
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { recordTypes } from './store';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { invalidate } from '$app/navigation';
|
||||
@@ -45,7 +45,7 @@
|
||||
switch (type) {
|
||||
case 'A':
|
||||
await sdk.forConsole.domains.createRecordA(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
name,
|
||||
value,
|
||||
ttl,
|
||||
@@ -55,7 +55,7 @@
|
||||
break;
|
||||
case 'AAAA':
|
||||
await sdk.forConsole.domains.createRecordAAAA(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
name,
|
||||
value,
|
||||
ttl,
|
||||
@@ -65,7 +65,7 @@
|
||||
break;
|
||||
case 'CNAME':
|
||||
await sdk.forConsole.domains.createRecordCNAME(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
name,
|
||||
value,
|
||||
ttl,
|
||||
@@ -75,7 +75,7 @@
|
||||
break;
|
||||
case 'MX':
|
||||
await sdk.forConsole.domains.createRecordMX(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
name,
|
||||
value,
|
||||
ttl,
|
||||
@@ -86,7 +86,7 @@
|
||||
break;
|
||||
case 'TXT':
|
||||
await sdk.forConsole.domains.createRecordTXT(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
name,
|
||||
value,
|
||||
ttl,
|
||||
@@ -96,7 +96,7 @@
|
||||
break;
|
||||
case 'NS':
|
||||
await sdk.forConsole.domains.createRecordNS(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
name,
|
||||
value,
|
||||
ttl,
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
case 'CAA':
|
||||
await sdk.forConsole.domains.createRecordCAA(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
name,
|
||||
value,
|
||||
ttl,
|
||||
@@ -117,7 +117,7 @@
|
||||
break;
|
||||
case 'HTTPS':
|
||||
await sdk.forConsole.domains.createRecordHTTPS(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
name,
|
||||
value,
|
||||
ttl,
|
||||
@@ -127,7 +127,7 @@
|
||||
break;
|
||||
case 'ALIAS':
|
||||
await sdk.forConsole.domains.createRecordAlias(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
name,
|
||||
value,
|
||||
ttl,
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Confirm } from '$lib/components';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import type { DnsRecord } from '$lib/sdk/domains';
|
||||
|
||||
export let show = false;
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
async function deleteDomain() {
|
||||
try {
|
||||
await sdk.forConsole.domains.deleteRecord($page.params.domain, selectedRecord.$id);
|
||||
await sdk.forConsole.domains.deleteRecord(page.params.domain, selectedRecord.$id);
|
||||
await invalidate(Dependencies.DOMAINS);
|
||||
show = false;
|
||||
addNotification({
|
||||
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Id, Tab } from '$lib/components';
|
||||
import Tabs from '$lib/components/tabs.svelte';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { domain } from './store';
|
||||
|
||||
const path = `${base}/organization-${$page.params.organization}/domains/domain-${$page.params.domain}`;
|
||||
const path = `${base}/organization-${page.params.organization}/domains/domain-${page.params.domain}`;
|
||||
const tabs = [
|
||||
{
|
||||
href: path,
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<Cover>
|
||||
<svelte:fragment slot="header">
|
||||
<CoverTitle href={`${base}/organization-${$page.params.organization}/domains`}>
|
||||
<CoverTitle href={`${base}/organization-${page.params.organization}/domains`}>
|
||||
{$domain.domain}
|
||||
</CoverTitle>
|
||||
<Id value={$domain.$id}>{$domain.$id}</Id>
|
||||
@@ -38,7 +38,7 @@
|
||||
{#each tabs as tab}
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
selected={isTabSelected(tab, page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
|
||||
+11
-11
@@ -8,7 +8,7 @@
|
||||
import { removeFile } from '$lib/helpers/files';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { DnsRecord } from '$lib/sdk/domains';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let show = false;
|
||||
let files: FileList;
|
||||
@@ -146,7 +146,7 @@
|
||||
switch (type) {
|
||||
case 'A':
|
||||
await sdk.forConsole.domains.createRecordA(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.name,
|
||||
record.value,
|
||||
record.ttl,
|
||||
@@ -155,7 +155,7 @@
|
||||
break;
|
||||
case 'AAAA':
|
||||
await sdk.forConsole.domains.createRecordAAAA(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.name,
|
||||
record.value,
|
||||
record.ttl,
|
||||
@@ -164,7 +164,7 @@
|
||||
break;
|
||||
case 'CNAME':
|
||||
await sdk.forConsole.domains.createRecordCNAME(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.name,
|
||||
record.value,
|
||||
record.ttl,
|
||||
@@ -173,7 +173,7 @@
|
||||
break;
|
||||
case 'MX':
|
||||
await sdk.forConsole.domains.createRecordMX(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.name,
|
||||
record.value,
|
||||
record.priority || 10,
|
||||
@@ -183,7 +183,7 @@
|
||||
break;
|
||||
case 'TXT':
|
||||
await sdk.forConsole.domains.createRecordTXT(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.name,
|
||||
record.value,
|
||||
record.ttl,
|
||||
@@ -192,7 +192,7 @@
|
||||
break;
|
||||
case 'NS':
|
||||
await sdk.forConsole.domains.createRecordNS(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.name,
|
||||
record.value,
|
||||
record.ttl,
|
||||
@@ -201,7 +201,7 @@
|
||||
break;
|
||||
case 'SRV':
|
||||
await sdk.forConsole.domains.createRecordSRV(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.name,
|
||||
record.value,
|
||||
record.ttl,
|
||||
@@ -213,7 +213,7 @@
|
||||
break;
|
||||
case 'CAA':
|
||||
await sdk.forConsole.domains.createRecordCAA(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.name,
|
||||
record.value,
|
||||
record.ttl,
|
||||
@@ -222,7 +222,7 @@
|
||||
break;
|
||||
case 'PTR':
|
||||
await sdk.forConsole.domains.createRecordHTTPS(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.name,
|
||||
record.value,
|
||||
record.ttl,
|
||||
@@ -231,7 +231,7 @@
|
||||
break;
|
||||
case 'ALIAS':
|
||||
await sdk.forConsole.domains.createRecordAlias(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.name,
|
||||
record.value,
|
||||
record.ttl,
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { CardGrid } from '$lib/components';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button, InputSelect } from '$lib/elements/forms';
|
||||
@@ -34,7 +34,7 @@
|
||||
$: options = organizations.total
|
||||
? organizations.teams
|
||||
.map((org) => ({ label: org.name, value: org.$id }))
|
||||
.filter((org) => org.value !== $page.params.organization)
|
||||
.filter((org) => org.value !== page.params.organization)
|
||||
: [];
|
||||
</script>
|
||||
|
||||
|
||||
+10
-10
@@ -15,7 +15,7 @@
|
||||
import { deepClone } from '$lib/helpers/object';
|
||||
import type { DnsRecord } from '$lib/sdk/domains';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { recordTypes } from './store';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
@@ -34,7 +34,7 @@
|
||||
switch (record.type) {
|
||||
case 'A':
|
||||
await sdk.forConsole.domains.updateRecordA(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.$id,
|
||||
record.name,
|
||||
record.value,
|
||||
@@ -45,7 +45,7 @@
|
||||
break;
|
||||
case 'AAAA':
|
||||
await sdk.forConsole.domains.updateRecordAAAA(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.$id,
|
||||
record.name,
|
||||
record.value,
|
||||
@@ -56,7 +56,7 @@
|
||||
break;
|
||||
case 'CNAME':
|
||||
await sdk.forConsole.domains.updateRecordCNAME(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.$id,
|
||||
record.name,
|
||||
record.value,
|
||||
@@ -67,7 +67,7 @@
|
||||
break;
|
||||
case 'MX':
|
||||
await sdk.forConsole.domains.updateRecordMX(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.$id,
|
||||
record.name,
|
||||
record.value,
|
||||
@@ -79,7 +79,7 @@
|
||||
break;
|
||||
case 'TXT':
|
||||
await sdk.forConsole.domains.updateRecordTXT(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.$id,
|
||||
record.name,
|
||||
record.value,
|
||||
@@ -90,7 +90,7 @@
|
||||
break;
|
||||
case 'NS':
|
||||
await sdk.forConsole.domains.updateRecordNS(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.$id,
|
||||
record.name,
|
||||
record.value,
|
||||
@@ -102,7 +102,7 @@
|
||||
|
||||
case 'CAA':
|
||||
await sdk.forConsole.domains.updateRecordCAA(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.$id,
|
||||
record.name,
|
||||
record.value,
|
||||
@@ -113,7 +113,7 @@
|
||||
break;
|
||||
case 'HTTPS':
|
||||
await sdk.forConsole.domains.updateRecordHTTPS(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.$id,
|
||||
record.name,
|
||||
record.value,
|
||||
@@ -124,7 +124,7 @@
|
||||
break;
|
||||
case 'ALIAS':
|
||||
await sdk.forConsole.domains.updateRecordAlias(
|
||||
$page.params.domain,
|
||||
page.params.domain,
|
||||
record.$id,
|
||||
record.name,
|
||||
record.value,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { AvatarGroup, Tab, Tabs } from '$lib/components';
|
||||
import { BillingPlan } from '$lib/constants';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
@@ -30,7 +30,7 @@
|
||||
});
|
||||
|
||||
$: avatars = $members.memberships?.map((m) => m.userName || m.userEmail) ?? [];
|
||||
$: organizationId = $page.params.organization;
|
||||
$: organizationId = page.params.organization;
|
||||
$: path = `${base}/organization-${organizationId}`;
|
||||
$: tabs = [
|
||||
{
|
||||
@@ -126,7 +126,7 @@
|
||||
{#each tabs as tab}
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
selected={isTabSelected(tab, page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { AvatarInitials, PaginationWithLimit } from '$lib/components';
|
||||
import { Button as ConsoleButton } from '$lib/elements/forms';
|
||||
@@ -49,7 +49,7 @@
|
||||
member.userEmail,
|
||||
undefined,
|
||||
undefined,
|
||||
`${$page.url.origin}${base}/invite`,
|
||||
`${page.url.origin}${base}/invite`,
|
||||
member.userName || undefined
|
||||
);
|
||||
addNotification({
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script>
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Container } from '$lib/layout';
|
||||
import { Typography } from '@appwrite.io/pink-svelte';
|
||||
</script>
|
||||
|
||||
<Container>
|
||||
<Typography.Title size="xl">{$page.error.status || 'Invalid Argument'}</Typography.Title>
|
||||
<p class="body-text-2 u-bold u-margin-block-start-4">{$page.error.message}</p>
|
||||
<Typography.Title size="xl">{page.error.status || 'Invalid Argument'}</Typography.Title>
|
||||
<p class="body-text-2 u-bold u-margin-block-start-4">{page.error.message}</p>
|
||||
</Container>
|
||||
@@ -14,7 +14,7 @@
|
||||
teamSearcher,
|
||||
userSearcher
|
||||
} from '$lib/commandCenter/searchers';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { base } from '$app/paths';
|
||||
import {
|
||||
canSeeBuckets,
|
||||
@@ -68,7 +68,7 @@
|
||||
goto(`${base}/project-${$project.$id}/messaging`);
|
||||
},
|
||||
keys: ['g', 'm'],
|
||||
disabled: $page.url.pathname.endsWith('messaging') || !$canSeeMessages,
|
||||
disabled: page.url.pathname.endsWith('messaging') || !$canSeeMessages,
|
||||
group: 'navigation'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { CopyInput, Modal } from '$lib/components';
|
||||
import { Button, InputSwitch, InputText, InputTextarea } from '$lib/elements/forms';
|
||||
import { oAuthProviders, type Provider } from '$lib/stores/oauth-providers';
|
||||
@@ -9,7 +9,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Link, Alert } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
|
||||
export let provider: Models.AuthProvider;
|
||||
export let show = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { CopyInput, Modal } from '$lib/components';
|
||||
import { Button, InputPassword, InputSwitch, InputText } from '$lib/elements/forms';
|
||||
import { oAuthProviders, type Provider } from '$lib/stores/oauth-providers';
|
||||
@@ -9,7 +9,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Link, Alert } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
|
||||
export let provider: Models.AuthProvider;
|
||||
export let show = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { CopyInput, Modal } from '$lib/components';
|
||||
import { Button, InputPassword, InputSwitch, InputText } from '$lib/elements/forms';
|
||||
import { oAuthProviders, type Provider } from '$lib/stores/oauth-providers';
|
||||
@@ -9,7 +9,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Link, Alert } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
|
||||
export let provider: Models.AuthProvider;
|
||||
export let show = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { CopyInput, Modal } from '$lib/components';
|
||||
import { Button, InputPassword, InputSwitch, InputText } from '$lib/elements/forms';
|
||||
import { oAuthProviders, type Provider } from '$lib/stores/oauth-providers';
|
||||
@@ -9,7 +9,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Link, Alert } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
|
||||
export let provider: Models.AuthProvider;
|
||||
export let show = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { CopyInput, Modal } from '$lib/components';
|
||||
import { Button, InputPassword, InputSwitch, InputText } from '$lib/elements/forms';
|
||||
import { oAuthProviders, type Provider } from '$lib/stores/oauth-providers';
|
||||
@@ -9,7 +9,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Alert } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
|
||||
export let provider: Models.AuthProvider;
|
||||
export let show = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { CopyInput, Modal } from '$lib/components';
|
||||
import { Button, InputPassword, InputSwitch, InputText } from '$lib/elements/forms';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
@@ -9,7 +9,7 @@
|
||||
import { oAuthProviders, type Provider } from '$lib/stores/oauth-providers';
|
||||
import { Link, Alert } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
|
||||
export let provider: Models.AuthProvider;
|
||||
export let show = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { CopyInput, Modal } from '$lib/components';
|
||||
import { Button, InputPassword, InputSwitch, InputText } from '$lib/elements/forms';
|
||||
import { oAuthProviders, type Provider } from '$lib/stores/oauth-providers';
|
||||
@@ -9,7 +9,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Alert } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
|
||||
export let provider: Models.AuthProvider;
|
||||
export let show = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { CopyInput, Modal } from '$lib/components';
|
||||
import { Button, InputPassword, InputSwitch, InputText } from '$lib/elements/forms';
|
||||
import { oAuthProviders, type Provider } from '$lib/stores/oauth-providers';
|
||||
@@ -9,7 +9,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Alert } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
|
||||
export let provider: Models.AuthProvider;
|
||||
export let show = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { CopyInput, Modal } from '$lib/components';
|
||||
import { Button, InputPassword, InputSwitch, InputText } from '$lib/elements/forms';
|
||||
import { oAuthProviders, type Provider } from '$lib/stores/oauth-providers';
|
||||
@@ -9,7 +9,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Alert } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
|
||||
export let provider: Models.AuthProvider;
|
||||
export let show = false;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
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';
|
||||
@@ -16,30 +16,30 @@
|
||||
{
|
||||
label: 'Create user',
|
||||
callback: async () => {
|
||||
if (!$page.url.pathname.endsWith('auth')) {
|
||||
if (!page.url.pathname.endsWith('auth')) {
|
||||
await goto(`${base}/project-${$project.$id}/auth`);
|
||||
}
|
||||
showCreateUser.set(true);
|
||||
},
|
||||
keys: $page.url.pathname.endsWith('auth') ? ['c'] : ['c', 'u'],
|
||||
keys: page.url.pathname.endsWith('auth') ? ['c'] : ['c', 'u'],
|
||||
group: 'users',
|
||||
icon: IconPlus,
|
||||
rank: $page.url.pathname.endsWith('auth') ? 10 : 0,
|
||||
rank: page.url.pathname.endsWith('auth') ? 10 : 0,
|
||||
disabled: ($readOnly && !GRACE_PERIOD_OVERRIDE) || !$canWriteUsers
|
||||
},
|
||||
{
|
||||
label: 'Create team',
|
||||
callback: async () => {
|
||||
if (!$page.url.pathname.endsWith('teams')) {
|
||||
if (!page.url.pathname.endsWith('teams')) {
|
||||
await goto(`${base}/project-${$project.$id}/auth/teams`);
|
||||
}
|
||||
showCreateTeam.set(true);
|
||||
},
|
||||
keys: $page.url.pathname.endsWith('teams') ? ['c'] : ['c', 't'],
|
||||
keys: page.url.pathname.endsWith('teams') ? ['c'] : ['c', 't'],
|
||||
|
||||
group: 'teams',
|
||||
icon: IconPlus,
|
||||
rank: $page.url.pathname.endsWith('teams') ? 10 : 0,
|
||||
rank: page.url.pathname.endsWith('teams') ? 10 : 0,
|
||||
disabled: ($readOnly && !GRACE_PERIOD_OVERRIDE) || !$canWriteTeams
|
||||
},
|
||||
{
|
||||
@@ -50,7 +50,7 @@
|
||||
},
|
||||
group: 'navigation',
|
||||
rank: 1,
|
||||
disabled: $page.url.pathname.endsWith('teams')
|
||||
disabled: page.url.pathname.endsWith('teams')
|
||||
},
|
||||
{
|
||||
label: 'Go to usage',
|
||||
@@ -60,7 +60,7 @@
|
||||
},
|
||||
group: 'navigation',
|
||||
rank: 1,
|
||||
disabled: $page.url.pathname.endsWith('usage')
|
||||
disabled: page.url.pathname.endsWith('usage')
|
||||
},
|
||||
{
|
||||
label: 'Go to security',
|
||||
@@ -70,7 +70,7 @@
|
||||
},
|
||||
group: 'navigation',
|
||||
rank: 1,
|
||||
disabled: $page.url.pathname.endsWith('security') || !$canWriteUsers
|
||||
disabled: page.url.pathname.endsWith('security') || !$canWriteUsers
|
||||
},
|
||||
{
|
||||
label: 'Go to settings',
|
||||
@@ -80,7 +80,7 @@
|
||||
},
|
||||
group: 'navigation',
|
||||
rank: 1,
|
||||
disabled: $page.url.pathname.endsWith('settings') || !$canWriteUsers
|
||||
disabled: page.url.pathname.endsWith('settings') || !$canWriteUsers
|
||||
},
|
||||
{
|
||||
label: 'Find users',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import {
|
||||
AvatarInitials,
|
||||
Copy,
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
const columns = writable<Column[]>([
|
||||
{ id: '$id', title: 'User ID', type: 'string', width: 200 },
|
||||
{ id: 'name', title: 'Name', type: 'string', width: { min: 260 } },
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
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';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
const path = `${base}/project-${projectId}/auth`;
|
||||
const tabs = [
|
||||
{
|
||||
@@ -59,7 +59,7 @@
|
||||
<Tab
|
||||
href={tab.href}
|
||||
event={tab.event}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
selected={isTabSelected(tab, page.url.pathname, path, tabs)}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { CardGrid } from '$lib/components';
|
||||
import { InputSwitch } from '$lib/elements/forms';
|
||||
@@ -14,7 +14,7 @@
|
||||
import { base } from '$app/paths';
|
||||
import { Avatar, Badge, Card, Layout, Typography } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
let showProvider = false;
|
||||
|
||||
let selectedProvider: Models.AuthProvider | null = null;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import {
|
||||
Empty,
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
const project = $page.params.project;
|
||||
const project = page.params.project;
|
||||
const teamCreated = async (event: CustomEvent<Models.Team<Record<string, unknown>>>) => {
|
||||
await goto(`${base}/project-${project}/auth/teams/team-${event.detail.$id}`);
|
||||
};
|
||||
@@ -79,7 +79,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-${$page.params.project}/auth/teams`}>
|
||||
<Button secondary size="s" href={`${base}/project-${page.params.project}/auth/teams`}>
|
||||
Clear Search
|
||||
</Button>
|
||||
</EmptySearch>
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button, InputEmail, InputText, InputTags } from '$lib/elements/forms';
|
||||
@@ -25,7 +25,7 @@
|
||||
email || undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
`${$page.url.origin}${base}/invite`,
|
||||
`${page.url.origin}${base}/invite`,
|
||||
name || undefined
|
||||
);
|
||||
addNotification({
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
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';
|
||||
@@ -26,7 +26,7 @@
|
||||
dispatch('deleted');
|
||||
trackEvent(Submit.MemberDelete);
|
||||
await goto(
|
||||
`${base}/project-${$page.params.project}/auth/teams/team-${selectedMembership.teamId}/members`
|
||||
`${base}/project-${page.params.project}/auth/teams/team-${selectedMembership.teamId}/members`
|
||||
);
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
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';
|
||||
@@ -18,7 +18,7 @@
|
||||
await sdk.forProject.teams.delete(team.$id);
|
||||
showDelete = false;
|
||||
trackEvent(Submit.TeamDelete);
|
||||
await goto(`${base}/project-${$page.params.project}/auth/teams`);
|
||||
await goto(`${base}/project-${page.params.project}/auth/teams`);
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.TeamDelete);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
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';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const teamId = $page.params.team;
|
||||
const projectId = page.params.project;
|
||||
const teamId = page.params.team;
|
||||
const path = `${base}/project-${projectId}/auth/teams/team-${teamId}`;
|
||||
const tabs = [
|
||||
{
|
||||
@@ -42,7 +42,7 @@
|
||||
{#each tabs as tab}
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
selected={isTabSelected(tab, page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Empty, EmptySearch, AvatarInitials, PaginationWithLimit } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { Container } from '$lib/layout';
|
||||
@@ -21,7 +21,7 @@
|
||||
let showDelete = false;
|
||||
let selectedMembership: Models.Membership;
|
||||
|
||||
const project = $page.params.project;
|
||||
const project = page.params.project;
|
||||
|
||||
async function memberCreated() {
|
||||
invalidate(Dependencies.MEMBERSHIPS);
|
||||
@@ -112,7 +112,7 @@
|
||||
{/if}
|
||||
</Container>
|
||||
|
||||
<CreateMember teamId={$page.params.team} bind:showCreate on:created={memberCreated} />
|
||||
<CreateMember teamId={page.params.team} bind:showCreate on:created={memberCreated} />
|
||||
<DeleteMembership
|
||||
{selectedMembership}
|
||||
bind:showDelete
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { CardGrid } from '$lib/components';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
async function updateName() {
|
||||
try {
|
||||
await sdk.forProject.teams.updateName($page.params.team, teamName);
|
||||
await sdk.forProject.teams.updateName(page.params.team, teamName);
|
||||
await invalidate(Dependencies.TEAM);
|
||||
addNotification({
|
||||
message: 'Name has been updated',
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
import EmailTemplate from './emailTemplate.svelte';
|
||||
import LocaleOptions from './localeOptions.svelte';
|
||||
import { loadEmailTemplate } from './+page.svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { baseEmailTemplate, emailTemplate } from './store';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Id } from '$lib/components';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
let locale = 'en';
|
||||
let loading = false;
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
import EmailTemplate from './emailTemplate.svelte';
|
||||
import LocaleOptions from './localeOptions.svelte';
|
||||
import { loadEmailTemplate } from './+page.svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { baseEmailTemplate, emailTemplate } from './store';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Id } from '$lib/components';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
let locale = 'en';
|
||||
let loading = false;
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
import EmailTemplate from './emailTemplate.svelte';
|
||||
import LocaleOptions from './localeOptions.svelte';
|
||||
import { baseEmailTemplate, emailTemplate } from './store';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Id } from '$lib/components';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
|
||||
let locale = 'en';
|
||||
let loading = false;
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
import LocaleOptions from './localeOptions.svelte';
|
||||
import { baseEmailTemplate, emailTemplate } from './store';
|
||||
import { loadEmailTemplate } from './+page.svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Id } from '$lib/components';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
|
||||
let locale = 'en';
|
||||
let loading = false;
|
||||
|
||||
+2
-2
@@ -2,14 +2,14 @@
|
||||
import EmailTemplate from './emailTemplate.svelte';
|
||||
import LocaleOptions from './localeOptions.svelte';
|
||||
import { loadEmailTemplate } from './+page.svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { baseEmailTemplate, emailTemplate } from './store';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Id } from '$lib/components';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
let locale = 'en';
|
||||
let loading = false;
|
||||
|
||||
|
||||
+2
-2
@@ -3,13 +3,13 @@
|
||||
import LocaleOptions from './localeOptions.svelte';
|
||||
import { loadEmailTemplate } from './+page.svelte';
|
||||
import { baseEmailTemplate, emailTemplate } from './store';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Id } from '$lib/components';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
|
||||
let locale = 'en';
|
||||
let loading = false;
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import SmsTemplate from './smsTemplate.svelte';
|
||||
import LocaleOptions from './localeOptions.svelte';
|
||||
import { baseSmsTemplate, smsTemplate } from './store';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { loadSmsTemplate } from './+page.svelte';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Id } from '$lib/components';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
let locale = 'en';
|
||||
let loading = false;
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<script lang="ts">
|
||||
import SmsTemplate from './smsTemplate.svelte';
|
||||
import LocaleOptions from './localeOptions.svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { loadSmsTemplate } from './+page.svelte';
|
||||
import { baseSmsTemplate, smsTemplate } from './store';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Id } from '$lib/components';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
let locale = 'en';
|
||||
let loading = false;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Button, Form, InputTextarea } from '$lib/elements/forms';
|
||||
import ResetSms from './resetSms.svelte';
|
||||
import { baseSmsTemplate, smsTemplate } from './store';
|
||||
@@ -11,7 +11,7 @@
|
||||
import type { SmsTemplateLocale, SmsTemplateType } from '@appwrite.io/console';
|
||||
|
||||
export let loading = false;
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
let openResetModal = false;
|
||||
|
||||
let eventType = Submit.SmsUpdateInviteTemplate;
|
||||
|
||||
+2
-2
@@ -1,14 +1,14 @@
|
||||
<script lang="ts">
|
||||
import SmsTemplate from './smsTemplate.svelte';
|
||||
import LocaleOptions from './localeOptions.svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { loadSmsTemplate } from './+page.svelte';
|
||||
import { baseSmsTemplate, smsTemplate } from './store';
|
||||
import { Id } from '$lib/components';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const projectId = page.params.project;
|
||||
let locale = 'en';
|
||||
let loading = false;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Container, Usage } from '$lib/layout';
|
||||
import type { PageData } from './$types';
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<Container>
|
||||
<Usage
|
||||
path={`${base}/project-${$page.params.project}/auth/usage`}
|
||||
path={`${base}/project-${page.params.project}/auth/usage`}
|
||||
countMetadata={{
|
||||
legend: 'Users',
|
||||
title: 'Registered users'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
async function deleteAllSessions() {
|
||||
try {
|
||||
await sdk.forProject.users.deleteSessions($page.params.user);
|
||||
await sdk.forProject.users.deleteSessions(page.params.user);
|
||||
await invalidate(Dependencies.SESSIONS);
|
||||
showDeleteAll = false;
|
||||
addNotification({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
@@ -29,7 +29,7 @@
|
||||
});
|
||||
trackEvent(Submit.MemberDelete);
|
||||
await goto(
|
||||
`${base}/project-${$page.params.project}/auth/user-${selectedMembership.userId}/memberships`
|
||||
`${base}/project-${page.params.project}/auth/user-${selectedMembership.userId}/memberships`
|
||||
);
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
|
||||
Loaded 100 of 312 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user