mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
feedback
This commit is contained in:
+5
-5
@@ -28,13 +28,13 @@
|
||||
let { data } = $props();
|
||||
|
||||
const ruleId = page.url.searchParams.get('rule');
|
||||
const isSubDomain = $derived.by(() => isASubdomain(page.params.domain));
|
||||
const isSubDomain = $derived.by(() => isASubdomain(data.proxyRule.domain));
|
||||
|
||||
let selectedTab = $state<'cname' | 'nameserver' | 'a' | 'aaaa'>(getDefaultTab());
|
||||
|
||||
let routeBase = `${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/domains`;
|
||||
let verified: boolean | undefined = $state(undefined);
|
||||
let isSubmitting = $state(writable(false));
|
||||
const isSubmitting = writable(false);
|
||||
|
||||
function getDefaultTab() {
|
||||
if (isSubDomain && $regionalConsoleVariables._APP_DOMAIN_FUNCTIONS) {
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
async function verify() {
|
||||
const isNewDomain =
|
||||
data.domainsList.domains.find((rule) => rule.domain === page.params.domain) ===
|
||||
data.domainsList.domains.find((rule) => rule.domain === data.proxyRule.domain) ===
|
||||
undefined;
|
||||
try {
|
||||
if (selectedTab !== 'nameserver') {
|
||||
@@ -68,7 +68,7 @@
|
||||
} else if (isNewDomain && isCloud) {
|
||||
const domainData = await sdk.forConsole.domains.create({
|
||||
teamId: $organization.$id,
|
||||
domain: page.params.domain
|
||||
domain: data.proxyRule.domain
|
||||
});
|
||||
verified = domainData.nameservers.toLowerCase() === 'appwrite';
|
||||
}
|
||||
@@ -108,7 +108,7 @@
|
||||
</script>
|
||||
|
||||
<Wizard title="Add domain" href={routeBase} column columnSize="s">
|
||||
<Form onSubmit={verify} bind:isSubmitting>
|
||||
<Form onSubmit={verify} {isSubmitting}>
|
||||
<Layout.Stack gap="xxl">
|
||||
<Card.Base radius="s" padding="s">
|
||||
<Layout.Stack
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { page } from '$app/state';
|
||||
import { realtime } from '$lib/stores/sdk';
|
||||
import { realtime, RuleType } from '$lib/stores/sdk';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { type Models } from '@appwrite.io/console';
|
||||
@@ -10,7 +10,7 @@
|
||||
return realtime.forProject(page.params.region, ['console', 'project'], (response) => {
|
||||
if (response.events.includes('rules.*.update')) {
|
||||
const proxyRule = response.payload as Models.ProxyRule;
|
||||
if (proxyRule.type === 'api') {
|
||||
if (proxyRule.type === RuleType.API) {
|
||||
invalidate(Dependencies.DOMAINS);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -28,7 +28,7 @@
|
||||
let { data } = $props();
|
||||
|
||||
const ruleId = page.url.searchParams.get('rule');
|
||||
const isSubDomain = $derived.by(() => isASubdomain(page.params.domain));
|
||||
const isSubDomain = $derived.by(() => isASubdomain(data.proxyRule.domain));
|
||||
|
||||
let selectedTab = $state<'cname' | 'nameserver' | 'a' | 'aaaa'>(getDefaultTab());
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
async function verify() {
|
||||
const isNewDomain =
|
||||
data.domainsList.domains.find((rule) => rule.domain === page.params.domain) ===
|
||||
data.domainsList.domains.find((rule) => rule.domain === data.proxyRule.domain) ===
|
||||
undefined;
|
||||
try {
|
||||
if (selectedTab !== 'nameserver') {
|
||||
@@ -68,7 +68,7 @@
|
||||
} else if (isNewDomain && isCloud) {
|
||||
const domainData = await sdk.forConsole.domains.create({
|
||||
teamId: $organization.$id,
|
||||
domain: page.params.domain
|
||||
domain: data.proxyRule.domain
|
||||
});
|
||||
verified = domainData.nameservers.toLowerCase() === 'appwrite';
|
||||
}
|
||||
|
||||
+6
-5
@@ -28,13 +28,13 @@
|
||||
let { data } = $props();
|
||||
|
||||
const ruleId = page.url.searchParams.get('rule');
|
||||
const isSubDomain = $derived.by(() => isASubdomain(page.params.domain));
|
||||
const isSubDomain = $derived.by(() => isASubdomain(data.proxyRule.domain));
|
||||
|
||||
let selectedTab = $state<'cname' | 'nameserver' | 'a' | 'aaaa'>(getDefaultTab());
|
||||
|
||||
let routeBase = `${base}/project-${page.params.region}-${page.params.project}/sites/site-${page.params.site}/domains`;
|
||||
let verified: boolean | undefined = $state(undefined);
|
||||
let isSubmitting = $state(writable(false));
|
||||
const isSubmitting = writable(false);
|
||||
|
||||
function getDefaultTab() {
|
||||
if (isSubDomain && $regionalConsoleVariables._APP_DOMAIN_SITES) {
|
||||
@@ -50,7 +50,8 @@
|
||||
|
||||
async function verify() {
|
||||
const isNewDomain =
|
||||
data.domainsList.domains.findIndex((rule) => rule.domain === page.params.domain) === -1;
|
||||
data.domainsList.domains.findIndex((rule) => rule.domain === data.proxyRule.domain) ===
|
||||
-1;
|
||||
try {
|
||||
if (selectedTab !== 'nameserver') {
|
||||
const ruleData = await sdk
|
||||
@@ -67,7 +68,7 @@
|
||||
} else if (isNewDomain && isCloud) {
|
||||
const domainData = await sdk.forConsole.domains.create({
|
||||
teamId: $organization.$id,
|
||||
domain: page.params.domain
|
||||
domain: data.proxyRule.domain
|
||||
});
|
||||
verified = domainData.nameservers.toLowerCase() === 'appwrite';
|
||||
}
|
||||
@@ -107,7 +108,7 @@
|
||||
</script>
|
||||
|
||||
<Wizard title="Add domain" href={routeBase} column columnSize="s">
|
||||
<Form onSubmit={verify} bind:isSubmitting>
|
||||
<Form onSubmit={verify} {isSubmitting}>
|
||||
<Layout.Stack gap="xxl">
|
||||
<Card.Base radius="s" padding="s">
|
||||
<Layout.Stack
|
||||
|
||||
Reference in New Issue
Block a user