diff --git a/package.json b/package.json index 5ef4d9022..ac4be61d3 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,9 @@ "dependencies": { "@appwrite.io/console": "https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@74f9464", "@appwrite.io/pink-icons": "0.25.0", - "@appwrite.io/pink-icons-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@bcb8ad2b", + "@appwrite.io/pink-icons-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@64948b6 ", "@appwrite.io/pink-legacy": "^1.0.3", - "@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@5a02879", + "@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@64948b6 ", "@popperjs/core": "^2.11.8", "@sentry/sveltekit": "^8.38.0", "@stripe/stripe-js": "^3.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2553fe448..2f37e4783 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,14 +15,14 @@ importers: specifier: 0.25.0 version: 0.25.0 '@appwrite.io/pink-icons-svelte': - specifier: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@bcb8ad2b - version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@bcb8ad2b(svelte@4.2.19) + specifier: 'https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@64948b6 ' + version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@64948b6(svelte@4.2.19) '@appwrite.io/pink-legacy': specifier: ^1.0.3 version: 1.0.3 '@appwrite.io/pink-svelte': - specifier: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@5a02879 - version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@5a02879(react-dom@18.3.1(react@18.3.1))(svelte@4.2.19) + specifier: 'https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@64948b6 ' + version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@64948b6(react-dom@18.3.1(react@18.3.1))(svelte@4.2.19) '@popperjs/core': specifier: ^2.11.8 version: 2.11.8 @@ -215,14 +215,14 @@ packages: resolution: {tarball: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@74f9464} version: 1.2.1 - '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@5a02879249b98cec27dcc3cfa27bd8b20a50b47a': - resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@5a02879249b98cec27dcc3cfa27bd8b20a50b47a} + '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@64948b6': + resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@64948b6} version: 1.0.0-next.7 peerDependencies: svelte: ^4.0.0 - '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@bcb8ad2b': - resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@bcb8ad2b} + '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@64948b6b72fb39c9bac60b63a603942291765189': + resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@64948b6b72fb39c9bac60b63a603942291765189} version: 1.0.0-next.7 peerDependencies: svelte: ^4.0.0 @@ -236,8 +236,8 @@ packages: '@appwrite.io/pink-legacy@1.0.3': resolution: {integrity: sha512-GGde5fmPhs+s6/3aFeMPc/kKADG/gTFkYQSy6oBN8pK0y0XNCLrZZgBv+EBbdhwdtqVEWXa0X85Mv9w7jcIlwQ==} - '@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@5a02879': - resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@5a02879} + '@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@64948b6': + resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@64948b6} version: 1.0.0-next.85 peerDependencies: react-dom: ^18.0.0 @@ -4099,11 +4099,11 @@ snapshots: '@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@74f9464': {} - '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@5a02879249b98cec27dcc3cfa27bd8b20a50b47a(svelte@4.2.19)': + '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@64948b6(svelte@4.2.19)': dependencies: svelte: 4.2.19 - '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@bcb8ad2b(svelte@4.2.19)': + '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@64948b6b72fb39c9bac60b63a603942291765189(svelte@4.2.19)': dependencies: svelte: 4.2.19 @@ -4116,9 +4116,9 @@ snapshots: '@appwrite.io/pink-icons': 1.0.0 the-new-css-reset: 1.11.3 - '@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@5a02879(react-dom@18.3.1(react@18.3.1))(svelte@4.2.19)': + '@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@64948b6(react-dom@18.3.1(react@18.3.1))(svelte@4.2.19)': dependencies: - '@appwrite.io/pink-icons-svelte': https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@5a02879249b98cec27dcc3cfa27bd8b20a50b47a(svelte@4.2.19) + '@appwrite.io/pink-icons-svelte': https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@64948b6b72fb39c9bac60b63a603942291765189(svelte@4.2.19) '@floating-ui/dom': 1.6.13 '@melt-ui/pp': 0.3.2(@melt-ui/svelte@0.86.3(svelte@4.2.19))(svelte@4.2.19) '@melt-ui/svelte': 0.86.3(svelte@4.2.19) diff --git a/src/lib/components/billing/planExcess.svelte b/src/lib/components/billing/planExcess.svelte index 485dbe74b..123c7fd02 100644 --- a/src/lib/components/billing/planExcess.svelte +++ b/src/lib/components/billing/planExcess.svelte @@ -60,11 +60,11 @@ - - - Resource - Free limit - + + + Resource + Free limit + Excess usage Metrics are estimates updated every 24 hours @@ -72,37 +72,37 @@ {#if excess?.members} - - Organization members - {plan.members} members - + + Organization members + {plan.members} members +

{excess?.members} members

-
+ {/if} {#if excess?.storage} - - Storage - {plan.storage} GB - + + Storage + {plan.storage} GB +

{humanFileSize(excess?.storage).value} {humanFileSize(excess?.storage).unit}

-
+ {/if} {#if excess?.executions} - - Function executions - + + Function executions + {abbreviateNumber(plan.executions)} executions - +

-
+ {/if} {#if excess?.users} - - Users - + + Users + {abbreviateNumber(plan.users)} users - +

@@ -129,7 +129,7 @@

-
+ {/if}
{/if} diff --git a/src/lib/components/billing/usageRates.svelte b/src/lib/components/billing/usageRates.svelte index c3e67be8e..e835284c2 100644 --- a/src/lib/components/billing/usageRates.svelte +++ b/src/lib/components/billing/usageRates.svelte @@ -62,42 +62,40 @@ following rates. Next billing period: {toLocaleDate(nextDate)}. {/if} - - - Resource - Limit - {#if !isFree} - Rate - {/if} + + + Resource + Limit + Rate {#each planData as usage} {#if usage['id'] === 'members'} - - {usage.resource} - + + {usage.resource} + {plan[usage.id] || 'Unlimited'} - {#if !isFree} - - {formatCurrency(plan.addons?.member?.price)}/{usage?.unit} - - {/if} - + + {formatCurrency(plan.addons?.member?.price)}/{usage?.unit} + + {:else} {@const addon = plan.addons[usage.id]} - - {usage.resource} - + + {usage.resource} + {abbreviateNumber(plan[usage.id])}{usage?.unit} {#if !isFree} - + {formatCurrency(addon?.price)}/{['MB', 'GB', 'TB'].includes(addon?.unit) ? addon?.value : abbreviateNumber(addon?.value, 0)}{usage?.unit} {/if} - + {/if} {/each} diff --git a/src/lib/components/creditCardInfo.svelte b/src/lib/components/creditCardInfo.svelte index ff19679a8..7ab6ced30 100644 --- a/src/lib/components/creditCardInfo.svelte +++ b/src/lib/components/creditCardInfo.svelte @@ -2,12 +2,14 @@ import type { PaymentMethodData } from '$lib/sdk/billing'; import { Badge, Layout, Link, Popover, Table } from '@appwrite.io/pink-svelte'; import CreditCardBrandImage from './creditCardBrandImage.svelte'; + import type { RootProp } from '@appwrite.io/pink-svelte/dist/table'; + export let root: RootProp; export let paymentMethod: PaymentMethodData; export let isBackup: boolean = false; - + ending in {paymentMethod?.last4} @@ -16,9 +18,10 @@ {/if} -{paymentMethod?.name} -{paymentMethod?.expiryMonth}/{paymentMethod?.expiryYear} - +{paymentMethod?.name} +{paymentMethod?.expiryMonth}/{paymentMethod?.expiryYear} + {#if paymentMethod?.lastError || paymentMethod?.expired} diff --git a/src/lib/components/filePicker.svelte b/src/lib/components/filePicker.svelte index ec2007f29..091835530 100644 --- a/src/lib/components/filePicker.svelte +++ b/src/lib/components/filePicker.svelte @@ -1,5 +1,5 @@ {#if [...$groups]?.length}
- - - Role + + + Role {#if withCreate} - Create + Create {/if} - Read - Update - Delete - + Read + Update + Delete + {#each [...$groups].sort(sortRoles) as [role, permission] (role)} - - + + - - {#if withCreate} - - togglePermission(role, 'create')} /> - - {/if} - + + togglePermission(role, 'create')} /> + + togglePermission(role, 'read')} /> - + togglePermission(role, 'update')} /> - + togglePermission(role, 'delete')} /> - + - + {/each}
diff --git a/src/lib/components/permissions/roles.svelte b/src/lib/components/permissions/roles.svelte index 83445ec99..23ea58dda 100644 --- a/src/lib/components/permissions/roles.svelte +++ b/src/lib/components/permissions/roles.svelte @@ -78,24 +78,24 @@ {#if [...$groups.keys()]?.length} - - - Role - + + + Role + {#each [...$groups.keys()].sort(sortRoles) as role} - - + + - + - + {/each} . {#if results?.teams?.length} - + {#each results.teams as team (team.$id)} {@const role = `team:${team.$id}`} {@const exists = $groups.has(role)} - onSelection(role)} disabled={exists}> - + onSelection(role)} disabled={exists}> + - + @@ -102,7 +102,7 @@ - + {/each}
diff --git a/src/lib/components/permissions/user.svelte b/src/lib/components/permissions/user.svelte index c31f58d9f..771548e83 100644 --- a/src/lib/components/permissions/user.svelte +++ b/src/lib/components/permissions/user.svelte @@ -77,19 +77,19 @@ Grant access to any authenticated or anonymous user. {#if results?.users?.length} - + {#each results.users as user (user.$id)} {@const role = `user:${user.$id}`} {@const exists = $groups.has(role)} - onSelection(role)} disabled={exists}> - + onSelection(role)} disabled={exists}> + - + {#if user.email || user.phone} {#if user.name} @@ -135,7 +135,7 @@ {/if} - + {/each} diff --git a/src/lib/components/viewSelector.svelte b/src/lib/components/viewSelector.svelte index 04afafc9b..b97808b05 100644 --- a/src/lib/components/viewSelector.svelte +++ b/src/lib/components/viewSelector.svelte @@ -29,7 +29,7 @@ const prefs = preferences.getCustomCollectionColumns($page.params.collection); columns.set( $columns.map((column) => { - column.show = prefs?.includes(column.id) ?? true; + column.hide = prefs?.includes(column.id) ?? false; return column; }) ); @@ -40,7 +40,7 @@ if (prefs?.columns) { columns.set( $columns.map((column) => { - column.show = prefs.columns?.includes(column.id) ?? true; + column.hide = prefs.columns?.includes(column.id) ?? false; return column; }) ); @@ -48,7 +48,7 @@ } columns.subscribe((ctx) => { - const columns = ctx.filter((n) => n.show).map((n) => n.id); + const columns = ctx.filter((n) => n.hide === true).map((n) => n.id); if (isCustomCollection) { preferences.setCustomCollectionColumns(columns); @@ -75,14 +75,11 @@ }); } - $: selectedColumnsNumber = $columns - .filter((c) => !c.hide) - .reduce((acc, column) => { - if (column.show) { - acc++; - } - return acc; - }, 0); + $: selectedColumnsNumber = $columns.reduce((acc, column) => { + if (column.hide === true) return acc; + + return ++acc; + }, 0); {#if !hideColumns && view === View.Table} @@ -98,14 +95,15 @@ - {#each $columns.filter((c) => !c.hide) as column} + {#each $columns as column} (column.hide = !column.hide)} + checked={!column.hide} disabled={allowNoColumns ? false - : selectedColumnsNumber <= 1 && column.show} /> + : selectedColumnsNumber <= 1 && column.hide !== true} /> {/each} diff --git a/src/lib/helpers/types.ts b/src/lib/helpers/types.ts index ad99d94fe..e0ec1c4a9 100644 --- a/src/lib/helpers/types.ts +++ b/src/lib/helpers/types.ts @@ -1,3 +1,4 @@ +import type { Column as PinkColumn } from '@appwrite.io/pink-svelte/dist/table'; import type { Writable } from 'svelte/store'; export type WritableValue = T extends Writable ? U : never; @@ -23,26 +24,13 @@ const columnTypes = [ 'enum' ] as const; export type ColumnType = (typeof columnTypes)[number]; -export type Column = { - id: string; +export type Column = PinkColumn & { title: string; type: ColumnType; - /** - * Set to false to hide by default - */ - show: boolean; - width?: number; - /** - * Set to false to disable filtering for this column - */ filter?: boolean; array?: boolean; format?: string; elements?: string[] | { value: string | number; label: string }[]; - /** - * Set to true to hide this column by default - */ - hide?: boolean; }; export function isValueOfStringEnum>( diff --git a/src/lib/layout/activity.svelte b/src/lib/layout/activity.svelte index 7016f3852..0392bcf8c 100644 --- a/src/lib/layout/activity.svelte +++ b/src/lib/layout/activity.svelte @@ -3,27 +3,36 @@ import { Container } from '$lib/layout'; import { toLocaleDateTime } from '$lib/helpers/date'; import type { Models } from '@appwrite.io/console'; - import { Layout, Table, Card, Empty, Typography } from '@appwrite.io/pink-svelte'; + import { Layout, Table, Card, Empty } from '@appwrite.io/pink-svelte'; import Button from '$lib/elements/forms/button.svelte'; + import type { Column } from '@appwrite.io/pink-svelte/dist/table'; export let logs: Models.LogList; export let offset = 0; export let limit = 0; + + const columns: Column[] = [ + { id: 'user' }, + { id: 'event' }, + { id: 'location' }, + { id: 'ip' }, + { id: 'date' } + ]; {#if logs.total} - - - User - Event - Location - IP - Date + + + User + Event + Location + IP + Date {#each logs.logs as log} - - + + {#if log.userEmail} {#if log.userName} @@ -41,23 +50,23 @@ {/if} - + {log.event} - + {#if log.countryCode !== '--'} {log.countryName} {:else} Unknown {/if} - + {log.ip} - + {toLocaleDateTime(log.time)} - + {/each} diff --git a/src/lib/layout/logs.svelte b/src/lib/layout/logs.svelte index 7927f8aa8..b2c934fc7 100644 --- a/src/lib/layout/logs.svelte +++ b/src/lib/layout/logs.svelte @@ -215,20 +215,20 @@
{#if selectedRequest === 'parameters'} {#if parameters?.length} - - - Name - Value + + + Name + Value {#each parameters as param} - - + + {param.key} - + {param.value} - + {/each} {/if} @@ -249,20 +249,20 @@

{:else if selectedRequest === 'headers'} {#if execution.requestHeaders.length} - - - Name - Value + + + Name + Value {#each execution.requestHeaders as header} - - - {header.key} + + + {header.name} - + {header.value} - + {/each} {/if} @@ -363,20 +363,20 @@ {/if} {:else if selectedResponse === 'headers'} {#if execution.responseHeaders.length} - - - Name - Value + + + Name + Value {#each execution.responseHeaders as header} - - - {header.key} + + + {header.name} - + {header.value} - + {/each} {/if} diff --git a/src/lib/pages/domains/index.svelte b/src/lib/pages/domains/index.svelte index aaa0d85a2..857f60ed8 100644 --- a/src/lib/pages/domains/index.svelte +++ b/src/lib/pages/domains/index.svelte @@ -72,25 +72,30 @@
{/if} {#if rules.total} - - - Name - Verification status - Certificate status - {#if $canWriteRules} - - {/if} + + + Name + Verification status + Certificate status + {#each rules.rules as domain} - - + + {domain.domain} - + {#if domain.status === 'created'} @@ -106,7 +111,7 @@ {/if} - + {#if domain.status === 'unverified'} @@ -133,35 +138,33 @@ {/if} - {#if $canWriteRules} - - - - - {#if domain.status !== 'verified'} - openRetry(domain)}> - {domain.status === 'unverified' - ? 'Retry generation' - : 'Retry verification'} - - {/if} + + + + + {#if domain.status !== 'verified'} { - selectedDomain = domain; - showDelete = true; - }}> - Delete + leadingIcon={IconRefresh} + on:click={() => openRetry(domain)}> + {domain.status === 'unverified' + ? 'Retry generation' + : 'Retry verification'} - - - - {/if} - + {/if} + { + selectedDomain = domain; + showDelete = true; + }}> + Delete + + +
+
+ {/each}
{:else} diff --git a/src/lib/pages/domains/wizard/cnameTable.svelte b/src/lib/pages/domains/wizard/cnameTable.svelte index 760f084e3..af17eb3f5 100644 --- a/src/lib/pages/domains/wizard/cnameTable.svelte +++ b/src/lib/pages/domains/wizard/cnameTable.svelte @@ -12,25 +12,27 @@ $: cnameValue = domain.domain.replace('.' + registerable, ''); - - - Type - Name - Value - + + + Type + Name + Value + - - CNAME - {cnameValue} - + + CNAME + {cnameValue} + {target} - + - + diff --git a/src/routes/(console)/account/identities.svelte b/src/routes/(console)/account/identities.svelte index ec537e0e3..f1fde7592 100644 --- a/src/routes/(console)/account/identities.svelte +++ b/src/routes/(console)/account/identities.svelte @@ -45,18 +45,26 @@ it here." /> {:else} - - - Provider - Email - Created At - Expiry Date - + + + Provider + Email + Created At + Expiry Date + {#each $identities as identity (identity.$id)} {@const provider = oAuthProviders[identity.provider]} - - + +
- + {identity.providerEmail} - + {toLocaleDateTime(identity.$createdAt)} - + {toLocaleDateTime(identity.providerAccessTokenExpiry)} - - - + {/each} {/if} diff --git a/src/routes/(console)/account/mfaRecoveryCodes.svelte b/src/routes/(console)/account/mfaRecoveryCodes.svelte index 9b8b69320..c5b46ae28 100644 --- a/src/routes/(console)/account/mfaRecoveryCodes.svelte +++ b/src/routes/(console)/account/mfaRecoveryCodes.svelte @@ -37,18 +37,18 @@ - + {#each codes.recoveryCodes as code} - - + + {code} - + - + {/each} {/if} diff --git a/src/routes/(console)/account/payments/billingAddress.svelte b/src/routes/(console)/account/payments/billingAddress.svelte index d3129ce7c..04e3d6399 100644 --- a/src/routes/(console)/account/payments/billingAddress.svelte +++ b/src/routes/(console)/account/payments/billingAddress.svelte @@ -48,7 +48,9 @@ View or update your billing address. This address will be included in your invoices from Appwrite. {#if $addressList.total && countryList?.total} - + {#each $addressList.billingAddresses as address} {@const country = countryList?.countries?.find( (c) => c.code === address.country @@ -57,8 +59,8 @@ (org) => address.$id === org.billingAddressId )} - - + + {address.streetAddress}, {#if address?.addressLine2} {address.addressLine2}, @@ -72,7 +74,7 @@ {/if} {country ? country.name : address.country} - + {#if linkedOrgs?.length > 0} @@ -98,7 +100,7 @@ {/if} - + - - - Client - Location - IP - + + + Client + Location + IP + {#each data.sessions.sessions as session} {@const browser = getBrowser(session.clientCode)} - - + + {#if session.clientName}
@@ -131,18 +138,20 @@ {/if} - + {#if session.countryCode !== '--'} {session.countryName} {:else} Unknown {/if} - {session.ip} - + + {session.ip} + + - + {/each} diff --git a/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte b/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte index d73cb337f..4f65f92b5 100644 --- a/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte +++ b/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte @@ -114,22 +114,22 @@ {/if}
{#if creditList?.total} - - - Code - Total - Remaining - Expires at + + + Code + Total + Remaining + Expires at {#each creditList.credits as credit} - - + + {credit?.couponId ?? '-'} - + {formatCurrency(credit.total)} - + {#if credit.status === 'expired'} - + {#if credit.status === 'expired'} @@ -152,7 +152,7 @@ {toLocaleDate(credit.expiration)} {/if} - +
{/each}
{#if creditList?.total > limit} diff --git a/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte b/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte index d8844aca2..48e0c8bfc 100644 --- a/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte +++ b/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte @@ -118,13 +118,13 @@ {/if} {#if alerts.length} - + {#each alerts.sort() as alert} - - + + {alert}% - + - +
{/each}
{/if} diff --git a/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte b/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte index bd1a2a419..9600c2dca 100644 --- a/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte +++ b/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte @@ -69,20 +69,27 @@ Transaction history for this organization. Download invoices for more details about your payments. {#if invoiceList.total > 0} - - - Due date - Status - Amount due - + + + Due date + Status + Amount due + {#each invoiceList?.invoices as invoice} {@const status = invoice.status} - - + + {toLocaleDate(invoice.dueAt)} - + {@const isDanger = status === 'overdue' || status === 'failed' || @@ -115,10 +122,10 @@ {/if} - + {formatCurrency(invoice.grossAmount)} - + diff --git a/src/routes/(console)/project-[project]/auth/teams/+page.svelte b/src/routes/(console)/project-[project]/auth/teams/+page.svelte index 22d69bd1b..865f64e07 100644 --- a/src/routes/(console)/project-[project]/auth/teams/+page.svelte +++ b/src/routes/(console)/project-[project]/auth/teams/+page.svelte @@ -46,27 +46,29 @@ {#if data.teams.total} - - - Name - Members - Created + + + Name + Members + Created {#each data.teams.teams as team} - - + + {team.name} - + {team.total} members - + {toLocaleDateTime(team.$createdAt)} - + {/each} diff --git a/src/routes/(console)/project-[project]/auth/teams/team-[team]/members/+page.svelte b/src/routes/(console)/project-[project]/auth/teams/team-[team]/members/+page.svelte index d55231b0c..3bf5506b4 100644 --- a/src/routes/(console)/project-[project]/auth/teams/team-[team]/members/+page.svelte +++ b/src/routes/(console)/project-[project]/auth/teams/team-[team]/members/+page.svelte @@ -37,29 +37,38 @@ {#if data.memberships.total} - - - Name - Roles - Joined - + + + Name + Roles + Joined + {#each data.memberships.memberships as membership} {@const username = membership.userName ? membership.userName : '-'} - - + + {username} - + {membership.roles} - + {toLocaleDateTime(membership.joined)} - + - + {/each} diff --git a/src/routes/(console)/project-[project]/auth/user-[user]/identities/+page.svelte b/src/routes/(console)/project-[project]/auth/user-[user]/identities/+page.svelte index 075274e0f..943f255eb 100644 --- a/src/routes/(console)/project-[project]/auth/user-[user]/identities/+page.svelte +++ b/src/routes/(console)/project-[project]/auth/user-[user]/identities/+page.svelte @@ -14,19 +14,18 @@ export let data: PageData; const columns = writable([ - { id: '$id', title: 'Identity ID', type: 'string', show: true, width: 140 }, - { id: 'provider', title: 'Provider', type: 'string', show: true, width: 80 }, - { id: 'providerUid', title: 'Provider UID', type: 'string', show: false, width: 80 }, - { id: 'providerEmail', title: 'Email', type: 'string', show: true, width: 80 }, + { id: '$id', title: 'Identity ID', type: 'string', width: 140 }, + { id: 'provider', title: 'Provider', type: 'string', width: 80 }, + { id: 'providerUid', title: 'Provider UID', type: 'string', hide: true, width: 80 }, + { id: 'providerEmail', title: 'Email', type: 'string', width: 80 }, { id: 'providerAccessTokenExpiry', title: 'Expiry Date', type: 'datetime', - show: true, width: 60 }, - { id: '$createdAt', title: 'Created', type: 'datetime', show: true, width: 80 }, - { id: '$updatedAt', title: 'Updated', type: 'datetime', show: false, width: 80 } + { id: '$createdAt', title: 'Created', type: 'datetime', width: 80 }, + { id: '$updatedAt', title: 'Updated', type: 'datetime', hide: true, width: 80 } ]); diff --git a/src/routes/(console)/project-[project]/auth/user-[user]/identities/table.svelte b/src/routes/(console)/project-[project]/auth/user-[user]/identities/table.svelte index b9c99a203..54545e868 100644 --- a/src/routes/(console)/project-[project]/auth/user-[user]/identities/table.svelte +++ b/src/routes/(console)/project-[project]/auth/user-[user]/identities/table.svelte @@ -50,62 +50,47 @@ } - - - - {#each columns as column} - {#if column.show} - {column.title} - {/if} + + + {#each columns as { id, title }} + {title} {/each} {#each data.identities.identities as identity (identity.$id)} - - - - - + {#each columns as column} - {#if column.show} + {#if column.id === '$id'} {#key columns} - - - {identity[column.id]} - - + + {identity[column.id]} + {/key} {:else if column.id === 'provider'} {@const provider = oAuthProviders[identity[column.id]]} - -
-
- {provider.name} -
- {provider.name} +
+
+ {provider.name}
- + {provider.name} +
{:else if column.type === 'datetime'} - - {#if !identity[column.id]} - - - {:else} - {toLocaleDateTime(identity[column.id])} - {/if} - + {#if !identity[column.id]} + - + {:else} + {toLocaleDateTime(identity[column.id])} + {/if} {:else} - - {identity[column.id]} - + {identity[column.id]} {/if} - {/if} + {/each} - + {/each} diff --git a/src/routes/(console)/project-[project]/auth/user-[user]/memberships/+page.svelte b/src/routes/(console)/project-[project]/auth/user-[user]/memberships/+page.svelte index eb00ac8cc..a957a5a44 100644 --- a/src/routes/(console)/project-[project]/auth/user-[user]/memberships/+page.svelte +++ b/src/routes/(console)/project-[project]/auth/user-[user]/memberships/+page.svelte @@ -21,29 +21,37 @@ {#if data.memberships.total} - - - Name - Roles - Joined - + + + Name + Roles + Joined + {#each data.memberships.memberships as membership} - - + {membership.teamName ? membership.teamName : 'n/a'} - + {membership.roles} - + {toLocaleDateTime(membership.joined)} - + - + {/each} {:else} diff --git a/src/routes/(console)/project-[project]/auth/user-[user]/sessions/+page.svelte b/src/routes/(console)/project-[project]/auth/user-[user]/sessions/+page.svelte index 501d98717..1eff45b33 100644 --- a/src/routes/(console)/project-[project]/auth/user-[user]/sessions/+page.svelte +++ b/src/routes/(console)/project-[project]/auth/user-[user]/sessions/+page.svelte @@ -29,17 +29,24 @@ Delete All - - - Client - Location - IP - + + + Client + Location + IP + {#each data.sessions.sessions as session} {@const browser = getBrowser(session.clientCode)} - - + + {#if session.clientName}
@@ -69,15 +76,17 @@ - + {#if session.countryCode !== '--'} {session.countryName} {:else} Unknown {/if} - {session.ip} - + + {session.ip} + + - + {/each} {:else} diff --git a/src/routes/(console)/project-[project]/auth/user-[user]/targets/store.ts b/src/routes/(console)/project-[project]/auth/user-[user]/targets/store.ts index d3b900a72..93ce3abe7 100644 --- a/src/routes/(console)/project-[project]/auth/user-[user]/targets/store.ts +++ b/src/routes/(console)/project-[project]/auth/user-[user]/targets/store.ts @@ -2,9 +2,9 @@ import type { Column } from '$lib/helpers/types'; import { writable } from 'svelte/store'; export const columns = writable([ - { id: '$id', title: 'Target ID', type: 'string', show: true, width: 140 }, - { id: 'target', title: 'Target', type: 'string', show: true, filter: false, width: 140 }, - { id: 'providerType', title: 'Type', type: 'string', show: true, filter: true, width: 80 }, - { id: 'provider', title: 'Provider', type: 'string', show: true, filter: false, width: 80 }, - { id: '$createdAt', title: 'Created', type: 'datetime', show: true, width: 100 } + { id: '$id', title: 'Target ID', type: 'string', width: { min: 140 } }, + { id: 'target', title: 'Target', type: 'string', filter: false, width: { min: 140 } }, + { id: 'providerType', title: 'Type', type: 'string', filter: true, width: { min: 80 } }, + { id: 'provider', title: 'Provider', type: 'string', filter: false, width: { min: 80 } }, + { id: '$createdAt', title: 'Created', type: 'datetime', width: { min: 100 } } ]); diff --git a/src/routes/(console)/project-[project]/auth/user-[user]/targets/table.svelte b/src/routes/(console)/project-[project]/auth/user-[user]/targets/table.svelte index 4fee0f9ce..50ef1b83e 100644 --- a/src/routes/(console)/project-[project]/auth/user-[user]/targets/table.svelte +++ b/src/routes/(console)/project-[project]/auth/user-[user]/targets/table.svelte @@ -52,62 +52,43 @@ } - - - - {#each $columns as column} - {#if column.show} - {column.title} - {/if} + + + {#each $columns as { id, title }} + {title} {/each} {#each data.targets.targets as target (target.$id)} {@const provider = data.providersById[target.providerId]} - - - - - + {#each $columns as column} - {#if column.show} + {#if column.id === '$id'} {#key $columns} - - - {target[column.id]} - - + + {target[column.id]} + {/key} {:else if column.id === 'target'} - - {#if target.providerType === MessagingProviderType.Push} - {target.name} - {:else} - {target.identifier} - {/if} - + {#if target.providerType === MessagingProviderType.Push} + {target.name} + {:else} + {target.identifier} + {/if} {:else if column.id === 'providerType'} - - - + {:else if column.id === 'provider'} - - {#if provider} - - {/if} - + {#if provider} + + {/if} {:else if column.id === '$createdAt'} - - {toLocaleDateTime(target[column.id])} - + {toLocaleDateTime(target[column.id])} {:else} - - {target[column.id]} - + {target[column.id]} {/if} - {/if} + {/each} - + {/each} diff --git a/src/routes/(console)/project-[project]/auth/user-[user]/updateMfa.svelte b/src/routes/(console)/project-[project]/auth/user-[user]/updateMfa.svelte index 14b0c4577..d453a10e1 100644 --- a/src/routes/(console)/project-[project]/auth/user-[user]/updateMfa.svelte +++ b/src/routes/(console)/project-[project]/auth/user-[user]/updateMfa.svelte @@ -49,14 +49,14 @@ label="Multi-factor authentication" bind:value={userMfa} /> {#if $userFactors.totp} - - - Authenticator - + + + Authenticator + - - TOTP (One-time code) - + + TOTP (One-time code) + - + {:else} diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/[[page]]/store.ts b/src/routes/(console)/project-[project]/databases/database-[database]/[[page]]/store.ts index 58d166cd2..634f31f4b 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/[[page]]/store.ts +++ b/src/routes/(console)/project-[project]/databases/database-[database]/[[page]]/store.ts @@ -2,8 +2,8 @@ import type { Column } from '$lib/helpers/types'; import { writable } from 'svelte/store'; export const columns = writable([ - { id: '$id', title: 'Database ID', type: 'string', show: true, width: 150 }, - { id: 'name', title: 'Name', type: 'string', show: true, width: 120 }, - { id: '$createdAt', title: 'Created', type: 'string', show: true, width: 120 }, - { id: '$updatedAt', title: 'Updated', type: 'string', show: true, width: 120 } + { id: '$id', title: 'Database ID', type: 'string', width: 150 }, + { id: 'name', title: 'Name', type: 'string', width: 120 }, + { id: '$createdAt', title: 'Created', type: 'string', width: 120 }, + { id: '$updatedAt', title: 'Updated', type: 'string', width: 120 } ]); diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte index 5840c4a72..e2c1576c3 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte @@ -80,17 +80,24 @@ {#if $attributes.length} - - - Key - Type - Default value - + + + Key + Type + Default value + {#each $attributes as attribute, index} {@const option = attributeOptions.find((option) => option.type === attribute.type)} - - + + {#if isRelationship(attribute)} - + {#if 'format' in attribute && attribute.format} {attribute.format} {:else} @@ -142,12 +149,12 @@ {attribute.array ? '[]' : ''} - + {attribute?.default !== null && attribute?.default !== undefined ? attribute?.default : '-'} - + + @@ -115,8 +100,8 @@ onSubmit={handleDelete} closable={!deleting}>

- Are you sure you want to delete {selected.length} - {selected.length > 1 ? 'collections' : 'collection'}? + Are you sure you want to delete {selectedRows.length} + {selectedRows.length > 1 ? 'collections' : 'collection'}?

diff --git a/src/routes/(console)/project-[project]/databases/store.ts b/src/routes/(console)/project-[project]/databases/store.ts index a931b52c6..0b385ff29 100644 --- a/src/routes/(console)/project-[project]/databases/store.ts +++ b/src/routes/(console)/project-[project]/databases/store.ts @@ -5,16 +5,16 @@ import { writable } from 'svelte/store'; export const columns = writable( isCloud ? [ - { id: '$id', title: 'Database ID', type: 'string', show: true, width: 150 }, - { id: 'name', title: 'Name', type: 'string', show: true, width: 120 }, - { id: 'backup', title: 'Backups', type: 'string', show: true, width: 120 }, - { id: '$createdAt', title: 'Created', type: 'datetime', show: true, width: 120 }, - { id: '$updatedAt', title: 'Updated', type: 'datetime', show: true, width: 120 } + { id: '$id', title: 'Database ID', type: 'string', width: 150 }, + { id: 'name', title: 'Name', type: 'string', width: { min: 120 } }, + { id: 'backup', title: 'Backups', type: 'string', width: { min: 120 } }, + { id: '$createdAt', title: 'Created', type: 'datetime', width: { min: 120 } }, + { id: '$updatedAt', title: 'Updated', type: 'datetime', width: { min: 120 } } ] : [ - { id: '$id', title: 'Database ID', type: 'string', show: true, width: 150 }, - { id: 'name', title: 'Name', type: 'string', show: true, width: 120 }, - { id: '$createdAt', title: 'Created', type: 'datetime', show: true, width: 120 }, - { id: '$updatedAt', title: 'Updated', type: 'datetime', show: true, width: 120 } + { id: '$id', title: 'Database ID', type: 'string', width: 150 }, + { id: 'name', title: 'Name', type: 'string', width: { min: 120 } }, + { id: '$createdAt', title: 'Created', type: 'datetime', width: { min: 120 } }, + { id: '$updatedAt', title: 'Updated', type: 'datetime', width: { min: 120 } } ] ); diff --git a/src/routes/(console)/project-[project]/databases/table.svelte b/src/routes/(console)/project-[project]/databases/table.svelte index 908830c8c..fdf299d05 100644 --- a/src/routes/(console)/project-[project]/databases/table.svelte +++ b/src/routes/(console)/project-[project]/databases/table.svelte @@ -20,30 +20,26 @@ } - - - {#each $columns as column} - {#if column.show} - {column.title} - {/if} + + + {#each $columns as { id, title }} + {title} {/each} {#each data.databases.databases as database (database.$id)} - + {#each $columns as column} - {#if column.show} + {#if column.id === '$id'} {#key $columns} - - - {database.$id} - - + + {database.$id} + {/key} {:else if column.id === 'name'} - - {database.name} - + {database.name} {:else if column.id === 'backup'} {@const policies = data.policies?.[database.$id] ?? null} {@const lastBackup = data.lastBackups?.[database.$id] ?? null} @@ -51,31 +47,21 @@ ?.map((policy) => getPolicyDescription(policy.schedule)) .join(', ')} - - - - {#if !policies} - No backup policies - {:else} - {description} - {/if} - - {`Last backup: ${lastBackup}`} - - + + + {#if !policies} + No backup policies + {:else} + {description} + {/if} + + {`Last backup: ${lastBackup}`} + {:else} - - {toLocaleDateTime(database[column.id])} - + {toLocaleDateTime(database[column.id])} {/if} - {/if} + {/each} - + {/each} - - diff --git a/src/routes/(console)/project-[project]/functions/function-[function]/domains/+page.svelte b/src/routes/(console)/project-[project]/functions/function-[function]/domains/+page.svelte index 49dc87dab..fdf27a5f1 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/domains/+page.svelte +++ b/src/routes/(console)/project-[project]/functions/function-[function]/domains/+page.svelte @@ -67,16 +67,23 @@ {#if data.domains.total} - - - Domain - Redirect to - Production branch - + + + Domain + Redirect to + Production branch + {#each data.domains.rules as domain} - - + + {domain.domain} @@ -84,60 +91,58 @@ - + {domain?.redirectUrl || 'No redirect'} {domain?.redirectStatusCode ? `(${domain.redirectStatusCode})` : ''} - + {domain.deploymentVcsProviderBranch || '-'} - - - - + + + - - - {#if domain.status !== 'verified'} - { - e.preventDefault(); - selectedDomain = domain; - showRetry = true; - toggle(e); - }}> - Retry - - {/if} + + + {#if domain.status !== 'verified'} { e.preventDefault(); selectedDomain = domain; - showDelete = true; + showRetry = true; toggle(e); - trackEvent(Click.DomainDeleteClick, { - source: 'functions_domain_overview' - }); }}> - Delete + Retry - - - - + {/if} + { + e.preventDefault(); + selectedDomain = domain; + showDelete = true; + toggle(e); + trackEvent(Click.DomainDeleteClick, { + source: 'functions_domain_overview' + }); + }}> + Delete + + + +
- + {/each} diff --git a/src/routes/(console)/project-[project]/functions/function-[function]/domains/add-domain/verify/+page.svelte b/src/routes/(console)/project-[project]/functions/function-[function]/domains/add-domain/verify/+page.svelte index 88289f579..1c90b2e00 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/domains/add-domain/verify/+page.svelte +++ b/src/routes/(console)/project-[project]/functions/function-[function]/domains/add-domain/verify/+page.svelte @@ -94,23 +94,23 @@ - - - Type - Name - Value + + + Type + Name + Value - - CNAME - {data.domain?.domain} - + + CNAME + {data.domain?.domain} + {globalThis?.location?.origin} - + @@ -145,19 +145,19 @@ - - - Type - Value + + + Type + Value {#each nameservers as nameserver} - - NS - + + NS + {nameserver} - + {/each}
{#if variable.secret} @@ -220,7 +230,7 @@ {/if}
- +
- + {/each} diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/store.ts b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/store.ts index 166b666dd..069767687 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/store.ts +++ b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/store.ts @@ -9,7 +9,6 @@ export const columns = writable([ id: 'status', title: 'Status', type: 'enum', - show: true, width: 110, array: true, format: 'enum', @@ -20,7 +19,6 @@ export const columns = writable([ id: 'buildDuration', title: 'Build duration', type: 'integer', - show: true, width: 90, elements: [ { @@ -42,7 +40,7 @@ export const columns = writable([ id: 'sourceSize', title: 'Source size', type: 'integer', - show: false, + hide: true, width: 140, elements: [ { @@ -63,7 +61,6 @@ export const columns = writable([ id: 'buildSize', title: 'Build size', type: 'integer', - show: true, filter: false, width: 80 }, @@ -71,7 +68,6 @@ export const columns = writable([ id: 'type', title: 'Source', type: 'string', - show: true, width: 90, array: true, format: 'enum', @@ -85,7 +81,6 @@ export const columns = writable([ id: '$updatedAt', title: 'Updated', type: 'datetime', - show: true, width: 150, format: 'datetime' } diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/table.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/table.svelte index 43ee52e75..505614071 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/table.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/table.svelte @@ -28,69 +28,54 @@ let selectedDeployment: Models.Deployment = null; - - - {#each $columns as column} - {#if column.show} - - {column.title} - - {/if} + + + {#each $columns as { id, title }} + + {title} + {/each} - + {#each data.deploymentList.deployments as deployment} - {#each $columns as column} - {#if column.show} + {#if column.id === '$id'} {#key column.id} - - {deployment.$id} - + {deployment.$id} {/key} {:else if column.id === 'status'} - - {@const status = deployment.status} - {#if data?.activeDeployment?.$id === deployment?.$id} - - {:else} - - {/if} - + {@const status = deployment.status} + {#if data?.activeDeployment?.$id === deployment?.$id} + + {:else} + + {/if} {:else if column.id === 'type'} - - - + {:else if column.id === '$updatedAt'} - - - + {:else if column.id === 'buildDuration'} - - {#if ['waiting'].includes(deployment.status)} - - - {:else if ['processing', 'building'].includes(deployment.status)} - - {:else} - {formatTimeDetailed(deployment.buildDuration)} - {/if} - + {#if ['waiting'].includes(deployment.status)} + - + {:else if ['processing', 'building'].includes(deployment.status)} + + {:else} + {formatTimeDetailed(deployment.buildDuration)} + {/if} {:else if column.id === 'sourceSize'} - - {calculateSize(deployment.sourceSize)} - + {calculateSize(deployment.sourceSize)} {:else if column.id === 'buildSize'} - - {calculateSize(deployment.buildSize)} - + {calculateSize(deployment.buildSize)} {/if} - {/if} + {/each} - + - + {/each} diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/deploymentsOverview.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/deploymentsOverview.svelte index adc1585a2..331ea6f54 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/deploymentsOverview.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/deploymentsOverview.svelte @@ -43,21 +43,22 @@ {#if deploymentList?.total} - - - Deployment ID - Status - Source - Updated - + + + Deployment ID + Status + Source + Updated + {#each deploymentList?.deployments as deployment} - - + {deployment.$id} - + {@const status = deployment.status} {#if activeDeployment?.$id === deployment?.$id} @@ -68,13 +69,13 @@ {/if} - + - + - + - + {/each} {:else} diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.svelte index ca266002f..c3522f682 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.svelte @@ -69,16 +69,16 @@ {#if data.domains.total} - - - Domain - Redirect to - Production branch - + + + Domain + Redirect to + Production branch + {#each data.domains.rules as domain} - - + + {domain.domain} @@ -87,14 +87,14 @@ - + {domain?.redirectUrl || 'No redirect'} {domain?.redirectStatusCode ? `(${domain.redirectStatusCode})` : ''} - + {domain.deploymentVcsProviderBranch || '-'} - +