diff --git a/src/lib/components/billing/alerts/selectProjectCloud.svelte b/src/lib/components/billing/alerts/selectProjectCloud.svelte index 510334aa2..80bfe57d7 100644 --- a/src/lib/components/billing/alerts/selectProjectCloud.svelte +++ b/src/lib/components/billing/alerts/selectProjectCloud.svelte @@ -92,8 +92,8 @@ - Choose which {$currentPlan?.projects || 2} projects to keep. Projects over the limit will be - blocked after this date. + Choose which {$currentPlan?.projects || 2} projects to keep. Projects over the limit will be blocked + after this date. {#if loading} diff --git a/src/lib/components/logs/logsResponse.svelte b/src/lib/components/logs/logsResponse.svelte index 820df640a..eb38dce87 100644 --- a/src/lib/components/logs/logsResponse.svelte +++ b/src/lib/components/logs/logsResponse.svelte @@ -143,8 +143,8 @@ {:else} - Body data is not captured by {resolvedProfile.platform} for your user's security - and privacy. To display body data in the Logs tab, use . Learn more. diff --git a/src/routes/(console)/(migration-wizard)/resource-form.svelte b/src/routes/(console)/(migration-wizard)/resource-form.svelte index 19f096dee..60521173c 100644 --- a/src/routes/(console)/(migration-wizard)/resource-form.svelte +++ b/src/routes/(console)/(migration-wizard)/resource-form.svelte @@ -129,8 +129,8 @@ {#if report && !isVersionAtLeast(version, '1.4.0') && $provider.provider === 'appwrite'} Functions not available for import - To migrate your functions, update the version of the {resolvedProfile.platform} instance - you're importing from to a version newer than 1.4 + To migrate your functions, update the version of the {resolvedProfile.platform} instance you're + importing from to a version newer than 1.4 {/if} diff --git a/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte b/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte index 1d9d7bc67..ec27f38b5 100644 --- a/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte +++ b/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte @@ -81,8 +81,8 @@ Billing alerts {#if !currentPlan.budgeting} Get notified by email when your organization meets a percentage of your budget cap. {tierToPlan(organization.billingPlan).name} organizations will receive one notification - at 75% resource usage. + >{tierToPlan(organization.billingPlan).name} organizations will receive one notification at + 75% resource usage. {:else} Get notified by email when your organization meets or exceeds a percentage of your specified billing alert(s). diff --git a/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte b/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte index 9e133746d..6f49161fe 100644 --- a/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte +++ b/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte @@ -50,8 +50,8 @@
Budget cap - Restrict your resource usage by setting a budget cap. Cap usage is reset at the beginning of - each billing cycle. + Restrict your resource usage by setting a budget cap. Cap usage is reset at the beginning of each + billing cycle. {#if !currentPlan.budgeting} diff --git a/src/routes/(console)/organization-[organization]/settings/+page.svelte b/src/routes/(console)/organization-[organization]/settings/+page.svelte index b5bf05fc0..c97d099fd 100644 --- a/src/routes/(console)/organization-[organization]/settings/+page.svelte +++ b/src/routes/(console)/organization-[organization]/settings/+page.svelte @@ -81,8 +81,8 @@ Delete organization - The organization will be permanently deleted, including all projects and data associated - with this organization. This action is irreversible. + The organization will be permanently deleted, including all projects and data associated with + this organization. This action is irreversible. diff --git a/src/routes/(console)/organization-[organization]/settings/downloadDPA.svelte b/src/routes/(console)/organization-[organization]/settings/downloadDPA.svelte index d84303b26..6c4555e8b 100644 --- a/src/routes/(console)/organization-[organization]/settings/downloadDPA.svelte +++ b/src/routes/(console)/organization-[organization]/settings/downloadDPA.svelte @@ -17,8 +17,8 @@ DPA - After downloading, have the DPA signed by your organization's compliance authority, such as your - CEO or Compliance Manager, and submit it to + After downloading, have the DPA signed by your organization's compliance authority, such as your CEO + or Compliance Manager, and submit it to privacy@appwrite.io. diff --git a/src/routes/(console)/project-[region]-[project]/auth/(providers)/appleOAuth.svelte b/src/routes/(console)/project-[region]-[project]/auth/(providers)/appleOAuth.svelte index 788922eb4..0554e9598 100644 --- a/src/routes/(console)/project-[region]-[project]/auth/(providers)/appleOAuth.svelte +++ b/src/routes/(console)/project-[region]-[project]/auth/(providers)/appleOAuth.svelte @@ -44,8 +44,8 @@

- To use {provider.name} authentication in your application, first fill in this form. For more - info you can + To use {provider.name} authentication in your application, first fill in this form. For more info + you can - To use {provider.name} authentication in your application, first fill in this form. For more - info you can + To use {provider.name} authentication in your application, first fill in this form. For more info + you can visit the docs. diff --git a/src/routes/(console)/project-[region]-[project]/auth/(providers)/authentikOAuth.svelte b/src/routes/(console)/project-[region]-[project]/auth/(providers)/authentikOAuth.svelte index d367dbd77..19a3b40c6 100644 --- a/src/routes/(console)/project-[region]-[project]/auth/(providers)/authentikOAuth.svelte +++ b/src/routes/(console)/project-[region]-[project]/auth/(providers)/authentikOAuth.svelte @@ -46,8 +46,8 @@

- To use {provider.name} authentication in your application, first fill in this form. For more - info you can + To use {provider.name} authentication in your application, first fill in this form. For more info + you can

- To use {provider.name} authentication in your application, first fill in this form. For more - info you can + To use {provider.name} authentication in your application, first fill in this form. For more info + you can visit the docs.

diff --git a/src/routes/(console)/project-[region]-[project]/auth/(providers)/googleOAuth.svelte b/src/routes/(console)/project-[region]-[project]/auth/(providers)/googleOAuth.svelte index cf01f41a9..d5457b28b 100644 --- a/src/routes/(console)/project-[region]-[project]/auth/(providers)/googleOAuth.svelte +++ b/src/routes/(console)/project-[region]-[project]/auth/(providers)/googleOAuth.svelte @@ -43,8 +43,8 @@ {provider.name} OAuth2 settings

- To use {provider.name} authentication in your application, first fill in this form. For more - info you can + To use {provider.name} authentication in your application, first fill in this form. For more info + you can visit the docs.

diff --git a/src/routes/(console)/project-[region]-[project]/auth/(providers)/mainOAuth.svelte b/src/routes/(console)/project-[region]-[project]/auth/(providers)/mainOAuth.svelte index 8e33f1022..365782e6b 100644 --- a/src/routes/(console)/project-[region]-[project]/auth/(providers)/mainOAuth.svelte +++ b/src/routes/(console)/project-[region]-[project]/auth/(providers)/mainOAuth.svelte @@ -41,8 +41,8 @@

- To use {provider.name} authentication in your application, first fill in this form. For more - info you can + To use {provider.name} authentication in your application, first fill in this form. For more info + you can

- To use {provider.name} authentication in your application, first fill in this form. For more - info you can + To use {provider.name} authentication in your application, first fill in this form. For more info + you can visit the docs. diff --git a/src/routes/(console)/project-[region]-[project]/auth/(providers)/oidcOAuth.svelte b/src/routes/(console)/project-[region]-[project]/auth/(providers)/oidcOAuth.svelte index 40637fb91..1360c4b72 100644 --- a/src/routes/(console)/project-[region]-[project]/auth/(providers)/oidcOAuth.svelte +++ b/src/routes/(console)/project-[region]-[project]/auth/(providers)/oidcOAuth.svelte @@ -67,8 +67,8 @@

- To use {provider.name} authentication in your application, first fill in this form. For more - info you can + To use {provider.name} authentication in your application, first fill in this form. For more info + you can visit the docs.

diff --git a/src/routes/(console)/project-[region]-[project]/auth/(providers)/oktaOAuth.svelte b/src/routes/(console)/project-[region]-[project]/auth/(providers)/oktaOAuth.svelte index 65e832d3b..57f5c9e2c 100644 --- a/src/routes/(console)/project-[region]-[project]/auth/(providers)/oktaOAuth.svelte +++ b/src/routes/(console)/project-[region]-[project]/auth/(providers)/oktaOAuth.svelte @@ -55,8 +55,8 @@ on:close title={`${provider.name} OAuth2 settings`}>

- To use {provider.name} authentication in your application, first fill in this form. For more - info you can + To use {provider.name} authentication in your application, first fill in this form. For more info + you can visit the docs.

diff --git a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/identities/+page.svelte b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/identities/+page.svelte index 7b5c83685..5868f409c 100644 --- a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/identities/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/identities/+page.svelte @@ -43,8 +43,8 @@ More info

- User identities are the user's connected OAuth accounts.
The user can - sign in using these identities. + User identities are the user's connected OAuth accounts.
The user can sign + in using these identities.

diff --git a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/targets/+page.svelte b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/targets/+page.svelte index 7774be57f..9a4fa4c8f 100644 --- a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/targets/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/targets/+page.svelte @@ -25,8 +25,8 @@

User targets include emails, phone numbers, and devices with your app - installed.
These targets can subscribe to a topic and receive messages - published to it. + installed.
These targets can subscribe to a topic and receive messages published + to it.

diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte index 5b4a67273..625e9f730 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte @@ -326,8 +326,8 @@ APPWRITE_ENDPOINT = "${sdk.forProject(page.params.region, page.params.project).c The hostname that your website will use to interact with the - {resolvedProfile.platform} APIs in production or development - environments. No protocol or port number required. + {resolvedProfile.platform} APIs in production or development environments. + No protocol or port number required. diff --git a/src/routes/(console)/project-[region]-[project]/settings/updateInstallations.svelte b/src/routes/(console)/project-[region]-[project]/settings/updateInstallations.svelte index 8ce104063..35d23d0a8 100644 --- a/src/routes/(console)/project-[region]-[project]/settings/updateInstallations.svelte +++ b/src/routes/(console)/project-[region]-[project]/settings/updateInstallations.svelte @@ -171,8 +171,8 @@ {:else if isSelfHosted && !isVcsEnabled} - Before installing Git in a locally hosted {resolvedProfile.platform} project, ensure - your environment variables are configured. + Before installing Git in a locally hosted {resolvedProfile.platform} project, ensure your + environment variables are configured. import { Container } from '$lib/layout'; import { CardGrid, Card, ProgressBarBig } from '$lib/components'; - import { showUsageRatesModal, tierToPlan, upgradeURL } from '$lib/stores/billing'; + import { plansInfo, showUsageRatesModal, upgradeURL } from '$lib/stores/billing'; import { organization } from '$lib/stores/organization'; import { Button } from '$lib/elements/forms'; import { bytesToSize, humanFileSize, mbSecondsToGBHours } from '$lib/helpers/sizeConvertion'; @@ -9,34 +9,40 @@ import { formatNum } from '$lib/helpers/string'; import { total } from '$lib/layout/usage.svelte'; import { BillingPlan } from '$lib/constants.js'; - import { base } from '$app/paths'; + import { resolve } from '$app/paths'; import { formatCurrency, formatNumberWithCommas, clampMin } from '$lib/helpers/numbers'; import { getCountryName } from '$lib/helpers/diallingCodes.js'; import { Accordion, Icon, Layout, Link, Table, Typography } from '@appwrite.io/pink-svelte'; import { IconChartSquareBar } from '@appwrite.io/pink-icons-svelte'; - import { page } from '$app/state'; import { isFreePlan, isPaidPlan } from '$lib/helpers/billing.js'; - import { resolvedProfile } from '$lib/profiles/index.svelte'; - import { Platform } from '@appwrite.io/console'; + import { ProfileMode, resolvedProfile } from '$lib/profiles/index.svelte'; + import type { PageProps } from './$types'; - export let data; + const { data, params }: PageProps = $props(); - $: baseRoute = `${base}/project-${page.params.region}-${page.params.project}`; - $: network = data.usage.network; - $: users = data.usage.users; - $: usersTotal = data.usage.usersTotal; - $: executions = data.usage.executions; - $: executionsTotal = data.usage.executionsTotal; - $: storage = + const baseRoute = $derived( + resolve('/(console)/project-[region]-[project]', { + region: params.region, + project: params.project + }) + ); + + const network = $derived(data.usage.network); + const users = $derived(data.usage.users); + const usersTotal = $derived(data.usage.usersTotal); + const executions = $derived(data.usage.executions); + const executionsTotal = $derived(data.usage.executionsTotal); + const storage = $derived( data.usage.filesStorageTotal + - data.usage.deploymentsStorageTotal + - data.usage.buildsStorageTotal; - $: imageTransformations = data.usage.imageTransformations; - $: imageTransformationsTotal = data.usage.imageTransformationsTotal; - $: dbReads = data.usage.databasesReads; - $: dbWrites = data.usage.databasesWrites; + data.usage.deploymentsStorageTotal + + data.usage.buildsStorageTotal + ); + const imageTransformations = $derived(data.usage.imageTransformations); + const imageTransformationsTotal = $derived(data.usage.imageTransformationsTotal); + const dbReads = $derived(data.usage.databasesReads); + const dbWrites = $derived(data.usage.databasesWrites); - $: legendData = [ + const legendData = $derived([ { name: 'Reads', value: clampMin(data.usage.databasesReads.reduce((sum, item) => sum + item.value, 0)) @@ -45,10 +51,10 @@ name: 'Writes', value: clampMin(data.usage.databasesWrites.reduce((sum, item) => sum + item.value, 0)) } - ]; + ]); - const tier = data?.currentInvoice?.plan ?? $organization?.billingPlan; - const plan = tierToPlan(tier).name; + const plan = $derived($plansInfo.get(data?.currentInvoice?.plan ?? $organization?.billingPlan)); + const planName = $derived(plan.name); @@ -66,19 +72,19 @@

On the Scale plan, you'll be charged only for any usage that exceeds the thresholds per resource listed below. ($showUsageRatesModal = true)} + onclick={() => ($showUsageRatesModal = true)} >Learn more about plan usage limits.

{:else if isPaidPlan($organization.billingPlan)}

On the Pro plan, you'll be charged only for any usage that exceeds the thresholds per resource listed below. ($showUsageRatesModal = true)} + onclick={() => ($showUsageRatesModal = true)} >Learn more about plan usage limits.

{:else if isFreePlan($organization?.billingPlan)}

- If you exceed the limits of the {plan} plan, services for your projects may be disrupted. + If you exceed the limits of the {planName} plan, services for your projects may be disrupted. Upgrade for greater capacity. @@ -86,40 +92,54 @@ {/if} - {#if resolvedProfile.platform === Platform.Imagine} + {#if resolvedProfile.id === ProfileMode.STUDIO} - Imagine Credits - Total Imagine credits consumed across your project. Resets at the start of each billing cycle. + Credits + Current credit usage included in your plan. {#if data.usage.imagineCredits} {@const creditsTotal = data.usage.imagineCredits.reduce( (sum, item) => sum + item.value, 0 )} - - - {formatNumberWithCommas(creditsTotal)} - - Credits + {@const creditsLimit = plan.limits?.credits ?? plan.limits?.dailyCredits ?? 0} + {@const percentageUsed = + creditsLimit > 0 ? Math.round((creditsTotal / creditsLimit) * 100) : 0} + + + + + {formatNumberWithCommas(creditsTotal)} + + Credits used + + + + + {percentageUsed}% + + - {#if data.usage.imagineCredits.length > 0} - [e.date, e.value]) - ] - } - ]} /> - {/if} + } + ]} /> + + + {formatNumberWithCommas(creditsTotal)} + + {formatNumberWithCommas(creditsLimit)} + {:else} diff --git a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildSettings.svelte b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildSettings.svelte index 0f4cbeef3..4fa1671c2 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildSettings.svelte +++ b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildSettings.svelte @@ -184,8 +184,8 @@ Build settings - Default build settings are configured based on your framework, ensuring optimal performance. - Adjust the settings here if needed. + Default build settings are configured based on your framework, ensuring optimal performance. Adjust + the settings here if needed. {@const adapterData = adapterDataList.find( (adapterData) => adapterData.framework === frameworkKey.toLowerCase() diff --git a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateRuntimeSettings.svelte b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateRuntimeSettings.svelte index 3f7ceccc2..aa817cd82 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateRuntimeSettings.svelte +++ b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateRuntimeSettings.svelte @@ -64,8 +64,8 @@ Runtime settings - Select the runtime for building and serving your site. Version changes apply on redeploy and - can be updated here. + Select the runtime for building and serving your site. Version changes apply on redeploy and can + be updated here.