mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge branch 'main' into dat-534-string-encryption
This commit is contained in:
+2
-1
@@ -27,7 +27,7 @@
|
||||
"@appwrite.io/pink-icons": "0.25.0",
|
||||
"@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1",
|
||||
"@appwrite.io/pink-legacy": "^1.0.3",
|
||||
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@67c988c",
|
||||
"@appwrite.io/pink-svelte": "https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-svelte@510c1a7",
|
||||
"@popperjs/core": "^2.11.8",
|
||||
"@sentry/sveltekit": "^8.38.0",
|
||||
"@stripe/stripe-js": "^3.5.0",
|
||||
@@ -79,6 +79,7 @@
|
||||
"svelte-check": "^4.1.5",
|
||||
"svelte-preprocess": "^6.0.3",
|
||||
"svelte-sequential-preprocessor": "^2.0.2",
|
||||
"tldts": "^7.0.7",
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.8.2",
|
||||
"typescript-eslint": "^8.30.1",
|
||||
|
||||
Generated
+34
-18
@@ -22,13 +22,13 @@ importers:
|
||||
version: 0.25.0
|
||||
'@appwrite.io/pink-icons-svelte':
|
||||
specifier: ^2.0.0-RC.1
|
||||
version: 2.0.0-RC.1(svelte@5.25.3)
|
||||
version: https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-icons-svelte@12707b9(svelte@5.25.3)
|
||||
'@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@67c988c
|
||||
version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@67c988c(svelte@5.25.3)
|
||||
specifier: https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-svelte@510c1a7
|
||||
version: https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-svelte@510c1a7(svelte@5.25.3)
|
||||
'@popperjs/core':
|
||||
specifier: ^2.11.8
|
||||
version: 2.11.8
|
||||
@@ -177,6 +177,9 @@ importers:
|
||||
svelte-sequential-preprocessor:
|
||||
specifier: ^2.0.2
|
||||
version: 2.0.2
|
||||
tldts:
|
||||
specifier: ^7.0.7
|
||||
version: 7.0.7
|
||||
tslib:
|
||||
specifier: ^2.8.1
|
||||
version: 2.8.1
|
||||
@@ -262,8 +265,8 @@ packages:
|
||||
peerDependencies:
|
||||
svelte: ^4.0.0
|
||||
|
||||
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@67c988c04de3464a9c39630fd798e2316d157fea':
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@67c988c04de3464a9c39630fd798e2316d157fea}
|
||||
'@appwrite.io/pink-icons-svelte@https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-icons-svelte@12707b9':
|
||||
resolution: {tarball: https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-icons-svelte@12707b9}
|
||||
version: 2.0.0-RC.1
|
||||
peerDependencies:
|
||||
svelte: ^4.0.0
|
||||
@@ -277,8 +280,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@67c988c':
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@67c988c}
|
||||
'@appwrite.io/pink-svelte@https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-svelte@510c1a7':
|
||||
resolution: {tarball: https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-svelte@510c1a7}
|
||||
version: 2.0.0-RC.2
|
||||
peerDependencies:
|
||||
svelte: ^4.0.0
|
||||
@@ -1339,8 +1342,8 @@ packages:
|
||||
'@types/prop-types@15.7.14':
|
||||
resolution: {integrity: sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==}
|
||||
|
||||
'@types/react@18.3.20':
|
||||
resolution: {integrity: sha512-IPaCZN7PShZK/3t6Q87pfTkRm6oLTd4vztyoj+cbHUF1g3FfVb2tFIL79uCRKEfv16AhqDMBywP2VW3KIZUvcg==}
|
||||
'@types/react@18.3.22':
|
||||
resolution: {integrity: sha512-vUhG0YmQZ7kL/tmKLrD3g5zXbXXreZXB3pmROW8bg3CnLnpjkRVwUlLne7Ufa2r9yJ8+/6B73RzhAek5TBKh2Q==}
|
||||
|
||||
'@types/remarkable@2.0.8':
|
||||
resolution: {integrity: sha512-eKXqPZfpQl1kOADjdKchHrp2gwn9qMnGXhH/AtZe0UrklzhGJkawJo/Y/D0AlWcdWoWamFNIum8+/nkAISQVGg==}
|
||||
@@ -2851,8 +2854,8 @@ packages:
|
||||
resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==}
|
||||
engines: {node: '>=0.4.0'}
|
||||
|
||||
property-information@7.0.0:
|
||||
resolution: {integrity: sha512-7D/qOz/+Y4X/rzSB6jKxKUsQnphO046ei8qxG59mtM3RG3DHgTK81HrxrmoDVINJb8NKT5ZsRbwHvQ6B68Iyhg==}
|
||||
property-information@7.1.0:
|
||||
resolution: {integrity: sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==}
|
||||
|
||||
proxy-from-env@1.1.0:
|
||||
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
|
||||
@@ -3238,10 +3241,17 @@ packages:
|
||||
tldts-core@6.1.85:
|
||||
resolution: {integrity: sha512-DTjUVvxckL1fIoPSb3KE7ISNtkWSawZdpfxGxwiIrZoO6EbHVDXXUIlIuWympPaeS+BLGyggozX/HTMsRAdsoA==}
|
||||
|
||||
tldts-core@7.0.7:
|
||||
resolution: {integrity: sha512-ECqb8imSroX1UmUuhRBNPkkmtZ8mHEenieim80UVxG0M5wXVjY2Fp2tYXCPvk+nLy1geOhFpeD5YQhM/gF63Jg==}
|
||||
|
||||
tldts@6.1.85:
|
||||
resolution: {integrity: sha512-gBdZ1RjCSevRPFix/hpaUWeak2/RNUZB4/8frF1r5uYMHjFptkiT0JXIebWvgI/0ZHXvxaUDDJshiA0j6GdL3w==}
|
||||
hasBin: true
|
||||
|
||||
tldts@7.0.7:
|
||||
resolution: {integrity: sha512-ETNXj36ql5BXDa4VVJk3wgqansg8TI1Yqo217twSAPjyDnh/b2T+XzrI0ftn6EnzVPbXpMTZHOWj5s3a8/uGPA==}
|
||||
hasBin: true
|
||||
|
||||
to-regex-range@5.0.1:
|
||||
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
|
||||
engines: {node: '>=8.0'}
|
||||
@@ -3620,7 +3630,7 @@ snapshots:
|
||||
dependencies:
|
||||
svelte: 5.25.3
|
||||
|
||||
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@67c988c04de3464a9c39630fd798e2316d157fea(svelte@5.25.3)':
|
||||
'@appwrite.io/pink-icons-svelte@https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-icons-svelte@12707b9(svelte@5.25.3)':
|
||||
dependencies:
|
||||
svelte: 5.25.3
|
||||
|
||||
@@ -3633,9 +3643,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@67c988c(svelte@5.25.3)':
|
||||
'@appwrite.io/pink-svelte@https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-svelte@510c1a7(svelte@5.25.3)':
|
||||
dependencies:
|
||||
'@appwrite.io/pink-icons-svelte': https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@67c988c04de3464a9c39630fd798e2316d157fea(svelte@5.25.3)
|
||||
'@appwrite.io/pink-icons-svelte': 2.0.0-RC.1(svelte@5.25.3)
|
||||
'@floating-ui/dom': 1.6.13
|
||||
'@melt-ui/pp': 0.3.2(@melt-ui/svelte@0.86.6(svelte@5.25.3))(svelte@5.25.3)
|
||||
'@melt-ui/svelte': 0.86.6(svelte@5.25.3)
|
||||
@@ -4776,7 +4786,7 @@ snapshots:
|
||||
|
||||
'@types/prop-types@15.7.14': {}
|
||||
|
||||
'@types/react@18.3.20':
|
||||
'@types/react@18.3.22':
|
||||
dependencies:
|
||||
'@types/prop-types': 15.7.14
|
||||
csstype: 3.1.3
|
||||
@@ -5878,7 +5888,7 @@ snapshots:
|
||||
hast-util-whitespace: 3.0.0
|
||||
html-void-elements: 3.0.0
|
||||
mdast-util-to-hast: 13.2.0
|
||||
property-information: 7.0.0
|
||||
property-information: 7.1.0
|
||||
space-separated-tokens: 2.0.2
|
||||
stringify-entities: 4.0.4
|
||||
zwitch: 2.0.4
|
||||
@@ -6411,7 +6421,7 @@ snapshots:
|
||||
|
||||
progress@2.0.3: {}
|
||||
|
||||
property-information@7.0.0: {}
|
||||
property-information@7.1.0: {}
|
||||
|
||||
proxy-from-env@1.1.0: {}
|
||||
|
||||
@@ -6724,7 +6734,7 @@ snapshots:
|
||||
|
||||
svelte-motion@0.12.2(svelte@5.25.3):
|
||||
dependencies:
|
||||
'@types/react': 18.3.20
|
||||
'@types/react': 18.3.22
|
||||
framesync: 6.1.2
|
||||
popmotion: 11.0.5
|
||||
style-value-types: 5.1.2
|
||||
@@ -6833,10 +6843,16 @@ snapshots:
|
||||
|
||||
tldts-core@6.1.85: {}
|
||||
|
||||
tldts-core@7.0.7: {}
|
||||
|
||||
tldts@6.1.85:
|
||||
dependencies:
|
||||
tldts-core: 6.1.85
|
||||
|
||||
tldts@7.0.7:
|
||||
dependencies:
|
||||
tldts-core: 7.0.7
|
||||
|
||||
to-regex-range@5.0.1:
|
||||
dependencies:
|
||||
is-number: 7.0.0
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
{domain}
|
||||
</Typography.Text>
|
||||
{#if verified}
|
||||
<Badge variant="secondary" type="success" content="Verified" />
|
||||
<Badge variant="secondary" type="success" size="xs" content="Verified" />
|
||||
{:else if verified === false}
|
||||
<Badge variant="secondary" type="warning" size="xs" content="Pending verification" />
|
||||
{/if}
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
{domain}
|
||||
</Typography.Text>
|
||||
{#if verified}
|
||||
<Badge variant="secondary" type="success" content="Verified" />
|
||||
<Badge variant="secondary" type="success" size="xs" content="Verified" />
|
||||
{:else if verified === false}
|
||||
<Badge variant="secondary" type="error" content="Verification failed" />
|
||||
<Badge variant="secondary" type="error" size="xs" content="Verification failed" />
|
||||
{:else}
|
||||
<Badge
|
||||
variant="secondary"
|
||||
|
||||
@@ -13,11 +13,22 @@
|
||||
} from '@appwrite.io/pink-svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
export let selectedLog: Models.Execution;
|
||||
let {
|
||||
selectedLog,
|
||||
product
|
||||
}: {
|
||||
selectedLog: Models.Execution;
|
||||
product: 'site' | 'function';
|
||||
} = $props();
|
||||
|
||||
let requestTab: 'parameters' | 'headers' = 'parameters';
|
||||
let requestTab: 'parameters' | 'headers' = $state('parameters');
|
||||
|
||||
let parameters = [];
|
||||
let parameters = $state([]);
|
||||
|
||||
const href =
|
||||
product === 'site'
|
||||
? 'https://appwrite.io/docs/products/sites/logs#log-details'
|
||||
: 'https://appwrite.io/docs/products/functions/develop#logging';
|
||||
|
||||
onMount(() => {
|
||||
try {
|
||||
@@ -121,8 +132,8 @@
|
||||
|
||||
<Input.Helper state="default">
|
||||
<span>
|
||||
Missing headers? Check the <Link variant="muted" href="#" external>docs</Link> to
|
||||
see the supported data and how to log it.
|
||||
Missing headers? Check the <Link variant="muted" {href} external>docs</Link> to see
|
||||
the supported data and how to log it.
|
||||
</span>
|
||||
</Input.Helper>
|
||||
{:else}
|
||||
|
||||
@@ -28,11 +28,10 @@
|
||||
|
||||
let responseTab: 'logs' | 'errors' | 'headers' | 'body' = $state('logs');
|
||||
|
||||
let href = $derived(
|
||||
const href =
|
||||
product === 'site'
|
||||
? 'https://appwrite.io/docs/products/sites/logs#log-details'
|
||||
: 'https://appwrite.io/docs/products/functions/develop#logging'
|
||||
);
|
||||
: 'https://appwrite.io/docs/products/functions/develop#logging';
|
||||
|
||||
onMount(() => {
|
||||
if (selectedLog?.errors) {
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
{pattern}
|
||||
on:input
|
||||
on:invalid={handleInvalid}
|
||||
type="email"
|
||||
type="text"
|
||||
helper={error}
|
||||
state={error ? 'error' : 'default'}
|
||||
autofocus={autofocus || undefined}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { parse } from 'tldts';
|
||||
|
||||
/**
|
||||
* Returns the apex/root domain from a full domain string.
|
||||
*/
|
||||
export function getApexDomain(domain: string): string | null {
|
||||
return parse(domain).domain;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given domain is a subdomain.
|
||||
*/
|
||||
export function isASubdomain(domain: string | null): boolean {
|
||||
if (!domain) return false;
|
||||
|
||||
const { domain: apex, subdomain } = parse(domain);
|
||||
if (!apex) return false;
|
||||
if (subdomain === 'www') return false;
|
||||
|
||||
return !!subdomain;
|
||||
}
|
||||
@@ -339,6 +339,8 @@ export type Plan = {
|
||||
emailBranding: boolean;
|
||||
supportsCredits: boolean;
|
||||
databasesAllowEncrypt: boolean;
|
||||
buildSize: number; // in MB
|
||||
deploymentSize: number; // in MB
|
||||
};
|
||||
|
||||
export type PlanList = {
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
import { StatusCode } from '@appwrite.io/console';
|
||||
|
||||
export const statusCodeOptions = [
|
||||
{
|
||||
label: '301 Moved permanently',
|
||||
value: 301
|
||||
value: StatusCode.MovedPermanently301
|
||||
},
|
||||
{
|
||||
label: '302 Found',
|
||||
value: 302
|
||||
},
|
||||
{
|
||||
label: '303 See other',
|
||||
value: 303
|
||||
value: StatusCode.Found302
|
||||
},
|
||||
{
|
||||
label: '307 Temporary redirect',
|
||||
value: 307
|
||||
value: StatusCode.TemporaryRedirect307
|
||||
},
|
||||
{
|
||||
label: '308 Permanent redirect',
|
||||
value: 308
|
||||
value: StatusCode.PermanentRedirect308
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -1,27 +1,31 @@
|
||||
<script lang="ts">
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Confirm } from '$lib/components';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let show = false;
|
||||
export let selectedDomain: Domain;
|
||||
|
||||
let error = '';
|
||||
let domainsList = `${base}/organization-${page.params.organization}/domains`;
|
||||
|
||||
async function deleteDomain() {
|
||||
try {
|
||||
await sdk.forConsole.domains.delete(selectedDomain.$id);
|
||||
await invalidate(Dependencies.DOMAINS);
|
||||
show = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${selectedDomain.domain} has been deleted`
|
||||
});
|
||||
trackEvent(Submit.DomainDelete);
|
||||
await goto(domainsList);
|
||||
await invalidate(Dependencies.DOMAINS);
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.DomainDelete);
|
||||
|
||||
+6
-7
@@ -12,7 +12,6 @@
|
||||
import {
|
||||
Alert,
|
||||
Avatar,
|
||||
Badge,
|
||||
Card,
|
||||
Divider,
|
||||
Icon,
|
||||
@@ -151,12 +150,12 @@
|
||||
<Typography.Text color="--fgcolor-neutral-primary">
|
||||
<Layout.Stack direction="row" gap="xs" alignItems="center">
|
||||
{runtimeDetail?.name}
|
||||
{#if runtimeDetail?.name?.toLowerCase() === 'deno'}
|
||||
<Badge
|
||||
variant="secondary"
|
||||
size="xs"
|
||||
content="New" />
|
||||
{/if}
|
||||
<!--{#if runtimeDetail?.name?.toLowerCase() === 'deno'}-->
|
||||
<!-- <Badge-->
|
||||
<!-- variant="secondary"-->
|
||||
<!-- size="xs"-->
|
||||
<!-- content="New" />-->
|
||||
<!--{/if}-->
|
||||
</Layout.Stack>
|
||||
</Typography.Text>
|
||||
</Layout.Stack>
|
||||
|
||||
+13
-5
@@ -4,14 +4,14 @@
|
||||
import { Repositories } from '$lib/components/git';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Link } from '$lib/elements';
|
||||
import { Button, InputCheckbox, InputSelect } from '$lib/elements/forms';
|
||||
import { Button, InputCheckbox } from '$lib/elements/forms';
|
||||
import { timeFromNow } from '$lib/helpers/date';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { installation, repository, sortBranches } from '$lib/stores/vcs';
|
||||
import { Runtime, VCSDeploymentType, type Models } from '@appwrite.io/console';
|
||||
import { IconGithub } from '@appwrite.io/pink-icons-svelte';
|
||||
import { Icon, Layout, Skeleton, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { Icon, Input, Layout, Skeleton, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { func } from '../store';
|
||||
import { page } from '$app/state';
|
||||
|
||||
@@ -120,6 +120,14 @@
|
||||
error = e.message;
|
||||
}
|
||||
}
|
||||
|
||||
$: if (!show) {
|
||||
error = '';
|
||||
branch = null;
|
||||
commit = null;
|
||||
activate = true;
|
||||
hasRepository = !!$func?.providerRepositoryId;
|
||||
}
|
||||
</script>
|
||||
|
||||
<Modal title="Create Git deployment" bind:show onSubmit={createDeployment} bind:error>
|
||||
@@ -179,13 +187,13 @@
|
||||
</Typography.Caption>
|
||||
</Layout.Stack>
|
||||
</Card>
|
||||
<InputSelect
|
||||
required={true}
|
||||
<Input.ComboBox
|
||||
required
|
||||
id="branch"
|
||||
label="Production branch"
|
||||
placeholder="Select branch"
|
||||
bind:value={branch}
|
||||
isSearchable
|
||||
bind:value={branch}
|
||||
on:select={(event) => {
|
||||
branch = event.detail.value;
|
||||
}}
|
||||
|
||||
+11
-1
@@ -11,12 +11,22 @@
|
||||
import { Icon, Layout, Tooltip, Typography, Upload } from '@appwrite.io/pink-svelte';
|
||||
import { func } from '../store';
|
||||
import { page } from '$app/state';
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
import { currentPlan } from '$lib/stores/organization';
|
||||
import { isCloud } from '$lib/system';
|
||||
|
||||
export let show = false;
|
||||
|
||||
let files: FileList;
|
||||
let error: string = '';
|
||||
|
||||
$: maxSize =
|
||||
isCloud && $currentPlan
|
||||
? $currentPlan?.deploymentSize === 0
|
||||
? 0
|
||||
: $currentPlan?.deploymentSize * 1000000
|
||||
: $consoleVariables._APP_COMPUTE_SIZE_LIMIT; // already in MB
|
||||
|
||||
async function create() {
|
||||
try {
|
||||
await sdk
|
||||
@@ -69,7 +79,7 @@
|
||||
<Upload.Dropzone
|
||||
extensions={['gz', 'tar']}
|
||||
bind:files
|
||||
maxSize={10000000}
|
||||
{maxSize}
|
||||
required
|
||||
on:invalid={handleInvalid}>
|
||||
<Layout.Stack alignItems="center" gap="s">
|
||||
|
||||
+6
-6
@@ -18,7 +18,7 @@
|
||||
|
||||
let showDelete = $state(false);
|
||||
let showRetry = $state(false);
|
||||
let selectedDomain: Models.ProxyRule = null;
|
||||
let selectedProxyRule: Models.ProxyRule = null;
|
||||
</script>
|
||||
|
||||
<Container>
|
||||
@@ -35,14 +35,14 @@
|
||||
Add domain
|
||||
</Button>
|
||||
</Layout.Stack>
|
||||
{#if data.domains.total}
|
||||
<Table domains={data.domains} />
|
||||
{#if data.proxyRules.total}
|
||||
<Table proxyRules={data.proxyRules} />
|
||||
|
||||
<PaginationWithLimit
|
||||
name="Domains"
|
||||
limit={data.limit}
|
||||
offset={data.offset}
|
||||
total={data.domains.total} />
|
||||
total={data.proxyRules.total} />
|
||||
{:else if data?.search}
|
||||
<EmptySearch hidePages bind:search={data.search} target="domains" hidePagination>
|
||||
<svelte:fragment slot="actions">
|
||||
@@ -83,9 +83,9 @@
|
||||
</Container>
|
||||
|
||||
{#if showDelete}
|
||||
<DeleteDomainModal bind:show={showDelete} {selectedDomain} />
|
||||
<DeleteDomainModal bind:show={showDelete} {selectedProxyRule} />
|
||||
{/if}
|
||||
|
||||
{#if showRetry}
|
||||
<RetryDomainModal bind:show={showRetry} {selectedDomain} />
|
||||
<RetryDomainModal bind:show={showRetry} {selectedProxyRule} />
|
||||
{/if}
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ export const load: PageLoad = async ({ depends, params, url, route }) => {
|
||||
limit,
|
||||
query,
|
||||
search,
|
||||
domains: await sdk
|
||||
proxyRules: await sdk
|
||||
.forProject(params.region, params.project)
|
||||
.proxy.listRules(
|
||||
[
|
||||
|
||||
+5
-6
@@ -20,6 +20,7 @@
|
||||
import { isValueOfStringEnum } from '$lib/helpers/types.js';
|
||||
import { isCloud } from '$lib/system';
|
||||
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`;
|
||||
|
||||
@@ -47,14 +48,12 @@
|
||||
});
|
||||
|
||||
async function addDomain() {
|
||||
let domain = data.domains?.domains.find((d) => d.domain === domainName);
|
||||
const apexDomain = getApexDomain(domainName);
|
||||
let domain = data.domains?.domains.find((d) => d.domain === apexDomain);
|
||||
|
||||
if (!domain && isCloud) {
|
||||
if (apexDomain && !domain && isCloud) {
|
||||
try {
|
||||
domain = await sdk.forConsole.domains.create(
|
||||
$project.teamId,
|
||||
domainName.toLocaleLowerCase()
|
||||
);
|
||||
domain = await sdk.forConsole.domains.create($project.teamId, apexDomain);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
+4
-3
@@ -20,6 +20,7 @@
|
||||
import Wizard from '$lib/layout/wizard.svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { writable } from 'svelte/store';
|
||||
import { isASubdomain } from '$lib/helpers/tlds';
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
import NameserverTable from '$lib/components/domains/nameserverTable.svelte';
|
||||
import RecordTable from '$lib/components/domains/recordTable.svelte';
|
||||
@@ -27,7 +28,7 @@
|
||||
let { data } = $props();
|
||||
|
||||
const ruleId = page.url.searchParams.get('rule');
|
||||
let isSubDomain = $derived(page.params.domain?.split('.')?.length >= 3);
|
||||
const isSubDomain = $derived.by(() => isASubdomain(page.params.domain));
|
||||
|
||||
let selectedTab = $state<'cname' | 'nameserver' | 'a' | 'aaaa'>('nameserver');
|
||||
$effect(() => {
|
||||
@@ -126,7 +127,7 @@
|
||||
Nameservers
|
||||
</Tabs.Item.Button>
|
||||
{/if}
|
||||
{#if !!$consoleVariables._APP_DOMAIN_TARGET_A && $consoleVariables._APP_DOMAIN_TARGET_A !== '127.0.0.1'}
|
||||
{#if !isCloud && !!$consoleVariables._APP_DOMAIN_TARGET_A && $consoleVariables._APP_DOMAIN_TARGET_A !== '127.0.0.1'}
|
||||
<Tabs.Item.Button
|
||||
{root}
|
||||
on:click={() => (selectedTab = 'a')}
|
||||
@@ -134,7 +135,7 @@
|
||||
A
|
||||
</Tabs.Item.Button>
|
||||
{/if}
|
||||
{#if !!$consoleVariables._APP_DOMAIN_TARGET_AAAA && $consoleVariables._APP_DOMAIN_TARGET_AAAA !== '::1'}
|
||||
{#if !isCloud && !!$consoleVariables._APP_DOMAIN_TARGET_AAAA && $consoleVariables._APP_DOMAIN_TARGET_AAAA !== '::1'}
|
||||
<Tabs.Item.Button
|
||||
{root}
|
||||
on:click={() => (selectedTab = 'aaaa')}
|
||||
|
||||
+3
-9
@@ -1,23 +1,17 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Dependencies } from '$lib/constants.js';
|
||||
import { isCloud } from '$lib/system';
|
||||
import type { Domain, DomainsList } from '$lib/sdk/domains.js';
|
||||
import { Dependencies } from '$lib/constants.js';
|
||||
import type { DomainsList } from '$lib/sdk/domains.js';
|
||||
|
||||
export const load = async ({ depends, params }) => {
|
||||
export const load = async ({ depends }) => {
|
||||
depends(Dependencies.DOMAINS);
|
||||
|
||||
let domain: Domain;
|
||||
let domainsList: DomainsList;
|
||||
if (isCloud) {
|
||||
domainsList = await sdk.forConsole.domains.list();
|
||||
const domainId = domainsList.domains.find(
|
||||
(domain: Domain) => domain.domain === params.domain
|
||||
).$id;
|
||||
domain = await sdk.forConsole.domains.get(domainId);
|
||||
}
|
||||
|
||||
return {
|
||||
domain,
|
||||
domainsList
|
||||
};
|
||||
};
|
||||
|
||||
+6
-5
@@ -11,15 +11,16 @@
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let show = false;
|
||||
export let selectedDomain: Models.ProxyRule;
|
||||
let confirm = false;
|
||||
export let selectedProxyRule: Models.ProxyRule;
|
||||
|
||||
let error = '';
|
||||
let confirm = false;
|
||||
|
||||
async function deleteDomain() {
|
||||
try {
|
||||
await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.proxy.deleteRule(selectedDomain.$id);
|
||||
.proxy.deleteRule(selectedProxyRule.$id);
|
||||
await invalidate(Dependencies.FUNCTION_DOMAINS);
|
||||
show = false;
|
||||
addNotification({
|
||||
@@ -35,13 +36,13 @@
|
||||
</script>
|
||||
|
||||
<Confirm title="Delete domain" bind:open={show} onSubmit={deleteDomain} bind:error>
|
||||
{#if selectedDomain}
|
||||
{#if selectedProxyRule}
|
||||
<Typography.Text variant="m-400">
|
||||
Are you sure you want to delete this domain? You will no longer be able to execute your
|
||||
function by visiting:
|
||||
</Typography.Text>
|
||||
<Typography.Text variant="m-500">
|
||||
{selectedDomain.domain}
|
||||
{selectedProxyRule.domain}
|
||||
</Typography.Text>
|
||||
{/if}
|
||||
<InputCheckbox
|
||||
|
||||
+3
-4
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { Link } from '$lib/elements';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import { IconInfo } from '@appwrite.io/pink-icons-svelte';
|
||||
import {
|
||||
Badge,
|
||||
@@ -14,7 +13,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
|
||||
export let domain: Domain | Models.ProxyRule;
|
||||
export let proxyRule: Models.ProxyRule;
|
||||
</script>
|
||||
|
||||
<Fieldset legend="Verification">
|
||||
@@ -22,7 +21,7 @@
|
||||
<Layout.Stack gap="xl">
|
||||
<Layout.Stack gap="s">
|
||||
<Layout.Stack gap="s" direction="row" alignItems="center">
|
||||
<Typography.Text variant="l-500">{domain?.domain}</Typography.Text>
|
||||
<Typography.Text variant="l-500">{proxyRule?.domain}</Typography.Text>
|
||||
<Badge variant="secondary" type="warning" content="Pending verification" />
|
||||
</Layout.Stack>
|
||||
<Typography.Text variant="m-400">
|
||||
@@ -39,7 +38,7 @@
|
||||
</svelte:fragment>
|
||||
<Table.Row.Base {root}>
|
||||
<Table.Cell {root}>CNAME</Table.Cell>
|
||||
<Table.Cell {root}>{domain?.domain}</Table.Cell>
|
||||
<Table.Cell {root}>{proxyRule?.domain}</Table.Cell>
|
||||
<Table.Cell {root}>
|
||||
<InteractiveText
|
||||
variant="copy"
|
||||
|
||||
+7
-8
@@ -7,24 +7,23 @@
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import RecordsCard from './recordsCard.svelte';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let show = false;
|
||||
export let selectedDomain: Domain | Models.ProxyRule;
|
||||
export let selectedProxyRule: Models.ProxyRule;
|
||||
|
||||
let error = null;
|
||||
async function retryDomain() {
|
||||
async function retryProxyRule() {
|
||||
try {
|
||||
await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.proxy.updateRuleVerification(selectedDomain.$id);
|
||||
.proxy.updateRuleVerification(selectedProxyRule.$id);
|
||||
await invalidate(Dependencies.SITES_DOMAINS);
|
||||
show = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${selectedDomain.domain} has been verified`
|
||||
message: `${selectedProxyRule.domain} has been verified`
|
||||
});
|
||||
trackEvent(Submit.DomainUpdateVerification);
|
||||
} catch (e) {
|
||||
@@ -38,9 +37,9 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<Modal title="Retry verification" bind:show onSubmit={retryDomain} bind:error>
|
||||
{#if selectedDomain}
|
||||
<RecordsCard domain={selectedDomain} />
|
||||
<Modal title="Retry verification" bind:show onSubmit={retryProxyRule} bind:error>
|
||||
{#if selectedProxyRule}
|
||||
<RecordsCard proxyRule={selectedProxyRule} />
|
||||
{/if}
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
|
||||
+22
-18
@@ -19,14 +19,22 @@
|
||||
import { columns } from './store';
|
||||
|
||||
let {
|
||||
domains
|
||||
proxyRules
|
||||
}: {
|
||||
domains: Models.ProxyRuleList;
|
||||
proxyRules: Models.ProxyRuleList;
|
||||
} = $props();
|
||||
|
||||
let showDelete = $state(false);
|
||||
let showRetry = $state(false);
|
||||
let selectedDomain: Models.ProxyRule = $state(null);
|
||||
let selectedProxyRule: Models.ProxyRule = $state(null);
|
||||
|
||||
const proxyTarget = (proxy: Models.ProxyRule) => {
|
||||
return proxy?.redirectUrl
|
||||
? 'Redirect to ' + proxy.redirectUrl
|
||||
: proxy?.deploymentVcsProviderBranch
|
||||
? 'Deployed from' + proxy.deploymentVcsProviderBranch
|
||||
: 'Active deployment';
|
||||
};
|
||||
</script>
|
||||
|
||||
<Table.Root columns={[...$columns, { id: 'actions', width: 40 }]} let:root>
|
||||
@@ -38,24 +46,24 @@
|
||||
{/each}
|
||||
<Table.Header.Cell column="actions" {root} />
|
||||
</svelte:fragment>
|
||||
{#each domains.rules as domain}
|
||||
{#each proxyRules.rules as proxyRule}
|
||||
<Table.Row.Base {root}>
|
||||
{#each $columns as column}
|
||||
<Table.Cell column={column.id} {root}>
|
||||
{#if column.id === 'domain'}
|
||||
<Layout.Stack direction="row" gap="xs">
|
||||
<Link external href={`${$protocol}${domain.domain}`} variant="quiet">
|
||||
<Link external href={`${$protocol}${proxyRule.domain}`} variant="quiet">
|
||||
<Typography.Text truncate>
|
||||
{domain.domain}
|
||||
{proxyRule.domain}
|
||||
</Typography.Text>
|
||||
</Link>
|
||||
{#if domain.status === 'verifying'}
|
||||
{#if proxyRule.status === 'verifying'}
|
||||
<Badge
|
||||
variant="secondary"
|
||||
type="warning"
|
||||
content="Verifying"
|
||||
size="s" />
|
||||
{:else if domain.status !== 'verified'}
|
||||
{:else if proxyRule.status !== 'verified'}
|
||||
<Badge
|
||||
variant="secondary"
|
||||
type="error"
|
||||
@@ -64,11 +72,7 @@
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
{:else if column.id === 'target'}
|
||||
{domain?.redirectUrl
|
||||
? 'Redirect to ' + domain.redirectUrl
|
||||
: domain?.deploymentVcsProviderBranch
|
||||
? 'Deployed from' + domain.deploymentVcsProviderBranch
|
||||
: '-'}
|
||||
{proxyTarget(proxyRule)}
|
||||
{/if}
|
||||
</Table.Cell>
|
||||
{/each}
|
||||
@@ -87,11 +91,11 @@
|
||||
|
||||
<svelte:fragment slot="tooltip" let:toggle>
|
||||
<ActionMenu.Root>
|
||||
{#if domain.status !== 'verified'}
|
||||
{#if proxyRule.status !== 'verified'}
|
||||
<ActionMenu.Item.Button
|
||||
leadingIcon={IconRefresh}
|
||||
on:click={(e) => {
|
||||
selectedDomain = domain;
|
||||
selectedProxyRule = proxyRule;
|
||||
showRetry = true;
|
||||
toggle(e);
|
||||
}}>
|
||||
@@ -102,7 +106,7 @@
|
||||
status="danger"
|
||||
leadingIcon={IconTrash}
|
||||
on:click={(e) => {
|
||||
selectedDomain = domain;
|
||||
selectedProxyRule = proxyRule;
|
||||
showDelete = true;
|
||||
toggle(e);
|
||||
trackEvent(Click.DomainDeleteClick, {
|
||||
@@ -121,9 +125,9 @@
|
||||
</Table.Root>
|
||||
|
||||
{#if showDelete}
|
||||
<DeleteDomainModal bind:show={showDelete} {selectedDomain} />
|
||||
<DeleteDomainModal bind:show={showDelete} {selectedProxyRule} />
|
||||
{/if}
|
||||
|
||||
{#if showRetry}
|
||||
<RetryDomainModal bind:show={showRetry} {selectedDomain} />
|
||||
<RetryDomainModal bind:show={showRetry} {selectedProxyRule} />
|
||||
{/if}
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@
|
||||
</Layout.Stack>
|
||||
</Accordion>
|
||||
<Accordion title="Request" open>
|
||||
<LogsRequest {selectedLog} />
|
||||
<LogsRequest {selectedLog} product="function" />
|
||||
</Accordion>
|
||||
<Accordion title="Response" open hideDivider>
|
||||
<LogsResponse {selectedLog} product="function" {logging} />
|
||||
|
||||
+6
-7
@@ -11,6 +11,7 @@
|
||||
import { onMount } from 'svelte';
|
||||
import { isCloud } from '$lib/system';
|
||||
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}/settings/domains`;
|
||||
|
||||
@@ -27,14 +28,12 @@
|
||||
});
|
||||
|
||||
async function addDomain() {
|
||||
let domain = data.domains?.domains.find((d) => d.domain === domainName);
|
||||
const apexDomain = getApexDomain(domainName);
|
||||
let domain = data.domains?.domains.find((d) => d.domain === apexDomain);
|
||||
|
||||
if (!domain && isCloud) {
|
||||
if (apexDomain && !domain && isCloud) {
|
||||
try {
|
||||
domain = await sdk.forConsole.domains.create(
|
||||
$project.teamId,
|
||||
domainName.toLocaleLowerCase()
|
||||
);
|
||||
domain = await sdk.forConsole.domains.create($project.teamId, apexDomain);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -48,7 +47,7 @@
|
||||
try {
|
||||
const rule = await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.proxy.createAPIRule(domainName);
|
||||
.proxy.createAPIRule(domainName.toLocaleLowerCase());
|
||||
if (rule?.status === 'verified') {
|
||||
await goto(routeBase);
|
||||
await invalidate(Dependencies.DOMAINS);
|
||||
|
||||
+4
-3
@@ -20,6 +20,7 @@
|
||||
import Wizard from '$lib/layout/wizard.svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { writable } from 'svelte/store';
|
||||
import { isASubdomain } from '$lib/helpers/tlds';
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
import NameserverTable from '$lib/components/domains/nameserverTable.svelte';
|
||||
import RecordTable from '$lib/components/domains/recordTable.svelte';
|
||||
@@ -27,7 +28,7 @@
|
||||
let { data } = $props();
|
||||
|
||||
const ruleId = page.url.searchParams.get('rule');
|
||||
let isSubDomain = $derived(page.params.domain?.split('.')?.length >= 3);
|
||||
const isSubDomain = $derived.by(() => isASubdomain(page.params.domain));
|
||||
|
||||
let selectedTab = $state<'cname' | 'nameserver' | 'a' | 'aaaa'>('nameserver');
|
||||
$effect(() => {
|
||||
@@ -125,7 +126,7 @@
|
||||
Nameservers
|
||||
</Tabs.Item.Button>
|
||||
{/if}
|
||||
{#if !!$consoleVariables._APP_DOMAIN_TARGET_A && $consoleVariables._APP_DOMAIN_TARGET_A !== '127.0.0.1'}
|
||||
{#if !isCloud && !!$consoleVariables._APP_DOMAIN_TARGET_A && $consoleVariables._APP_DOMAIN_TARGET_A !== '127.0.0.1'}
|
||||
<Tabs.Item.Button
|
||||
{root}
|
||||
on:click={() => (selectedTab = 'a')}
|
||||
@@ -133,7 +134,7 @@
|
||||
A
|
||||
</Tabs.Item.Button>
|
||||
{/if}
|
||||
{#if !!$consoleVariables._APP_DOMAIN_TARGET_AAAA && $consoleVariables._APP_DOMAIN_TARGET_AAAA !== '::1'}
|
||||
{#if !isCloud && !!$consoleVariables._APP_DOMAIN_TARGET_AAAA && $consoleVariables._APP_DOMAIN_TARGET_AAAA !== '::1'}
|
||||
<Tabs.Item.Button
|
||||
{root}
|
||||
on:click={() => (selectedTab = 'aaaa')}
|
||||
|
||||
+3
-9
@@ -1,23 +1,17 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Dependencies } from '$lib/constants.js';
|
||||
import { isCloud } from '$lib/system';
|
||||
import type { Domain, DomainsList } from '$lib/sdk/domains.js';
|
||||
import { Dependencies } from '$lib/constants.js';
|
||||
import type { DomainsList } from '$lib/sdk/domains.js';
|
||||
|
||||
export const load = async ({ depends, params }) => {
|
||||
export const load = async ({ depends }) => {
|
||||
depends(Dependencies.DOMAINS);
|
||||
|
||||
let domain: Domain;
|
||||
let domainsList: DomainsList;
|
||||
if (isCloud) {
|
||||
domainsList = await sdk.forConsole.domains.list();
|
||||
const domainId = domainsList.domains.find(
|
||||
(domain: Domain) => domain.domain === params.domain
|
||||
).$id;
|
||||
domain = await sdk.forConsole.domains.get(domainId);
|
||||
}
|
||||
|
||||
return {
|
||||
domain,
|
||||
domainsList
|
||||
};
|
||||
};
|
||||
|
||||
+13
-5
@@ -5,7 +5,7 @@
|
||||
import { Repositories } from '$lib/components/git';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Link } from '$lib/elements';
|
||||
import { Button, InputCheckbox, InputSelect } from '$lib/elements/forms';
|
||||
import { Button, InputCheckbox } from '$lib/elements/forms';
|
||||
import { timeFromNow } from '$lib/helpers/date';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
@@ -18,7 +18,7 @@
|
||||
type Models
|
||||
} from '@appwrite.io/console';
|
||||
import { IconGithub } from '@appwrite.io/pink-icons-svelte';
|
||||
import { Icon, Layout, Skeleton, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { Icon, Input, Layout, Skeleton, Typography } from '@appwrite.io/pink-svelte';
|
||||
|
||||
export let show = false;
|
||||
export let site: Models.Site;
|
||||
@@ -125,6 +125,14 @@
|
||||
error = e.message;
|
||||
}
|
||||
}
|
||||
|
||||
$: if (!show) {
|
||||
error = '';
|
||||
branch = null;
|
||||
commit = null;
|
||||
activate = true;
|
||||
hasRepository = !!site?.providerRepositoryId;
|
||||
}
|
||||
</script>
|
||||
|
||||
<Modal title="Create Git deployment" bind:show onSubmit={createDeployment} bind:error>
|
||||
@@ -184,13 +192,13 @@
|
||||
</Typography.Caption>
|
||||
</Layout.Stack>
|
||||
</Card>
|
||||
<InputSelect
|
||||
required={true}
|
||||
<Input.ComboBox
|
||||
required
|
||||
id="branch"
|
||||
label="Production branch"
|
||||
placeholder="Select branch"
|
||||
bind:value={branch}
|
||||
isSearchable
|
||||
bind:value={branch}
|
||||
on:select={(event) => {
|
||||
branch = event.detail.value;
|
||||
}}
|
||||
|
||||
+11
-1
@@ -9,6 +9,9 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { IconInfo } from '@appwrite.io/pink-icons-svelte';
|
||||
import { Icon, Layout, Tooltip, Typography, Upload } from '@appwrite.io/pink-svelte';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { currentPlan } from '$lib/stores/organization';
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
|
||||
export let show = false;
|
||||
export let site: Models.Site;
|
||||
@@ -16,6 +19,13 @@
|
||||
let files: FileList;
|
||||
let error: string = '';
|
||||
|
||||
$: maxSize =
|
||||
isCloud && $currentPlan
|
||||
? $currentPlan?.deploymentSize === 0
|
||||
? 0
|
||||
: $currentPlan?.deploymentSize * 1000000
|
||||
: $consoleVariables._APP_COMPUTE_SIZE_LIMIT; // already in MB
|
||||
|
||||
async function createDeployment() {
|
||||
try {
|
||||
uploader.uploadSiteDeployment(site.$id, files[0]);
|
||||
@@ -63,7 +73,7 @@
|
||||
<Upload.Dropzone
|
||||
extensions={['gz', 'tar']}
|
||||
bind:files
|
||||
maxSize={10000000}
|
||||
{maxSize}
|
||||
required
|
||||
on:invalid={handleInvalid}>
|
||||
<Layout.Stack alignItems="center" gap="s">
|
||||
|
||||
+7
-3
@@ -43,12 +43,16 @@
|
||||
</Button>
|
||||
</Layout.Stack>
|
||||
{#if deploymentList?.total}
|
||||
{@const hasAuthor = deploymentList.deployments.some((d) => d?.providerCommitAuthor)}
|
||||
<Table.Root
|
||||
columns={[
|
||||
{ id: '$id', width: 200 },
|
||||
{ id: 'status', width: { min: 120 } },
|
||||
{ id: 'source', width: { min: 120 } },
|
||||
{ id: '$updatedAt', width: { min: 120 } },
|
||||
{ id: 'status', width: { min: 80, max: 100 } },
|
||||
{ id: 'source', width: { min: 80, max: 100 } },
|
||||
{
|
||||
id: '$updatedAt',
|
||||
width: { min: hasAuthor ? 280 : 100 }
|
||||
},
|
||||
{ id: 'actions', width: 50 }
|
||||
]}
|
||||
let:root>
|
||||
|
||||
+3
-3
@@ -29,14 +29,14 @@
|
||||
</Button>
|
||||
</Layout.Stack>
|
||||
|
||||
{#if data.domains.total}
|
||||
<Table domains={data.domains} />
|
||||
{#if data.proxyRules.total}
|
||||
<Table proxyRules={data.proxyRules} />
|
||||
|
||||
<PaginationWithLimit
|
||||
name="Domains"
|
||||
limit={data.limit}
|
||||
offset={data.offset}
|
||||
total={data.domains.total} />
|
||||
total={data.proxyRules.total} />
|
||||
{:else if data?.search}
|
||||
<EmptySearch hidePages bind:search={data.search} target="domains" hidePagination>
|
||||
<Button
|
||||
|
||||
@@ -22,7 +22,7 @@ export const load = async ({ params, depends, url, route }) => {
|
||||
limit,
|
||||
query,
|
||||
search,
|
||||
domains: await sdk
|
||||
proxyRules: await sdk
|
||||
.forProject(params.region, params.project)
|
||||
.proxy.listRules(
|
||||
[
|
||||
|
||||
+14
-11
@@ -25,6 +25,7 @@
|
||||
import { ConnectRepoModal } from '$lib/components/git/index.js';
|
||||
import { project } from '$routes/(console)/project-[region]-[project]/store';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { getApexDomain } from '$lib/helpers/tlds';
|
||||
|
||||
const routeBase = `${base}/project-${page.params.region}-${page.params.project}/sites/site-${page.params.site}/domains`;
|
||||
|
||||
@@ -52,14 +53,12 @@
|
||||
});
|
||||
|
||||
async function addDomain() {
|
||||
let domain = data.domains?.domains.find((d) => d.domain === domainName);
|
||||
const apexDomain = getApexDomain(domainName);
|
||||
let domain = data.domains?.domains.find((d) => d.domain === apexDomain);
|
||||
|
||||
if (!domain && isCloud) {
|
||||
if (apexDomain && !domain && isCloud) {
|
||||
try {
|
||||
domain = await sdk.forConsole.domains.create(
|
||||
$project.teamId,
|
||||
domainName.toLocaleLowerCase()
|
||||
);
|
||||
domain = await sdk.forConsole.domains.create($project.teamId, apexDomain);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -175,13 +174,17 @@
|
||||
value: branch.name
|
||||
}))}
|
||||
<Layout.Stack gap="s">
|
||||
<InputSelect
|
||||
{options}
|
||||
label="Production branch"
|
||||
id="branch"
|
||||
<Input.ComboBox
|
||||
required
|
||||
id="branch"
|
||||
label="Production branch"
|
||||
placeholder="Select branch"
|
||||
isSearchable
|
||||
bind:value={branch}
|
||||
placeholder="Select branch" />
|
||||
on:select={(event) => {
|
||||
branch = event.detail.value;
|
||||
}}
|
||||
{options} />
|
||||
{#if !data.branches?.total}
|
||||
<Input.Helper state="default">
|
||||
No branches found in the selected repository. Create a
|
||||
|
||||
+7
-5
@@ -20,6 +20,7 @@
|
||||
import Wizard from '$lib/layout/wizard.svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { writable } from 'svelte/store';
|
||||
import { isASubdomain } from '$lib/helpers/tlds';
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
import NameserverTable from '$lib/components/domains/nameserverTable.svelte';
|
||||
import RecordTable from '$lib/components/domains/recordTable.svelte';
|
||||
@@ -27,9 +28,10 @@
|
||||
let { data } = $props();
|
||||
|
||||
const ruleId = page.url.searchParams.get('rule');
|
||||
let isSubDomain = $derived(page.params.domain?.split('.')?.length >= 3);
|
||||
const isSubDomain = $derived.by(() => isASubdomain(page.params.domain));
|
||||
|
||||
let selectedTab = $state<'cname' | 'nameserver' | 'a' | 'aaaa'>('nameserver');
|
||||
|
||||
$effect(() => {
|
||||
if ($consoleVariables._APP_DOMAIN_TARGET_CNAME && isSubDomain) {
|
||||
selectedTab = 'cname';
|
||||
@@ -127,7 +129,7 @@
|
||||
Nameservers
|
||||
</Tabs.Item.Button>
|
||||
{/if}
|
||||
{#if !!$consoleVariables._APP_DOMAIN_TARGET_A && $consoleVariables._APP_DOMAIN_TARGET_A !== '127.0.0.1'}
|
||||
{#if !isCloud && !!$consoleVariables._APP_DOMAIN_TARGET_A && $consoleVariables._APP_DOMAIN_TARGET_A !== '127.0.0.1'}
|
||||
<Tabs.Item.Button
|
||||
{root}
|
||||
on:click={() => (selectedTab = 'a')}
|
||||
@@ -135,7 +137,7 @@
|
||||
A
|
||||
</Tabs.Item.Button>
|
||||
{/if}
|
||||
{#if !!$consoleVariables._APP_DOMAIN_TARGET_AAAA && $consoleVariables._APP_DOMAIN_TARGET_AAAA !== '::1'}
|
||||
{#if !isCloud && !!$consoleVariables._APP_DOMAIN_TARGET_AAAA && $consoleVariables._APP_DOMAIN_TARGET_AAAA !== '::1'}
|
||||
<Tabs.Item.Button
|
||||
{root}
|
||||
on:click={() => (selectedTab = 'aaaa')}
|
||||
@@ -150,10 +152,10 @@
|
||||
<NameserverTable domain={page.params.domain} {verified} />
|
||||
{:else}
|
||||
<RecordTable
|
||||
domain={page.params.domain}
|
||||
{verified}
|
||||
service="sites"
|
||||
variant={selectedTab}
|
||||
service="sites" />
|
||||
domain={page.params.domain} />
|
||||
{/if}
|
||||
<Divider />
|
||||
<Layout.Stack direction="row" justifyContent="flex-end">
|
||||
|
||||
+2
-8
@@ -1,26 +1,20 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { Dependencies } from '$lib/constants.js';
|
||||
import type { Domain, DomainsList } from '$lib/sdk/domains.js';
|
||||
import type { DomainsList } from '$lib/sdk/domains';
|
||||
|
||||
export const load = async ({ parent, depends, params }) => {
|
||||
export const load = async ({ parent, depends }) => {
|
||||
const { site } = await parent();
|
||||
depends(Dependencies.SITES_DOMAINS);
|
||||
|
||||
let domain: Domain;
|
||||
let domainsList: DomainsList;
|
||||
|
||||
if (isCloud) {
|
||||
domainsList = await sdk.forConsole.domains.list();
|
||||
const domainId = domainsList.domains.find(
|
||||
(domain: Domain) => domain.domain === params.domain
|
||||
).$id;
|
||||
domain = await sdk.forConsole.domains.get(domainId);
|
||||
}
|
||||
|
||||
return {
|
||||
site,
|
||||
domain,
|
||||
domainsList
|
||||
};
|
||||
};
|
||||
|
||||
+5
-5
@@ -11,10 +11,10 @@
|
||||
|
||||
let {
|
||||
show = $bindable(),
|
||||
selectedDomain
|
||||
selectedProxyRule
|
||||
}: {
|
||||
show: boolean;
|
||||
selectedDomain: Models.ProxyRule;
|
||||
selectedProxyRule: Models.ProxyRule;
|
||||
} = $props();
|
||||
|
||||
let error: string = $state(null);
|
||||
@@ -23,7 +23,7 @@
|
||||
try {
|
||||
await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.proxy.deleteRule(selectedDomain.$id);
|
||||
.proxy.deleteRule(selectedProxyRule.$id);
|
||||
await invalidate(Dependencies.SITES_DOMAINS);
|
||||
show = false;
|
||||
addNotification({
|
||||
@@ -39,13 +39,13 @@
|
||||
</script>
|
||||
|
||||
<Confirm title="Delete domain" bind:open={show} onSubmit={deleteDomain} bind:error confirmDeletion>
|
||||
{#if selectedDomain}
|
||||
{#if selectedProxyRule}
|
||||
<Typography.Text variant="m-400">
|
||||
Are you sure you want to delete this domain? You will no longer be able to view your
|
||||
site by visiting:
|
||||
</Typography.Text>
|
||||
<Typography.Text variant="m-500">
|
||||
{selectedDomain.domain}
|
||||
{selectedProxyRule.domain}
|
||||
</Typography.Text>
|
||||
{/if}
|
||||
</Confirm>
|
||||
|
||||
+8
-9
@@ -11,20 +11,19 @@
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { page } from '$app/state';
|
||||
import { isASubdomain } from '$lib/helpers/tlds';
|
||||
import NameserverTable from '$lib/components/domains/nameserverTable.svelte';
|
||||
import RecordTable from '$lib/components/domains/recordTable.svelte';
|
||||
|
||||
let {
|
||||
show = $bindable(false),
|
||||
selectedDomain
|
||||
selectedProxyRule
|
||||
}: {
|
||||
show: boolean;
|
||||
selectedDomain: Models.ProxyRule;
|
||||
selectedProxyRule: Models.ProxyRule;
|
||||
} = $props();
|
||||
|
||||
let isSubDomain = $derived.by(() =>
|
||||
selectedDomain?.domain?.length ? selectedDomain?.domain?.split('.')?.length >= 3 : false
|
||||
);
|
||||
const isSubDomain = $derived.by(() => isASubdomain(selectedProxyRule?.domain));
|
||||
|
||||
let selectedTab = $state<'cname' | 'nameserver' | 'a' | 'aaaa'>('nameserver');
|
||||
$effect(() => {
|
||||
@@ -44,13 +43,13 @@
|
||||
try {
|
||||
const domain = await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.proxy.updateRuleVerification(selectedDomain.$id);
|
||||
.proxy.updateRuleVerification(selectedProxyRule.$id);
|
||||
await invalidate(Dependencies.SITES_DOMAINS);
|
||||
verified = domain.status === 'verified';
|
||||
show = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${selectedDomain.domain} has been verified`
|
||||
message: `${selectedProxyRule.domain} has been verified`
|
||||
});
|
||||
trackEvent(Submit.DomainUpdateVerification);
|
||||
} catch (e) {
|
||||
@@ -105,13 +104,13 @@
|
||||
<Divider />
|
||||
</div>
|
||||
{#if selectedTab === 'nameserver'}
|
||||
<NameserverTable domain={selectedDomain.domain} {verified} />
|
||||
<NameserverTable domain={selectedProxyRule.domain} {verified} />
|
||||
{:else}
|
||||
<RecordTable
|
||||
{verified}
|
||||
service="sites"
|
||||
variant={selectedTab}
|
||||
domain={selectedDomain.domain} />
|
||||
domain={selectedProxyRule.domain} />
|
||||
{/if}
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
|
||||
+22
-18
@@ -19,14 +19,22 @@
|
||||
import { columns } from './store';
|
||||
|
||||
let {
|
||||
domains
|
||||
proxyRules
|
||||
}: {
|
||||
domains: Models.ProxyRuleList;
|
||||
proxyRules: Models.ProxyRuleList;
|
||||
} = $props();
|
||||
|
||||
let showDelete = $state(false);
|
||||
let showRetry = $state(false);
|
||||
let selectedDomain: Models.ProxyRule = $state(null);
|
||||
let selectedProxyRule: Models.ProxyRule = $state(null);
|
||||
|
||||
const proxyTarget = (proxy: Models.ProxyRule) => {
|
||||
return proxy?.redirectUrl
|
||||
? 'Redirect to ' + proxy.redirectUrl
|
||||
: proxy?.deploymentVcsProviderBranch
|
||||
? 'Deployed from' + proxy.deploymentVcsProviderBranch
|
||||
: 'Active deployment';
|
||||
};
|
||||
</script>
|
||||
|
||||
<Table.Root columns={[...$columns, { id: 'actions', width: 40 }]} let:root>
|
||||
@@ -38,25 +46,25 @@
|
||||
{/each}
|
||||
<Table.Header.Cell column="actions" {root} />
|
||||
</svelte:fragment>
|
||||
{#each domains.rules as domain}
|
||||
{#each proxyRules.rules as rule}
|
||||
<Table.Row.Base {root}>
|
||||
{#each $columns as column}
|
||||
<Table.Cell column={column.id} {root}>
|
||||
{#if column.id === 'domain'}
|
||||
<Layout.Stack direction="row" gap="xs">
|
||||
<Link external href={`${$protocol}${domain.domain}`} variant="quiet">
|
||||
<Link external href={`${$protocol}${rule.domain}`} variant="quiet">
|
||||
<Typography.Text truncate>
|
||||
{domain.domain}
|
||||
{rule.domain}
|
||||
</Typography.Text>
|
||||
</Link>
|
||||
|
||||
{#if domain.status === 'verifying'}
|
||||
{#if rule.status === 'verifying'}
|
||||
<Badge
|
||||
variant="secondary"
|
||||
type="warning"
|
||||
content="Verifying"
|
||||
size="s" />
|
||||
{:else if domain.status !== 'verified'}
|
||||
{:else if rule.status !== 'verified'}
|
||||
<Badge
|
||||
variant="secondary"
|
||||
type="error"
|
||||
@@ -65,11 +73,7 @@
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
{:else if column.id === 'target'}
|
||||
{domain?.redirectUrl
|
||||
? 'Redirect to ' + domain.redirectUrl
|
||||
: domain?.deploymentVcsProviderBranch
|
||||
? 'Deployed from' + domain.deploymentVcsProviderBranch
|
||||
: '-'}
|
||||
{proxyTarget(rule)}
|
||||
{/if}
|
||||
</Table.Cell>
|
||||
{/each}
|
||||
@@ -88,11 +92,11 @@
|
||||
|
||||
<svelte:fragment slot="tooltip" let:toggle>
|
||||
<ActionMenu.Root>
|
||||
{#if domain.status !== 'verified'}
|
||||
{#if rule.status !== 'verified'}
|
||||
<ActionMenu.Item.Button
|
||||
leadingIcon={IconRefresh}
|
||||
on:click={(e) => {
|
||||
selectedDomain = domain;
|
||||
selectedProxyRule = rule;
|
||||
showRetry = true;
|
||||
toggle(e);
|
||||
}}>
|
||||
@@ -103,7 +107,7 @@
|
||||
status="danger"
|
||||
leadingIcon={IconTrash}
|
||||
on:click={(e) => {
|
||||
selectedDomain = domain;
|
||||
selectedProxyRule = rule;
|
||||
showDelete = true;
|
||||
toggle(e);
|
||||
trackEvent(Click.DomainDeleteClick, {
|
||||
@@ -122,9 +126,9 @@
|
||||
</Table.Root>
|
||||
|
||||
{#if showDelete}
|
||||
<DeleteDomainModal bind:show={showDelete} {selectedDomain} />
|
||||
<DeleteDomainModal bind:show={showDelete} {selectedProxyRule} />
|
||||
{/if}
|
||||
|
||||
{#if showRetry}
|
||||
<RetryDomainModal bind:show={showRetry} {selectedDomain} />
|
||||
<RetryDomainModal bind:show={showRetry} {selectedProxyRule} />
|
||||
{/if}
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
</Layout.Stack>
|
||||
</Accordion>
|
||||
<Accordion title="Request" open>
|
||||
<LogsRequest {selectedLog} />
|
||||
<LogsRequest {selectedLog} product="site" />
|
||||
</Accordion>
|
||||
<Accordion title="Response" open hideDivider>
|
||||
<LogsResponse {selectedLog} logging={$site?.logging} product="site" />
|
||||
|
||||
Reference in New Issue
Block a user