diff --git a/src/lib/components/billing/planSelection.svelte b/src/lib/components/billing/planSelection.svelte index 6c2103187..a4a290367 100644 --- a/src/lib/components/billing/planSelection.svelte +++ b/src/lib/components/billing/planSelection.svelte @@ -7,8 +7,8 @@ import { LabelCard } from '..'; export let billingPlan: Tier; - export let anyOrgFree = false; export let isNewOrg = false; + export let anyOrgFree = false; export let selfService = true; $: freePlan = $plansInfo.get(BillingPlan.FREE); @@ -22,12 +22,9 @@ + title={tierFree.name}> {#if $organization?.billingPlan === BillingPlan.FREE && !isNewOrg} diff --git a/src/routes/(console)/account/sessions/+page.svelte b/src/routes/(console)/account/sessions/+page.svelte index de2dfae5e..eb0c51de4 100644 --- a/src/routes/(console)/account/sessions/+page.svelte +++ b/src/routes/(console)/account/sessions/+page.svelte @@ -13,7 +13,8 @@ import type { PageData } from './$types'; import { addNotification } from '$lib/stores/notifications'; import { onMount } from 'svelte'; - import { Badge, Layout, Table, Typography } from '@appwrite.io/pink-svelte'; + import { Badge, Layout, Table, Typography, Icon } from '@appwrite.io/pink-svelte'; + import { IconGlobeAlt } from '@appwrite.io/pink-icons-svelte'; export let data: PageData; @@ -92,9 +93,9 @@ let:root columns={[ { id: 'client' }, - { id: 'location', width: 120 }, - { id: 'ip', width: 120 }, - { id: 'actions', width: 70 } + { id: 'location', width: 200 }, + { id: 'ip', width: 200 }, + { id: 'actions', width: 100 } ]}> Client @@ -114,13 +115,9 @@ height="20" width="20" src={getBrowser(session.clientCode).toString()} - style="--p-text-size: 1.25rem" alt={session.clientName} /> {:else} - + {/if} diff --git a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte index e0bc8eb0c..682bf7bd8 100644 --- a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte +++ b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte @@ -150,8 +150,7 @@ await goto(previousPage); addNotification({ type: 'success', - isHtml: true, - message: `${$organization.name} plan has been successfully updated.` + message: `${$organization.name} plan has been successfully updated.` }); trackEvent(Submit.OrganizationDowngrade, { @@ -264,7 +263,9 @@ $: isUpgrade = $plansInfo.get(selectedPlan).order > $currentPlan?.order; $: isDowngrade = $plansInfo.get(selectedPlan).order < $currentPlan?.order; - $: isButtonDisabled = $organization?.billingPlan === selectedPlan; + $: isButtonDisabled = + $organization?.billingPlan === selectedPlan || + (isDowngrade && selectedPlan === BillingPlan.FREE && data.hasFreeOrgs); @@ -297,8 +298,21 @@ selfService={data.selfService} anyOrgFree={data.hasFreeOrgs} /> + {#if isDowngrade && selectedPlan === BillingPlan.FREE && data.hasFreeOrgs} + + To downgrade this organization, first migrate or delete one of your + existing paid organizations. + + + {/if} + {#if isDowngrade} - {#if selectedPlan === BillingPlan.FREE} + {#if selectedPlan === BillingPlan.FREE && !data.hasFreeOrgs} {:else if selectedPlan === BillingPlan.PRO && data.organization.billingPlan === BillingPlan.SCALE && collaborators?.length > 0} {@const extraMembers = collaborators?.length ?? 0} @@ -364,7 +378,7 @@ id="members" /> {/if} - {#if isDowngrade && selectedPlan === BillingPlan.FREE} + {#if isDowngrade && selectedPlan === BillingPlan.FREE && !data.hasFreeOrgs}
{:else if data.organization.billingPlan !== BillingPlan.CUSTOM} - + {/if} diff --git a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/sessions/+page.svelte b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/sessions/+page.svelte index 081b27097..b7def9138 100644 --- a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/sessions/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/sessions/+page.svelte @@ -1,18 +1,10 @@ - + + Sessions {#if data.sessions.total} - + {/if} - + + {#if data.sessions.total} - - - Browser and device - Session - Location - IP - - - - {#each data.sessions.sessions as session} - {@const browser = getBrowser(session.clientCode)} - - -
-
- {#if browser} - {session.clientName} - {:else} - - {/if} -
-

- {session.clientName} - {session.clientVersion} on {session.osName} - {session.osVersion} -

- {#if session.current} - + + + Client + Location + IP + + + {#each data.sessions.sessions as session} + {@const browser = getBrowser(session.clientCode)} + + + +
+ {#if browser} + {session.clientName} + {:else} + {/if}
- - - {session.clientType} - {session.countryName} - {session.ip} - - - - - {/each} - - + + {session.clientName} + {session.clientVersion} on {session.osName} + {session.osVersion} + + {#if session.current} + + {/if} +
+
+ + {#if session.countryCode !== '--'} + {session.countryName} + {:else} + Unknown + {/if} + + + {session.ip} + + + + +
+ {/each} +
{:else}