Skip to content

Commit d987ba0

Browse files
committed
fix: columns and redirects.
1 parent 380d743 commit d987ba0

File tree

3 files changed

+24
-32
lines changed

3 files changed

+24
-32
lines changed

src/routes/(console)/project-[region]-[project]/settings/domains/add-domain/+page.svelte

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,17 @@
5656
await goto(routeBase);
5757
await invalidate(Dependencies.DOMAINS);
5858
} else {
59-
await goto(
60-
`${routeBase}/add-domain/verify-${domainName}?rule=${rule.$id}&domain=${domain.$id}`
61-
);
59+
let redirect = `${routeBase}/add-domain/verify-${domainName}?rule=${rule.$id}`;
60+
61+
if (isCloud) {
62+
/**
63+
* Domains are only on cloud!
64+
* Self-hosted instances have rules.
65+
*/
66+
redirect += `&domain=${domain.$id}`;
67+
}
68+
69+
await goto(redirect);
6270
await invalidate(Dependencies.DOMAINS);
6371
}
6472
} catch (error) {

src/routes/(console)/project-[region]-[project]/settings/domains/store.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
} from '@appwrite.io/pink-svelte';
1616
import DeleteDomainModal from './deleteDomainModal.svelte';
1717
import RetryDomainModal from './retryDomainModal.svelte';
18-
import { columns } from './store';
1918
import { regionalProtocol } from '../../store';
2019
2120
let {
@@ -27,11 +26,21 @@
2726
let showDelete = $state(false);
2827
let showRetry = $state(false);
2928
let selectedDomain: Models.ProxyRule = $state(null);
29+
30+
const columns = [
31+
{
32+
id: 'domain',
33+
title: 'Domain',
34+
type: 'string',
35+
format: 'string',
36+
width: { min: 200, max: 550 }
37+
}
38+
];
3039
</script>
3140

32-
<Table.Root columns={[...$columns, { id: 'actions', width: 40 }]} let:root>
41+
<Table.Root columns={[...columns, { id: 'actions', width: 40 }]} let:root>
3342
<svelte:fragment slot="header" let:root>
34-
{#each $columns as { id, title }}
43+
{#each columns as { id, title }}
3544
<Table.Header.Cell column={id} {root}>
3645
{title}
3746
</Table.Header.Cell>
@@ -40,7 +49,7 @@
4049
</svelte:fragment>
4150
{#each domains.rules as domain}
4251
<Table.Row.Base {root}>
43-
{#each $columns as column}
52+
{#each columns as column}
4453
<Table.Cell column={column.id} {root}>
4554
{#if column.id === 'domain'}
4655
<Layout.Stack direction="row" gap="xs">

0 commit comments

Comments
 (0)