{#if $page.data?.header} From 98502a85c5cd8c90d0c8fab9b0674ded3c0bfe85 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 2 Jun 2025 08:19:57 +0200 Subject: [PATCH 167/225] Update to route.id --- src/lib/layout/shell.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/layout/shell.svelte b/src/lib/layout/shell.svelte index be7c289f4..9544d0555 100644 --- a/src/lib/layout/shell.svelte +++ b/src/lib/layout/shell.svelte @@ -113,7 +113,7 @@ $: state = $isSidebarOpen ? 'open' : 'closed'; let isProjectPage; - $: isProjectPage = $page.url.pathname.includes('project-'); + $: isProjectPage = $page.route.id.includes('project-'); function handleResize() { $isSidebarOpen = false; From 44701389bce673a93973d59766c723fb40636e06 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 2 Jun 2025 08:26:14 +0200 Subject: [PATCH 168/225] Nullable --- src/lib/layout/shell.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/layout/shell.svelte b/src/lib/layout/shell.svelte index 9544d0555..012670367 100644 --- a/src/lib/layout/shell.svelte +++ b/src/lib/layout/shell.svelte @@ -113,7 +113,7 @@ $: state = $isSidebarOpen ? 'open' : 'closed'; let isProjectPage; - $: isProjectPage = $page.route.id.includes('project-'); + $: isProjectPage = $page.route?.id.includes('project-'); function handleResize() { $isSidebarOpen = false; From 7646605d8987eb2f1757d9d2fd83e900d2d94e01 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 2 Jun 2025 10:29:24 +0200 Subject: [PATCH 169/225] Nullable --- src/lib/layout/shell.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/layout/shell.svelte b/src/lib/layout/shell.svelte index 012670367..9c6b2ec1e 100644 --- a/src/lib/layout/shell.svelte +++ b/src/lib/layout/shell.svelte @@ -113,7 +113,7 @@ $: state = $isSidebarOpen ? 'open' : 'closed'; let isProjectPage; - $: isProjectPage = $page.route?.id.includes('project-'); + $: isProjectPage = $page.route?.id?.includes('project-'); function handleResize() { $isSidebarOpen = false; From 727a6f3ac9c5256f7d27eb035a8b495eb3e0bb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Jun 2025 13:13:02 +0200 Subject: [PATCH 170/225] Fix missing rules (redirect); remove double protocol; improve placeholders for dns records; fix www subdomain rules --- src/lib/helpers/tlds.ts | 1 - .../domain-[domain]/createRecordModal.svelte | 16 +++++++++++++++- .../domain-[domain]/updateRecordModal.svelte | 17 ++++++++++++++++- .../domains/add-domain/+page.svelte | 2 +- .../sites/site-[site]/domains/+page.ts | 15 ++++++++++----- .../site-[site]/domains/add-domain/+page.svelte | 2 +- 6 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/lib/helpers/tlds.ts b/src/lib/helpers/tlds.ts index 23adffb4c..6de3c3888 100644 --- a/src/lib/helpers/tlds.ts +++ b/src/lib/helpers/tlds.ts @@ -15,7 +15,6 @@ export function isASubdomain(domain: string | null): boolean { const { domain: apex, subdomain } = parse(domain); if (!apex) return false; - if (subdomain === 'www') return false; return !!subdomain; } diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte index 644732c58..e1f1205d6 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte @@ -30,6 +30,20 @@ let weight: number; let port: number; + const placeholders: Record = { + 'A': '76.75.21.21', + 'AAAA': '2001:0db8:85a3:0000:0000:8a2e:0370:7334', + 'CNAME': 'stage.example.com', + 'MX': 'mail.example.com', + 'TXT': 'v=spf1 include:_spf.example.com ~all', + 'NS': 'ns1.example.com', + 'SRV': '10 5 8080 example.com', + 'CAA': '0 issue "letsencrypt.org"', + 'HTTPS': 'https://example.com', + 'ALIAS': 'www.example.com' + }; + $: placeholder = placeholders[type] ?? 'Enter value'; + async function handleSubmit() { const record = { name, @@ -77,7 +91,7 @@ - + diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte index 9155339ca..0102fb376 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte @@ -19,12 +19,27 @@ import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; import type { Models } from '@appwrite.io/console'; + import type { RecordType } from '$lib/stores/domains'; export let show = false; export let selectedRecord: Models.DnsRecord; let record = deepClone(selectedRecord); let error = ''; + + const placeholders: Record = { + 'A': '76.75.21.21', + 'AAAA': '2001:0db8:85a3:0000:0000:8a2e:0370:7334', + 'CNAME': 'stage.example.com', + 'MX': 'mail.example.com', + 'TXT': 'v=spf1 include:_spf.example.com ~all', + 'NS': 'ns1.example.com', + 'SRV': '10 5 8080 example.com', + 'CAA': '0 issue "letsencrypt.org"', + 'HTTPS': 'https://example.com', + 'ALIAS': 'www.example.com' + }; + $: placeholder = placeholders[record.type] ?? 'Enter value'; async function handleSubmit() { try { @@ -173,7 +188,7 @@ - + diff --git a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte index 2c931b0a9..a303f4477 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte @@ -72,7 +72,7 @@ } else if (behaviour === 'REDIRECT') { rule = await sdk .forProject(page.params.region, page.params.project) - .proxy.createRedirectRule(domainName, $regionalProtocol + redirect, statusCode); + .proxy.createRedirectRule(domainName, redirect, statusCode); } else if (behaviour === 'ACTIVE') { rule = await sdk .forProject(page.params.region, page.params.project) diff --git a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts index 88ec63f09..126e1ced7 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts +++ b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts @@ -27,12 +27,17 @@ export const load = async ({ params, depends, url, route }) => { .proxy.listRules( [ Query.or([ - Query.equal('type', RuleType.DEPLOYMENT), - Query.equal('type', RuleType.REDIRECT) + Query.and([ + Query.equal('type', RuleType.REDIRECT), + Query.equal('trigger', RuleTrigger.MANUAL), + ]), + Query.and([ + Query.equal('type', RuleType.DEPLOYMENT), + Query.equal('trigger', RuleTrigger.MANUAL), + Query.equal('deploymentResourceType', DeploymentResourceType.SITE), + Query.equal('deploymentResourceId', params.site), + ]), ]), - Query.equal('deploymentResourceType', DeploymentResourceType.SITE), - Query.equal('deploymentResourceId', params.site), - Query.equal('trigger', RuleTrigger.MANUAL), Query.limit(limit), Query.offset(offset), Query.orderDesc(''), diff --git a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte index 0bb99fee4..cc1a89b99 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte @@ -76,7 +76,7 @@ } else if (behaviour === 'REDIRECT') { rule = await sdk .forProject(page.params.region, page.params.project) - .proxy.createRedirectRule(domainName, $regionalProtocol + redirect, statusCode); + .proxy.createRedirectRule(domainName, redirect, statusCode); } else if (behaviour === 'ACTIVE') { rule = await sdk .forProject(page.params.region, page.params.project) From 277f96b0b7a6f8d4f5f861615ec145553faa9132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Jun 2025 13:13:18 +0200 Subject: [PATCH 171/225] Formatting fix --- .../domain-[domain]/createRecordModal.svelte | 22 ++++++++--------- .../domain-[domain]/updateRecordModal.svelte | 24 +++++++++---------- .../sites/site-[site]/domains/+page.ts | 14 +++++------ 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte index e1f1205d6..14f0adc61 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte @@ -31,16 +31,16 @@ let port: number; const placeholders: Record = { - 'A': '76.75.21.21', - 'AAAA': '2001:0db8:85a3:0000:0000:8a2e:0370:7334', - 'CNAME': 'stage.example.com', - 'MX': 'mail.example.com', - 'TXT': 'v=spf1 include:_spf.example.com ~all', - 'NS': 'ns1.example.com', - 'SRV': '10 5 8080 example.com', - 'CAA': '0 issue "letsencrypt.org"', - 'HTTPS': 'https://example.com', - 'ALIAS': 'www.example.com' + A: '76.75.21.21', + AAAA: '2001:0db8:85a3:0000:0000:8a2e:0370:7334', + CNAME: 'stage.example.com', + MX: 'mail.example.com', + TXT: 'v=spf1 include:_spf.example.com ~all', + NS: 'ns1.example.com', + SRV: '10 5 8080 example.com', + CAA: '0 issue "letsencrypt.org"', + HTTPS: 'https://example.com', + ALIAS: 'www.example.com' }; $: placeholder = placeholders[type] ?? 'Enter value'; @@ -91,7 +91,7 @@ - + diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte index 0102fb376..c72ca86bd 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte @@ -26,18 +26,18 @@ let record = deepClone(selectedRecord); let error = ''; - + const placeholders: Record = { - 'A': '76.75.21.21', - 'AAAA': '2001:0db8:85a3:0000:0000:8a2e:0370:7334', - 'CNAME': 'stage.example.com', - 'MX': 'mail.example.com', - 'TXT': 'v=spf1 include:_spf.example.com ~all', - 'NS': 'ns1.example.com', - 'SRV': '10 5 8080 example.com', - 'CAA': '0 issue "letsencrypt.org"', - 'HTTPS': 'https://example.com', - 'ALIAS': 'www.example.com' + A: '76.75.21.21', + AAAA: '2001:0db8:85a3:0000:0000:8a2e:0370:7334', + CNAME: 'stage.example.com', + MX: 'mail.example.com', + TXT: 'v=spf1 include:_spf.example.com ~all', + NS: 'ns1.example.com', + SRV: '10 5 8080 example.com', + CAA: '0 issue "letsencrypt.org"', + HTTPS: 'https://example.com', + ALIAS: 'www.example.com' }; $: placeholder = placeholders[record.type] ?? 'Enter value'; @@ -188,7 +188,7 @@ - + diff --git a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts index 126e1ced7..ebe497444 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts +++ b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts @@ -28,15 +28,15 @@ export const load = async ({ params, depends, url, route }) => { [ Query.or([ Query.and([ - Query.equal('type', RuleType.REDIRECT), - Query.equal('trigger', RuleTrigger.MANUAL), + Query.equal('type', RuleType.REDIRECT), + Query.equal('trigger', RuleTrigger.MANUAL) ]), Query.and([ - Query.equal('type', RuleType.DEPLOYMENT), - Query.equal('trigger', RuleTrigger.MANUAL), - Query.equal('deploymentResourceType', DeploymentResourceType.SITE), - Query.equal('deploymentResourceId', params.site), - ]), + Query.equal('type', RuleType.DEPLOYMENT), + Query.equal('trigger', RuleTrigger.MANUAL), + Query.equal('deploymentResourceType', DeploymentResourceType.SITE), + Query.equal('deploymentResourceId', params.site) + ]) ]), Query.limit(limit), Query.offset(offset), From a1d1045e87c6d0b7ffe64af02f55beaef76c47d1 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 2 Jun 2025 13:26:38 +0200 Subject: [PATCH 172/225] Only untrack when no installation is set --- src/lib/components/git/repositories.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/components/git/repositories.svelte b/src/lib/components/git/repositories.svelte index c1c3eefca..a9b94904f 100644 --- a/src/lib/components/git/repositories.svelte +++ b/src/lib/components/git/repositories.svelte @@ -49,7 +49,9 @@ async function loadInstallations() { if (installationList) { if (installationList.installations.length) { - untrack(() => (selectedInstallation = installationList.installations[0].$id)); + if (!selectedInstallation) { + untrack(() => (selectedInstallation = installationList.installations[0].$id)); + } installation.set( installationList.installations.find( (entry) => entry.$id === selectedInstallation @@ -62,7 +64,9 @@ .forProject(page.params.region, page.params.project) .vcs.listInstallations(); if (installations.length) { - untrack(() => (selectedInstallation = installations[0].$id)); + if (!selectedInstallation) { + untrack(() => (selectedInstallation = installationList.installations[0].$id)); + } installation.set(installations.find((entry) => entry.$id === selectedInstallation)); } return installations; From 14d21912ad8edffc87522486470c3f1c438c4339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Jun 2025 13:40:17 +0200 Subject: [PATCH 173/225] Fix SRV record update; fix priority input; fix linter --- src/lib/helpers/domains.ts | 99 ++++++++++++++++ .../domain-[domain]/updateRecordModal.svelte | 108 +----------------- .../domains/add-domain/+page.svelte | 2 +- .../domains/add-domain/+page.svelte | 2 +- 4 files changed, 103 insertions(+), 108 deletions(-) diff --git a/src/lib/helpers/domains.ts b/src/lib/helpers/domains.ts index 7d11aa59d..d8a65c745 100644 --- a/src/lib/helpers/domains.ts +++ b/src/lib/helpers/domains.ts @@ -90,6 +90,105 @@ export async function createRecord(record: Partial, domainId: } } +export async function updateRecord(record: Partial, domainId: string) { + switch (record.type) { + case 'A': + return await sdk.forConsole.domains.updateRecordA( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'AAAA': + return await sdk.forConsole.domains.updateRecordAAAA( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'CNAME': + return await sdk.forConsole.domains.updateRecordCNAME( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'MX': + return await sdk.forConsole.domains.updateRecordMX( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.priority, + record.comment + ); + case 'TXT': + return await sdk.forConsole.domains.updateRecordTXT( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'NS': + return await sdk.forConsole.domains.updateRecordNS( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'SRV': + return await sdk.forConsole.domains.updateRecordSRV( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.priority, + record.weight, + record.port, + record?.comment || undefined + ); + case 'CAA': + return await sdk.forConsole.domains.updateRecordCAA( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'HTTPS': + return await sdk.forConsole.domains.updateRecordHTTPS( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'ALIAS': + return await sdk.forConsole.domains.updateRecordAlias( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + } +} + export type ParsedRecords = { A: Partial[]; AAAA: Partial[]; diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte index c72ca86bd..d46e31aa3 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte @@ -20,6 +20,7 @@ import { Dependencies } from '$lib/constants'; import type { Models } from '@appwrite.io/console'; import type { RecordType } from '$lib/stores/domains'; + import { updateRecord } from '$lib/helpers/domains'; export let show = false; export let selectedRecord: Models.DnsRecord; @@ -43,112 +44,7 @@ async function handleSubmit() { try { - switch (record.type) { - case 'A': - await sdk.forConsole.domains.updateRecordA( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - case 'AAAA': - await sdk.forConsole.domains.updateRecordAAAA( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - case 'CNAME': - await sdk.forConsole.domains.updateRecordCNAME( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - case 'MX': - await sdk.forConsole.domains.updateRecordMX( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.priority, - record.comment - ); - - break; - case 'TXT': - await sdk.forConsole.domains.updateRecordTXT( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - case 'NS': - await sdk.forConsole.domains.updateRecordNS( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - - case 'CAA': - await sdk.forConsole.domains.updateRecordCAA( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - case 'HTTPS': - await sdk.forConsole.domains.updateRecordHTTPS( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - case 'ALIAS': - await sdk.forConsole.domains.updateRecordAlias( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - - default: - break; - } + await updateRecord(record, page.params.domain); show = false; invalidate(Dependencies.DOMAINS); addNotification({ diff --git a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte index a303f4477..3af8bb2e4 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte @@ -18,7 +18,7 @@ import { ConnectRepoModal } from '$lib/components/git/index.js'; import { isValueOfStringEnum } from '$lib/helpers/types.js'; import { isCloud } from '$lib/system'; - import { project, regionalProtocol } from '$routes/(console)/project-[region]-[project]/store'; + import { project } from '$routes/(console)/project-[region]-[project]/store'; import { getApexDomain } from '$lib/helpers/tlds'; const routeBase = `${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/domains`; diff --git a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte index cc1a89b99..ea8388747 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte @@ -22,7 +22,7 @@ import { writable } from 'svelte/store'; import { onMount } from 'svelte'; import { ConnectRepoModal } from '$lib/components/git/index.js'; - import { project, regionalProtocol } from '$routes/(console)/project-[region]-[project]/store'; + import { project } from '$routes/(console)/project-[region]-[project]/store'; import { isCloud } from '$lib/system'; import { getApexDomain } from '$lib/helpers/tlds'; From 4947a84f19cb9dfb69c49ee8983405f6e243dba1 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 2 Jun 2025 13:40:21 +0200 Subject: [PATCH 174/225] Fix responsiveness --- src/lib/components/git/repositories.svelte | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/lib/components/git/repositories.svelte b/src/lib/components/git/repositories.svelte index a9b94904f..1688d5f87 100644 --- a/src/lib/components/git/repositories.svelte +++ b/src/lib/components/git/repositories.svelte @@ -5,6 +5,7 @@ import { sdk } from '$lib/stores/sdk'; import { repositories } from '$routes/(console)/project-[region]-[project]/functions/function-[function]/store'; import { installation, installations, repository } from '$lib/stores/vcs'; + import { isSmallViewport } from '$lib/stores/viewport'; import { Layout, Table, @@ -137,7 +138,7 @@ {:then installations} - + + alignItems="center" + justifyContent="space-between"> @@ -249,27 +251,25 @@ icon={IconLockClosed} color="--fgcolor-neutral-tertiary" /> {/if} - - - {#if action === 'button'} - + {#if !$isSmallViewport} + + {/if} + {#if action === 'button'} connect(repo)}> Connect - - {/if} + {/if} + From 12b0fc9247e8d38c8b080317cf1d00b2093a0e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Jun 2025 14:27:14 +0200 Subject: [PATCH 175/225] linter fix --- .../domains/domain-[domain]/updateRecordModal.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte index d46e31aa3..379bac0ba 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte @@ -13,7 +13,6 @@ import { Submit, trackError, trackEvent } from '$lib/actions/analytics'; import { symmetricDifference } from '$lib/helpers/array'; import { deepClone } from '$lib/helpers/object'; - import { sdk } from '$lib/stores/sdk'; import { page } from '$app/state'; import { recordTypes } from './store'; import { invalidate } from '$app/navigation'; From c2d727efe30f4417260c99ec49b4f4b92c9fa100 Mon Sep 17 00:00:00 2001 From: Darshan Date: Mon, 2 Jun 2025 19:51:53 +0530 Subject: [PATCH 176/225] remove: sites waitlist; fix: domains table. --- src/lib/helpers/waitlist.ts | 30 -- .../domains/domain-[domain]/store.ts | 2 +- .../domains/domain-[domain]/table.svelte | 24 +- .../domain-[domain]/updateRecordModal.svelte | 31 +- .../(images)/empty-sites-dark-mobile.svg | 119 ------- .../sites/(images)/empty-sites-dark.svg | 239 ------------- .../(images)/empty-sites-light-mobile.svg | 157 --------- .../sites/(images)/empty-sites-light.svg | 321 ------------------ .../sites/+page.svelte | 151 ++------ 9 files changed, 72 insertions(+), 1002 deletions(-) delete mode 100644 src/lib/helpers/waitlist.ts delete mode 100644 src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark-mobile.svg delete mode 100644 src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark.svg delete mode 100644 src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light-mobile.svg delete mode 100644 src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light.svg diff --git a/src/lib/helpers/waitlist.ts b/src/lib/helpers/waitlist.ts deleted file mode 100644 index 773b04a24..000000000 --- a/src/lib/helpers/waitlist.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { get } from 'svelte/store'; -import { user } from '$lib/stores/user'; -import { sdk } from '$lib/stores/sdk'; -const userPreferences = () => get(user)?.prefs; - -export const joinWaitlistSites = () => { - const prefs = userPreferences(); - const newPrefs = { - ...prefs, - joinWaitlistSites: true - }; - - sdk.forConsole.account.updatePrefs(newPrefs); - - if (sessionStorage) { - sessionStorage.setItem('joinWaitlistSites', 'true'); - } -}; - -export const isOnWaitlistSites = (): boolean => { - const prefs = userPreferences(); - const joinedInPrefs = 'joinWaitlistSites' in prefs; - - let joinedInSession = false; - if (sessionStorage) { - joinedInSession = sessionStorage.getItem('joinWaitlistSites') === 'true'; - } - - return joinedInSession || joinedInPrefs; -}; diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts index b3a5d2b2c..a8c38a8b9 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts @@ -5,7 +5,7 @@ import { derived, writable } from 'svelte/store'; export const domain = derived(page, ($page) => $page.data.domain as Models.Domain); export const columns = writable([ - { id: 'name', title: 'Name', type: 'string', width: { min: 150 } }, + { id: 'name', title: 'Name', type: 'string', width: { min: 200 } }, { id: 'type', title: 'Type', type: 'string', width: 125 }, { id: 'value', title: 'Value', type: 'string', width: 250 }, { id: 'ttl', title: 'TTL', type: 'integer', width: 100 }, diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte index 4b8c1e958..f25e433d7 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte @@ -29,6 +29,15 @@ let showEdit = false; let showDelete = false; let selectedRecord: Models.DnsRecord = null; + + function formatRecordName(name: string) { + const limit = 30; + return { + value: name.length > limit ? `${name.slice(0, limit)}...` : name, + truncated: name.length > limit, + whole: name + }; + } @@ -47,9 +56,16 @@ {#each $columns as column} {#if column.id === 'name'} - - {record.name} - + {@const formatted = formatRecordName(record.name)} + + {formatted.value} + + {formatted.whole} + + {:else if column.id === 'type'} {record.type} @@ -70,7 +86,7 @@ {:else if column.id === 'priority'} - {record?.priority ?? '-'} + {record?.priority || '-'} {:else if column.id === 'comment'} diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte index 379bac0ba..c22d18a00 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte @@ -63,6 +63,9 @@ $: isDisabled = !symmetricDifference(Object.values(record), Object.values(selectedRecord)) ?.length; + + $: showPriority = + record.name.toLocaleLowerCase() === 'mx' || record.name.toLocaleLowerCase() === 'srv'; @@ -101,19 +104,21 @@ - - - - - Sets the priority for this DNS record. Lower numbers indicate higher - priority (e.g., 10 is higher than 20). - - - + {#if showPriority} + + + + + Sets the priority for this DNS record. Lower numbers indicate higher + priority (e.g., 10 is higher than 20). + + + + {/if} - -
- - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark.svg b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark.svg deleted file mode 100644 index b64811a48..000000000 --- a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark.svg +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light-mobile.svg b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light-mobile.svg deleted file mode 100644 index 8bd4b239e..000000000 --- a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light-mobile.svg +++ /dev/null @@ -1,157 +0,0 @@ - - -
- - - - -
-
- - - - -
-
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light.svg b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light.svg deleted file mode 100644 index a0314acfc..000000000 --- a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light.svg +++ /dev/null @@ -1,321 +0,0 @@ - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/routes/(console)/project-[region]-[project]/sites/+page.svelte b/src/routes/(console)/project-[region]-[project]/sites/+page.svelte index a933b669f..be8278543 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/sites/+page.svelte @@ -11,14 +11,12 @@ import { isServiceLimited } from '$lib/stores/billing'; import { organization } from '$lib/stores/organization'; import { canWriteSites } from '$lib/stores/roles.js'; - import { Card, Icon, Layout, Typography } from '@appwrite.io/pink-svelte'; + import { Icon, Layout } from '@appwrite.io/pink-svelte'; import { Button } from '$lib/elements/forms'; import { app } from '$lib/stores/app'; import CreateSiteModal from './createSiteModal.svelte'; import EmptyLight from './(images)/empty-sites-light.svg'; import EmptyDark from './(images)/empty-sites-dark.svg'; - import EmptyLightMobile from './(images)/empty-sites-light-mobile.svg'; - import EmptyDarkMobile from './(images)/empty-sites-dark-mobile.svg'; import Grid from './grid.svelte'; import { IconPlus } from '@appwrite.io/pink-icons-svelte'; import { columns } from './store'; @@ -28,15 +26,10 @@ import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; import { sdk } from '$lib/stores/sdk'; - import { APPWRITE_OFFICIALS_ORG, isCloud } from '$lib/system'; - import { addNotification } from '$lib/stores/notifications'; - import { isOnWaitlistSites, joinWaitlistSites } from '$lib/helpers/waitlist'; - import { isSmallViewport } from '$lib/stores/viewport'; export let data; let show = false; - let isOnWaitlist = isOnWaitlistSites(); $: $registerCommands([ { @@ -46,7 +39,6 @@ }, keys: ['c'], disabled: - !showSites || isServiceLimited('sites', $organization?.billingPlan, data.siteList?.total) || !$canWriteSites, icon: IconPlus, @@ -63,123 +55,46 @@ } }); }); - - /** - * Controls visibility of Sites feature: - * - Shown if running on self-hosted - * - Shown on cloud only if the organization is Appwrite's. - * - Hidden on cloud for any non-Appwrite organization. - */ - $: showSites = !isCloud || $organization.$id === APPWRITE_OFFICIALS_ORG; - - $: isDark = $app.themeInUse === 'dark'; - - $: imgSrc = isDark - ? $isSmallViewport - ? EmptyDarkMobile - : EmptyDark - : $isSmallViewport - ? EmptyLightMobile - : EmptyLight; - - $: imgClass = $isSmallViewport ? 'mobile' : 'desktop'; - - function addToWaitlist() { - joinWaitlistSites(); - addNotification({ - type: 'success', - title: 'Waitlist joined', - message: "We'll let you know as soon as Appwrite Sites is ready for you." - }); - - isOnWaitlist = true; - } - {#if showSites} - - - - - - - {#if $canWriteSites} - - {/if} - + + + - {#if data.siteList.total} - {#if data.view === View.Grid} - - {:else} -