diff --git a/.env.example b/.env.example index 0e8699fc9..bf090442b 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ PUBLIC_CONSOLE_MODE=self-hosted -PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt +PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt,index-lengths PUBLIC_APPWRITE_MULTI_REGION=false PUBLIC_APPWRITE_ENDPOINT=http://localhost/v1 PUBLIC_STRIPE_KEY= diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7073e19f1..137c750f7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -79,7 +79,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} build-args: | "PUBLIC_CONSOLE_MODE=cloud" - "PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt" + "PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt,index-lengths" "PUBLIC_APPWRITE_MULTI_REGION=true" "PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}" "PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY_STAGE }}" @@ -118,7 +118,7 @@ jobs: build-args: | "PUBLIC_CONSOLE_MODE=self-hosted" "PUBLIC_APPWRITE_MULTI_REGION=false" - "PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt" + "PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt,index-lengths" "PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}" publish-cloud-no-regions: @@ -156,6 +156,6 @@ jobs: build-args: | "PUBLIC_CONSOLE_MODE=cloud" "PUBLIC_APPWRITE_MULTI_REGION=false" - "PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt" + "PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt,index-lengths" "PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY_STAGE }}" "PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}" diff --git a/src/lib/components/git/repositories.svelte b/src/lib/components/git/repositories.svelte index b82781169..39f260a99 100644 --- a/src/lib/components/git/repositories.svelte +++ b/src/lib/components/git/repositories.svelte @@ -23,7 +23,7 @@ import { page } from '$app/state'; import Card from '../card.svelte'; import SkeletonRepoList from './skeletonRepoList.svelte'; - import { untrack } from 'svelte'; + import { onMount, untrack } from 'svelte'; let { action = $bindable('select'), @@ -46,6 +46,11 @@ let search = $state(''); let selectedInstallation = $state(null); let isLoadingRepositories = $state(null); + let installationsMap = $state(null); + + onMount(() => { + loadInstallations(); + }); async function loadInstallations() { if (installationList) { @@ -59,7 +64,7 @@ ) ); } - return installationList.installations; + installationsMap = installationList.installations; } else { const { installations } = await sdk .forProject(page.params.region, page.params.project) @@ -70,7 +75,7 @@ } installation.set(installations.find((entry) => entry.$id === selectedInstallation)); } - return installations; + installationsMap = installations; } } @@ -123,7 +128,7 @@ {#if hasInstallations} - {#await loadInstallations()} + {#if !installationsMap} - {:then installations} + {:else} { + ...installationsMap.map((entry) => { return { label: entry.organization, value: entry.$id @@ -160,7 +165,7 @@ } search = ''; installation.set( - installations.find((entry) => entry.$id === selectedInstallation) + installationsMap.find((entry) => entry.$id === selectedInstallation) ); isLoadingRepositories = true; @@ -174,7 +179,7 @@ bind:value={search} disabled={!search && !$repositories?.repositories?.length} /> - {/await} + {/if} {#if selectedInstallation} diff --git a/src/lib/flags.ts b/src/lib/flags.ts index 3c00ee6dc..db2417b83 100644 --- a/src/lib/flags.ts +++ b/src/lib/flags.ts @@ -21,5 +21,6 @@ function isFlagEnabled(name: string) { export const flags = { showSites: isFlagEnabled('sites'), showCsvImport: isFlagEnabled('csv-import'), - showAttributeEncrypt: isFlagEnabled('attribute-encrypt') + showAttributeEncrypt: isFlagEnabled('attribute-encrypt'), + showIndexLengths: isFlagEnabled('index-lengths') }; diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/+page.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/+page.svelte index 103f9a8b2..31db52abd 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/+page.svelte @@ -20,7 +20,6 @@ const databaseId = page.params.database; const collectionId = page.params.collection; const documentId = page.params.document; - const editing = true; function initWork() { const prohibitedKeys = [ @@ -124,7 +123,7 @@ {label} - + diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte index af18757b5..e63977b1b 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte @@ -1,24 +1,22 @@ {#if isRelationshipToMany(attribute)} -
- - - {label} - - {optionalText} - + + + + + {label} + + {optionalText} + + + + {#if showTopAddButton} + + {/if} - {#if editing || total === 0} - + + + + {#if showEmptyInput} + + { + if (!relatedList[0]) relatedList = ['']; + updateRelatedList(); + }} /> + + {/if} + + + {#if editing && hasItems} + {#each paginatedItems as _, paginatedIndex} + {@const actualIndex = offset + paginatedIndex} + + + {#if relatedList[actualIndex]} +
+ +
+ {/if} +
+ {/each} + {/if} + + + {#if !editing && hasItems} + {#each relatedList as item, i} + + +
+ +
+
+ {/each} + {/if} + + + {#if showInput} + + +
+ +
+
+ {/if} +
+ + {#if showBottomAddButton} + + + {/if}
-
    - {#if !editing && relatedList?.length} - {#each relatedList as item, i} - - - {/each} - {/if} - - {#if showInput} - !relatedList.includes(n.value))} - on:change={() => { - value = relatedList; - showInput = false; - }} /> - - {/if} - {#if paginatedItems && editing} - {#each paginatedItems as item, i} - - - {/each} - {/if} -
- {#if editing} -
-

Total results: {total}

- -
- {/if} - - {#if total > 0 && !editing} - - {/if} -
+
{:else} index.key); @@ -149,7 +152,7 @@ placeholder="Select Order" /> - {#if selectedType === IndexType.Key} + {#if selectedType === IndexType.Key && showLengths} @@ -39,12 +43,14 @@ id={`value-${selectedIndex.orders[i]}`} value={selectedIndex.orders[i]} readonly /> - + {#if showLengths} + + {/if} {/each} {/if} diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte index 886f253a7..db95e72bd 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte @@ -170,7 +170,7 @@ let checked = false; - let showEncrypt = flags.showAttributeEncrypt(data); + const showEncrypt = flags.showAttributeEncrypt(data); n.key === id)} - - {#if isRelationship(attr)} - {@const args = displayNames?.[attr.relatedCollection] ?? ['$id']} - {#if !isRelationshipToMany(attr)} - {#if document[id]} - {@const related = document[id]} - { - e.preventDefault(); - e.stopPropagation(); - goto( - `${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${attr.relatedCollection}/document-${related.$id}` - ); - }}> - {#each args as arg, i} - {#if arg !== undefined} - {#if i} -  | + {#if attr} + + {#if isRelationship(attr)} + {@const args = displayNames?.[attr.relatedCollection] ?? ['$id']} + {#if !isRelationshipToMany(attr)} + {#if document[id]} + {@const related = document[id]} + { + e.preventDefault(); + e.stopPropagation(); + goto( + `${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${attr.relatedCollection}/document-${related.$id}` + ); + }}> + {#each args as arg, i} + {#if arg !== undefined} + {#if i} +  | + {/if} + + {related?.[arg]} + {/if} - - {related?.[arg]} - - {/if} - {/each} - + {/each} + + {:else} + n/a + {/if} {:else} - n/a + {@const itemsNum = document[id]?.length} + { + e.stopPropagation(); + e.preventDefault(); + relationshipData = document[id]; + showRelationships = true; + selectedRelationship = attr; + }}> + Items + {/if} {:else} - {@const itemsNum = document[id]?.length} - { - e.stopPropagation(); - e.preventDefault(); - relationshipData = document[id]; - showRelationships = true; - selectedRelationship = attr; - }}> - Items - - {/if} - {:else} - {@const formatted = formatColumn(document[id])} - {@const isDatetimeAttribute = attr.type === 'datetime'} - {@const isEncryptedAttribute = isString(attr) && attr.encrypt} + {@const datetime = document[id]} + {@const formatted = formatColumn(document[id])} + {@const isDatetimeAttribute = attr.type === 'datetime'} + {@const isEncryptedAttribute = isString(attr) && attr.encrypt} {#if isDatetimeAttribute} - - Timestamp - {toLocaleDateTime(formatted.whole, true, 'UTC')} - - {:else if isEncryptedAttribute && showEncrypt} - - {:else if formatted.truncated} - + + Timestamp + {toLocaleDateTime(datetime, true)} + + {:else if isEncryptedAttribute && showEncrypt} + + {:else if formatted.truncated} + + {formatted.value} + + {#if showing} + {formatted.whole} + {/if} + + + {:else} {formatted.value} - - {#if showing} - {formatted.whole} - {/if} - - - {:else} - {formatted.value} + {/if} {/if} - {/if} - + + {/if} {/each} diff --git a/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/aside.svelte b/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/aside.svelte index d63fe5d05..4acf3d41a 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/aside.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/aside.svelte @@ -1,6 +1,6 @@ @@ -18,7 +19,7 @@ - {#if selectedRuntime?.name} + {#if selectedRuntime?.name && !loading} Runtime @@ -30,6 +31,11 @@ + {:else if loading} + + + + {/if} {#if showGitData} {#if repositoryName} diff --git a/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte b/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte index baa9692af..9b097f7a3 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte @@ -7,7 +7,7 @@ import { organization } from '$lib/stores/organization'; import { isCloud } from '$lib/system'; import { IconPencil } from '@appwrite.io/pink-icons-svelte'; - import { Fieldset, Icon, Input, Layout, Tag } from '@appwrite.io/pink-svelte'; + import { Fieldset, Icon, Input, Layout, Skeleton, Tag } from '@appwrite.io/pink-svelte'; import type { ComponentType } from 'svelte'; export let name: string; @@ -25,6 +25,7 @@ value: string; label: string; }[] = []; + export let loading = false; let showCustomId = false; @@ -51,13 +52,20 @@ {/if} {#key runtime} - + {#if loading} + + + + + {:else} + + {/if} {/key} {#if isCloud} @@ -79,12 +87,19 @@ {/if} {#if showEntrypoint} - + {#if loading} + + + + + {:else} + + {/if} {/if} diff --git a/src/routes/(console)/project-[region]-[project]/functions/create-function/repository-[repository]/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/create-function/repository-[repository]/+page.svelte index 4414e0ddc..d2ed95c5d 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/create-function/repository-[repository]/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/create-function/repository-[repository]/+page.svelte @@ -10,7 +10,7 @@ import { installation, repository } from '$lib/stores/vcs'; import { Layout } from '@appwrite.io/pink-svelte'; import { writable } from 'svelte/store'; - import { ID, Runtime, VCSDeploymentType } from '@appwrite.io/console'; + import { ID, Runtime, VCSDeploymentType, VCSDetectionType } from '@appwrite.io/console'; import type { Models } from '@appwrite.io/console'; import { onMount } from 'svelte'; import Details from '../(components)/details.svelte'; @@ -57,12 +57,40 @@ let silentMode = false; let specification = specificationOptions[0].value; + let detectingRuntime = true; + onMount(async () => { installation.set(data.installation); repository.set(data.repository); name = data.repository.name; + + await detectRuntime(); }); + async function detectRuntime() { + try { + detectingRuntime = true; + + const detections = (await sdk + .forProject(page.params.regionn, page.params.project) + .vcs.createRepositoryDetection( + data.installation.$id, + page.params.repository, + VCSDetectionType.Runtime + )) as unknown as Models.DetectionRuntime; /* SDK return type is wrong atm */ + + entrypoint = detections.entrypoint; + buildCommand = detections.commands; + runtime = detections.runtime as Runtime; + + trackEvent(Submit.FrameworkDetect, { runtime, source: 'repository' }); + } catch (error) { + trackError(error, Submit.FrameworkDetect); + } finally { + detectingRuntime = false; + } + } + async function create() { try { const func = await sdk @@ -154,7 +182,8 @@ bind:specification {specificationOptions} options={runtimeOptions} - showEntrypoint /> + showEntrypoint + loading={detectingRuntime} /> + {rootDir} + loading={detectingRuntime} /> diff --git a/src/routes/(console)/project-[region]-[project]/functions/create-function/repository-[repository]/+page.ts b/src/routes/(console)/project-[region]-[project]/functions/create-function/repository-[repository]/+page.ts index 6b98ecef0..66fc213fa 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/create-function/repository-[repository]/+page.ts +++ b/src/routes/(console)/project-[region]-[project]/functions/create-function/repository-[repository]/+page.ts @@ -3,17 +3,17 @@ import { sdk } from '$lib/stores/sdk'; export const load = async ({ parent, params, url }) => { const { installations, runtimesList, specificationsList } = await parent(); - const [repository] = await Promise.all([ - sdk - .forProject(params.region, params.project) - .vcs.getRepository(url.searchParams.get('installation'), params.repository) - ]); + const repository = await sdk + .forProject(params.region, params.project) + .vcs.getRepository(url.searchParams.get('installation'), params.repository); + + const installation = installations.installations.find( + (installation) => installation.$id === url.searchParams.get('installation') + ); return { + installation, installations, - installation: installations.installations.find( - (installation) => installation.$id === url.searchParams.get('installation') - ), repository, runtimesList, specificationsList diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/[platform]/+page@project-[region]-[project].svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/[platform]/+page@project-[region]-[project].svelte index 09335b492..7f3984344 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/[platform]/+page@project-[region]-[project].svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/[platform]/+page@project-[region]-[project].svelte @@ -98,7 +98,7 @@
{$platform.name}
-

{$platform.hostname}

+

{$platform.hostname || $platform.key}

diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createAndroid.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createAndroid.svelte index ac89f191a..ec30089b7 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createAndroid.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createAndroid.svelte @@ -91,11 +91,11 @@ const val APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.region, page. }); - -
- - - {#if !isPlatformCreated} + + + + {#if !isPlatformCreated} +
@@ -136,59 +136,60 @@ const val APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.region, page.
- {:else} - - - - - - - {$createPlatform.name} ({$createPlatform.key}) - - + + {:else} + + + + + + + {$createPlatform.name} ({$createPlatform.key}) + - - - {/if} - - - {#if isPlatformCreated} -
- - - 1. Clone the starter kit from GitHub using the terminal or Android - Studio. - - - -
- -
- - 2. Open the file and update the configuration - settings. - - -
- -
- - 3. Run the app on a connected device or emulator, then click the button to verify the setup.
-
- {/if} -
- +
+
+ {/if} + + + {#if isPlatformCreated} +
+ + + 1. If you're starting a new project, you can clone our starter kit from + GitHub using the terminal, VSCode or Android Studio. + + + +
+ +
+ + 2. Open the file and update the configuration + settings. + + +
+ +
+ + 3. Run the app on a connected device or emulator, then click the button to verify the setup. +
+
+ {/if} +
+ diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte index 20a0f1c25..d8e0098ef 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte @@ -102,116 +102,121 @@ APPWRITE_PUBLIC_ENDPOINT: "${sdk.forProject(page.params.region, page.params.proj }); - -
- - - - {#each Object.entries(platforms) as [key, value]} - - {/each} - + + + + + + + {#each Object.entries(platforms) as [key, value]} + + {/each} + - - {#if !isPlatformCreated} -
- - - + + {#if !isPlatformCreated} +
+ + + - - - - - - You can find your Bundle Identifier in the General tab for - your app's primary target in Xcode. - - - - - - - -
- {:else} - - - - - - - {$createPlatform.name} ({$createPlatform.key}) - + + + + + + You can find your Bundle Identifier in the General tab + for your app's primary target in Xcode. + + + - - - - {/if} - - {#if isPlatformCreated} -
- - - 1. Clone the starter kit from GitHub using the terminal or XCode. - - - -
- -
- - 2. Open the file and - update the configuration settings. - - -
- -
- - 3. Run the app on a connected device or simulator, then click the button to verify the setup. + submit + forceShowLoader + submissionLoader={isCreatingPlatform} + disabled={!platform || + !$createPlatform.name || + !$createPlatform.key || + isCreatingPlatform}> + Create platform + +
+
+ {:else} + + + + + + + {$createPlatform.name} ({$createPlatform.key}) + + + + -
- {/if} -
- + {/if} +
+ + + + {#if isPlatformCreated} +
+ + + 1. If you're starting a new project, you can clone our starter kit from + GitHub using the terminal or XCode. + + + +
+ +
+ + 2. Open the file and update + the configuration settings. + + +
+ +
+ + 3. Run the app on a connected device or simulator, then click the button to verify the setup. +
+
+ {/if} +
diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte index 8d0aa74df..04b2831ec 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte @@ -161,133 +161,137 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.reg }); - -
- - - - {#each Object.entries(platforms) as [key, value]} - - {/each} - + + + + + + + {#each Object.entries(platforms) as [key, value]} + + {/each} + - - {#if !isPlatformCreated} -
- - - - - - {#if platform === PlatformType.Flutterweb} + + {#if !isPlatformCreated} +
+ + - - - - {placeholder[platform].tooltip} - - - - {:else} - - - - - {placeholder[platform].tooltip} - - - - {/if} - + bind:value={$createPlatform.name} /> - - -
- {:else} - - - - - - - {$createPlatform.name} ({$createPlatform.key}) - + + {#if platform === PlatformType.Flutterweb} + + + + + {placeholder[platform].tooltip} + + + + {:else} + + + + + {placeholder[platform].tooltip} + + + + {/if} + + - - - {/if} - - - {#if isPlatformCreated} -
- - - 1. Clone the starter kit from GitHub using the terminal, Android Studio - or VSCode. - - - -
- -
- - 2. Open the file and update the configuration settings. - - -
- -
- - 3. Run the app on a connected device or simulator, then click the button to verify the setup. +
+ {:else} + + + + + + + {$createPlatform.name} ({$createPlatform.hostname || + $createPlatform.key}) + + + + -
- {/if} -
- + {/if} +
+ + + + {#if isPlatformCreated} +
+ + + 1. If you're starting a new project, you can clone our starter kit from + GitHub using the terminal, VSCode or Android Studio. + + + +
+ +
+ + 2. Open the file + and update the configuration settings. + + +
+ +
+ + 3. Run the app on a connected device or simulator, then click the button to verify the setup. +
+
+ {/if} +
diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createReactNative.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createReactNative.svelte index d8b01e0eb..95b12e2eb 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createReactNative.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createReactNative.svelte @@ -25,7 +25,6 @@ import ConnectionLine from './components/ConnectionLine.svelte'; import OnboardingPlatformCard from './components/OnboardingPlatformCard.svelte'; import { PlatformType } from '@appwrite.io/console'; - import { isCloud } from '$lib/system'; let showExitModal = false; let isPlatformCreated = false; @@ -36,10 +35,8 @@ const gitCloneCode = '\ngit clone https://github.com/appwrite/starter-for-react-native\ncd starter-for-react-native\n'; - const updateConfigCode = isCloud - ? `const APPWRITE_PROJECT_ID = "${projectId}";` - : `const APPWRITE_PROJECT_ID = "${projectId}"; -const APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.region, page.params.project).client.config.endpoint}"; + const updateConfigCode = `const EXPO_PUBLIC_APPWRITE_PROJECT_ID = "${projectId}"; +const EXPO_PUBLIC_APPWRITE_ENDPOINT = "${sdk.forProject(page.params.region, page.params.project).client.config.endpoint}"; `; export let platform: PlatformType = PlatformType.Reactnativeandroid; @@ -129,116 +126,123 @@ const APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.region, page.para }); - -
- - - - {#each Object.entries(platforms) as [key, value]} - - {/each} - - - - {#if !isPlatformCreated} -
- - - - - - - - - - {placeholder[platform].tooltip} - - - - - - - -
- {:else} - - - - - - - {$createPlatform.name} ({$createPlatform.key}) - - - - + + + + + + + {#each Object.entries(platforms) as [key, value]} + + {/each} - {/if} - - {#if isPlatformCreated} -
- - - 1. Clone the starter kit from GitHub using the terminal or VSCode. - + + {#if !isPlatformCreated} +
+ + + - -
- -
+ + + + + + {placeholder[platform].tooltip} + + + +
- 2. Open the file and update the configuration settings. - - -
- -
- - 3. Run the app on a connected device or simulator, then click the button to verify the setup. + submit + forceShowLoader + submissionLoader={isCreatingPlatform} + disabled={!platform || + !$createPlatform.name || + !$createPlatform.key || + isCreatingPlatform}> + Create platform + +
+
+ {:else} + + + + + + + {$createPlatform.name} ({$createPlatform.key}) + + + + -
- {/if} -
- + {/if} +
+ + + + {#if isPlatformCreated} +
+ + + 1. If you're starting a new project, you can clone our starter kit from + GitHub using the terminal or VSCode. + + + +
+ +
+ + 2. Add your Appwrite credentials to then rename it to if needed. + + +
+ +
+ + 3. Run the app on a connected device or simulator, then click the button to verify the setup. +
+
+ {/if} +
diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte index bb675c7a9..75ac4daa5 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte @@ -199,155 +199,150 @@ ${prefix}APPWRITE_ENDPOINT = "${sdk.forProject(page.params.region, page.params.p }); - -
- - - {#if !isPlatformCreated || isChangingFramework} -
- -
- {#each frameworks as framework} - - {/each} -
+ + + + {#if !isPlatformCreated || isChangingFramework} + + +
+ +
+ {#each frameworks as framework} + + {/each} +
+ + {#if isChangingFramework} + + {/if} + +
+
+ {#if !isChangingFramework} +
+ + + + + The hostname that your website will use to interact with the + Appwrite APIs in production or development environments. No + protocol or port number required. + + +
- {#if isChangingFramework} - - {/if} + + {/if} +
+ + {:else} + + + + {selectedFramework.label} -
- {#if !isChangingFramework} -
- - - - - The hostname that your website will use to interact with the - Appwrite APIs in production or development environments. No - protocol or port number required. - - -
- - {/if} - {:else} - - - - {selectedFramework.label} - - - - {/if} + +
+ {/if} - - {#if isPlatformCreated && !isChangingFramework} -
- - - 1. Clone the starter kit from GitHub using the terminal or VSCode. - + + {#if isPlatformCreated && !isChangingFramework} +
+ + + 1. If you're starting a new project, you can clone our starter kit from + GitHub using the terminal or VSCode. + - -
- -
- - {#if selectedFramework.key === 'angular'} - 2. Change - to reflect the values below: - {:else} - 2. Rename into and update the values. - {/if} - - -
- -
+ +
+ +
+ {#if selectedFramework.key === 'angular'} 3. Install project dependencies - - -
- -
- - 4. Run the app, then click the 2. Change button to verify the setup. - -
- -
-
-
- - - Demo app runs on http://localhost:{selectedFramework.portNumber} - - {/if} -
- + code="src/environments/environment.ts" /> + to reflect the values below: + {:else} + 2. Add your Appwrite credentials to then rename it to if needed. + {/if} + + +
+ +
+ + 3. Install project dependencies + + +
+ +
+ + 4. Run the app, then click the button + to verify the setup. + +
+ +
+ +
+ + + Demo app runs on http://localhost:{selectedFramework.portNumber} + + {/if} +
diff --git a/src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte b/src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte index 81ee6ada9..24b82ae7b 100644 --- a/src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte @@ -34,8 +34,14 @@ $: dbWrites = data.usage.databasesWrites; $: legendData = [ - { name: 'Reads', value: data.usage.databasesReadsTotal }, - { name: 'Writes', value: data.usage.databasesWritesTotal } + { + name: 'Reads', + value: data.usage.databasesReads.reduce((sum, item) => sum + item.value, 0) + }, + { + name: 'Writes', + value: data.usage.databasesWrites.reduce((sum, item) => sum + item.value, 0) + } ]; const tier = data?.currentInvoice?.plan ?? $organization?.billingPlan; diff --git a/src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/repository-[repository]/+page.svelte b/src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/repository-[repository]/+page.svelte index a061a490f..f08f635a1 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/repository-[repository]/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/repository-[repository]/+page.svelte @@ -62,7 +62,7 @@ .forProject(page.params.region, page.params.project) .vcs.createRepositoryDetection( $installation.$id, - data.repository.id, + page.params.repository, VCSDetectionType.Framework, rootDir ); diff --git a/src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/repository-[repository]/+page.ts b/src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/repository-[repository]/+page.ts index f5607d122..de559a2f3 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/repository-[repository]/+page.ts +++ b/src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/repository-[repository]/+page.ts @@ -5,11 +5,14 @@ import { buildVerboseDomain } from '../../store'; export const load = async ({ parent, params, url }) => { const { installations, frameworks, project, organization, regionalConsoleVariables } = await parent(); - const [repository] = await Promise.all([ - sdk - .forProject(params.region, params.project) - .vcs.getRepository(url.searchParams.get('installation'), params.repository) - ]); + + const repository = await sdk + .forProject(params.region, params.project) + .vcs.getRepository(url.searchParams.get('installation'), params.repository); + + const installation = installations.installations.find( + (installation) => installation.$id === url.searchParams.get('installation') + ); const domain = await buildVerboseDomain( regionalConsoleVariables._APP_DOMAIN_SITES, @@ -21,9 +24,7 @@ export const load = async ({ parent, params, url }) => { return { installations, - installation: installations.installations.find( - (installation) => installation.$id === url.searchParams.get('installation') - ), + installation, repository, frameworks, domain