diff --git a/.env.example b/.env.example index 4c584201d..e490a6ef4 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -VITE_APPWRITE_ENDPOINT= +VITE_APPWRITE_ENDPOINT=http://localhost/v1 VITE_APPWRITE_GROWTH_ENDPOINT= VITE_GA_PROJECT= VITE_CONSOLE_MODE=self-hosted \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1f4ef8396..aaac70173 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,11 +22,11 @@ jobs: # run: npm audit --audit-level low - name: Install dependencies run: npm ci - - name: Build Console - run: npm run build - name: Svelte Diagnostics run: npm run check - name: Linter run: npm run lint - name: Unit Tests run: npm test + - name: Build Console + run: npm run build diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a723620ce..60baa93de 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,25 +10,30 @@ If you are worried about or don’t know where to start, check out the next sect ``` ├── src -│ ├── lib // All non-route components, accessible over "import ... from '$lib'" -│ │ ├── components // Re-usable components -│ │ ├── elements // Re-usable elements -│ │ ├── layout // Global components for the layout (Nav/Content/Container) -│ │ └── stores // Global stores (state management) -│ └─── routes -│ ├── console // Routes that need authentication -│ │ ├──[project] -│ │ │ ├── database // Database Service -│ │ │ │ ├── [collection] // Nested Route for the collection "/console/[PROJECT_ID]/database/[COLLECTION_ID]" -│ │ │ │ ├── _create.svelte // Component to Create collections -│ │ │ │ └── index.svelte // Entrypoint for "/console/[PROJECT_ID]/database" -│ │ │ ├── storage // Storage Service "/console/[PROJECT]/storage" -│ │ │ └── auth // Users Service "/console/[PROJECT]/auth" -│ │ └──... -│ ├── login.svelte // Component for Login "/console/login" -│ └── register.svelte // Component for Register "/console/register" -├── build // Compiled application -└── static // Static assets +│ ├── lib // Reusable logic (accessible with '$lib') +│ │ ├── actions // Svelte actions +│ │ ├── charts // Chart components +│ │ ├── components // Re-usable components +│ │ ├── elements // Re-usable elements +│ │ ├── helpers // Small functions used through out the console +│ │ ├── images // Images used in the console +│ │ ├── layout // Global components for the layout (Nav/Content/Container) +│ │ ├── mock // Mock components used for testing +│ │ └── stores // Global stores (state management) +│ └── routes +│ └── console // Routes that need authentication +│ │ └── project-[project] +│ │ │ └── database // Database Service +│ │ │ │ ├── +layout.svelte // Layout head and other logic like realtime events is set here +│ │ │ │ ├── +layout.ts // Layout data is set here (Header, Breadcrumbs, ...) +│ │ │ │ ├── +page.svelte // Page displayed on "/console/project-[PROJECT_ID]/database" +│ │ │ │ ├── +page.ts // Necessary data for the page is fetched here +│ │ │ │ └── create.svelte // Component to create databases +│ │ │ └── ... // Other services +│ │ └── ... +│ └── ... // Routes that don't need authentication +├── build // Compiled application +└── static // Static assets ``` ## Development @@ -41,11 +46,19 @@ git clone https://github.com/appwrite/console.git appwrite-console ### 2. Install dependencies with npm +Navigate to the Appwrite Console repository and install dependencies. + ```bash -npm install +cd appwrite-console && npm install ``` -### 3. Setup environment variables +### 3. Install and run Appwrite locally + +When you run the Appwrite Console locally, it needs to point to a backend as well. The easiest way to do this is to run an Appwrite instance locally. + +Follow the [install instructions](https://appwrite.io/docs/installation) in the Appwrite docs. + +### 4. Setup environment variables Add a `.env` file by copying the `.env.example` file as a template in the project's root directory. diff --git a/src/lib/components/empty.svelte b/src/lib/components/empty.svelte index ab7d091a4..2c01f69fa 100644 --- a/src/lib/components/empty.svelte +++ b/src/lib/components/empty.svelte @@ -42,7 +42,7 @@
Create your first {target} to get started.

- Need a hand? Check out our documentation. + Need a hand? Learn more in our documentation.

diff --git a/src/lib/components/id.svelte b/src/lib/components/id.svelte index e73a5b452..1b618f3d2 100644 --- a/src/lib/components/id.svelte +++ b/src/lib/components/id.svelte @@ -31,7 +31,7 @@ } } } - checkOverflow(); + requestAnimationFrame(checkOverflow); window.addEventListener('resize', checkOverflow); return { @@ -46,22 +46,22 @@ } -
- - - -
- + +
+ + + +
- +
-
+ diff --git a/src/lib/components/permissions/team.svelte b/src/lib/components/permissions/team.svelte index 7b214f534..fdd4c5e9c 100644 --- a/src/lib/components/permissions/team.svelte +++ b/src/lib/components/permissions/team.svelte @@ -134,7 +134,7 @@ You have no teams. Create a team to see them here.

- Need a hand? Check out our diff --git a/src/lib/components/permissions/user.svelte b/src/lib/components/permissions/user.svelte index 4488d8f01..5835023b6 100644 --- a/src/lib/components/permissions/user.svelte +++ b/src/lib/components/permissions/user.svelte @@ -153,7 +153,7 @@ You have no users. Create a user to see them here.

- Need a hand? Check out our diff --git a/src/lib/elements/forms/inputNumber.svelte b/src/lib/elements/forms/inputNumber.svelte index 7c36615e0..5110e4eea 100644 --- a/src/lib/elements/forms/inputNumber.svelte +++ b/src/lib/elements/forms/inputNumber.svelte @@ -84,7 +84,7 @@ bind:value bind:this={element} on:invalid={handleInvalid} - style:--amount-of-buttons={required ? 0 : 1.75} /> + style:--amount-of-buttons={nullable && !required ? 1.75 : 0} />

{#if error} {error} diff --git a/src/lib/elements/forms/inputTextarea.svelte b/src/lib/elements/forms/inputTextarea.svelte index 7a9c121a6..a5a096b35 100644 --- a/src/lib/elements/forms/inputTextarea.svelte +++ b/src/lib/elements/forms/inputTextarea.svelte @@ -50,6 +50,9 @@ value = prevValue; } } + + $: showTextCounter = !!maxlength; + $: showNullCheckbox = nullable && !required; @@ -72,20 +75,22 @@ bind:this={element} on:invalid={handleInvalid} style:--amount-of-buttons={required ? undefined : 0.25} /> -
    - {#if maxlength} -
  • - -
  • - {/if} - {#if nullable && !required} -
  • - -
  • - {/if} -
+ {#if showTextCounter || showNullCheckbox} +
    + {#if showTextCounter} +
  • + +
  • + {/if} + {#if showNullCheckbox} +
  • + +
  • + {/if} +
+ {/if}
{#if error} diff --git a/src/lib/elements/forms/inputURL.svelte b/src/lib/elements/forms/inputURL.svelte index 848bc5532..5c7a1178a 100644 --- a/src/lib/elements/forms/inputURL.svelte +++ b/src/lib/elements/forms/inputURL.svelte @@ -1,6 +1,8 @@ @@ -66,9 +74,21 @@ type="url" autocomplete={autocomplete ? 'on' : 'off'} bind:value - on:input={handleInput} bind:this={element} on:invalid={handleInvalid} /> + {#if error} {error} diff --git a/src/lib/elements/table/tableScroll.svelte b/src/lib/elements/table/tableScroll.svelte index 814fe00e5..6d30f8aff 100644 --- a/src/lib/elements/table/tableScroll.svelte +++ b/src/lib/elements/table/tableScroll.svelte @@ -2,11 +2,28 @@ import type { Action } from 'svelte/action'; export let isSticky = false; + let isOverflowing = false; - const hasOverflow: Action void> = (node, callback) => { + const hasOverflow: Action = (node) => { const observer = new ResizeObserver((entries) => { for (const entry of entries) { - callback(entry.contentRect.width < entry.target.scrollWidth); + let overflowing = false; + if (entry.contentRect.width < entry.target.scrollWidth) { + overflowing = true; + } + + const cols = entry.target.querySelectorAll('.table-thead-col'); + for (let i = 0; i < cols.length; i++) { + const col = cols[i]; + const cs = getComputedStyle(col); + const innerWidth = + col.clientWidth - parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight); + if (innerWidth < 32) { + overflowing = true; + } + } + + isOverflowing = overflowing; } }); @@ -18,12 +35,10 @@ } }; }; - - let isOverflowing = false;
-
(isOverflowing = v)}> +
diff --git a/src/lib/helpers/copy.ts b/src/lib/helpers/copy.ts index 6399995ea..4c3779ffc 100644 --- a/src/lib/helpers/copy.ts +++ b/src/lib/helpers/copy.ts @@ -11,6 +11,12 @@ async function securedCopy(value: string) { function unsecuredCopy(value: string) { const textArea = document.createElement('textarea'); textArea.value = value; + + // Avoid scrolling to bottom + textArea.style.top = '0'; + textArea.style.left = '0'; + textArea.style.position = 'fixed'; + document.body.appendChild(textArea); textArea.focus(); textArea.select(); diff --git a/src/routes/console/project-[project]/auth/gitlabOAuth.svelte b/src/routes/console/project-[project]/auth/gitlabOAuth.svelte index 2b5aea8a6..934d73801 100644 --- a/src/routes/console/project-[project]/auth/gitlabOAuth.svelte +++ b/src/routes/console/project-[project]/auth/gitlabOAuth.svelte @@ -81,7 +81,7 @@ disabled={(secret === provider.secret && enabled === provider.enabled && appId === provider.appId) || - !(appId && clientSecret && endpoint)} + !(appId && clientSecret)} submit>Update diff --git a/src/routes/console/project-[project]/auth/settings/+page.svelte b/src/routes/console/project-[project]/auth/settings/+page.svelte index eba59cea4..42f640d07 100644 --- a/src/routes/console/project-[project]/auth/settings/+page.svelte +++ b/src/routes/console/project-[project]/auth/settings/+page.svelte @@ -1,17 +1,17 @@ - + placeholder="Select a value" + disabled={data.required || data.array} + options={[ + { label: 'NULL', value: null }, + { label: 'True', value: true }, + { label: 'False', value: false } + ]} + bind:value={data.default} /> Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte index 4315f1319..21886dc1f 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte @@ -48,7 +48,7 @@ id="default" label="Default value" bind:value={data.default} - disabled={data.required} /> + disabled={data.required || data.array} /> Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte index 72bb2eaf7..e4ea11990 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte @@ -71,31 +71,19 @@ {#if selectedAttribute?.type !== 'relationship'} -
- - -
-
-
+ {/if} {#if option} (option = null)} /> {/if}
diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/email.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/email.svelte index 6da9089f5..3222edaf6 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/email.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/email.svelte @@ -50,7 +50,8 @@ label="Default value" placeholder="Enter value" bind:value={data.default} - disabled={data.required} /> + disabled={data.required || data.array} + nullable={!data.required && !data.array} /> Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte index a8e166a2a..5996689ea 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte @@ -36,8 +36,7 @@ - - Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte index 9e07b3e87..b641880d0 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte @@ -54,9 +54,20 @@ } - - - + + Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte index d68ef0976..450fbac14 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte @@ -54,9 +54,18 @@ } - - - + + + disabled={data.required || data.array} + nullable={!data.required && !data.array} /> Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte index b59473958..3bba15ad6 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte @@ -48,7 +48,8 @@ label="Default value" placeholder="Enter value" bind:value={data.default} - disabled={data.required || data.array} /> + disabled={data.required || data.array} + nullable={!data.required && !data.array} /> Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte index f847e0ebd..501ee1dc5 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte @@ -98,7 +98,6 @@ }); // Reactive statements - $: getCollections(search).then((res) => (collectionList = res)); $: collections = collectionList?.collections?.filter((n) => n.$id !== $collection.$id) ?? []; @@ -219,7 +218,6 @@ placeholder="Select a relation" options={relationshipType} disabled={editing} /> -
diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte index bbf9175bd..a52135d8d 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte @@ -34,8 +34,7 @@ + bind:value /> diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/enum.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/enum.svelte index 7a5103da8..9f88aaa57 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/enum.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/enum.svelte @@ -7,7 +7,6 @@ export let value: string; export let attribute: Models.AttributeEnum; export let optionalText: string | undefined = undefined; - export let disabled = false; $: options = [ ...attribute.elements.map((element) => { @@ -31,5 +30,4 @@ {optionalText} required={attribute.required} placeholder="Select a value" - showLabel={!!label?.length} - {disabled} /> + showLabel={!!label?.length} /> diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/integer.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/integer.svelte index d490f0e3d..22360ff6f 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/integer.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/integer.svelte @@ -17,5 +17,5 @@ required={attribute.required} min={attribute.min} max={attribute.max} - bind:value - step={attribute.type === 'double' ? 'any' : 1} /> + step={attribute.type === 'double' ? 'any' : 1} + bind:value /> diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte index c12654564..f01e54ca5 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte @@ -3,12 +3,12 @@ import { PaginationInline } from '$lib/components'; import { SelectSearchItem } from '$lib/elements'; import { Button, InputSelectSearch, Label } from '$lib/elements/forms'; + import { preferences } from '$lib/stores/preferences'; import { sdk } from '$lib/stores/sdk'; import { Query, type Models } from '@appwrite.io/console'; import { onMount } from 'svelte'; import { doc } from '../store'; import { isRelationshipToMany } from './store'; - import { preferences } from '$lib/stores/preferences'; export let id: string; export let label: string; @@ -32,7 +32,7 @@ onMount(async () => { if (value) { if (isRelationshipToMany(attribute)) { - relatedList = value as string[]; + relatedList = (value as string[]).slice(); } else { singleRel = value as string; } diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/string.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/string.svelte index ecb1c613e..d5c32fa59 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/string.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/string.svelte @@ -7,30 +7,27 @@ export let value: string; export let attribute: Models.AttributeString; export let optionalText: string | undefined = undefined; - export let disabled = false; {#if attribute.size >= 50} {:else} {/if} diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/url.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/url.svelte index cbff896fa..b745348d9 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/url.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/url.svelte @@ -15,5 +15,6 @@ {optionalText} placeholder="Enter URL" showLabel={!!label?.length} + nullable={!attribute.required} required={attribute.required} bind:value /> diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte index 605450998..81cc43c89 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte @@ -125,7 +125,7 @@
Create your first attribute to get started.

- Need a hand? Check out our documentation. + Need a hand? Learn more in our documentation.

diff --git a/src/routes/console/project-[project]/databases/database-[database]/table.svelte b/src/routes/console/project-[project]/databases/database-[database]/table.svelte index 317956ae7..458baaa62 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/table.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/table.svelte @@ -3,13 +3,13 @@ import { page } from '$app/stores'; import { Id } from '$lib/components'; import { - Table, TableBody, TableCell, TableCellHead, TableCellText, TableHeader, - TableRowLink + TableRowLink, + TableScroll } from '$lib/elements/table'; import { toLocaleDateTime } from '$lib/helpers/date'; import type { PageData } from './$types'; @@ -20,7 +20,7 @@ const databaseId = $page.params.database; - + {#each $columns as column} {#if column.show} @@ -54,4 +54,4 @@ {/each} -
+ diff --git a/src/routes/console/project-[project]/databases/table.svelte b/src/routes/console/project-[project]/databases/table.svelte index 401364401..ac63aa184 100644 --- a/src/routes/console/project-[project]/databases/table.svelte +++ b/src/routes/console/project-[project]/databases/table.svelte @@ -3,13 +3,13 @@ import { page } from '$app/stores'; import { Id } from '$lib/components'; import { - Table, TableBody, TableCell, TableCellHead, TableCellText, TableHeader, - TableRowLink + TableRowLink, + TableScroll } from '$lib/elements/table'; import { toLocaleDateTime } from '$lib/helpers/date'; import type { PageData } from './$types'; @@ -19,7 +19,7 @@ const projectId = $page.params.project; - + {#each $columns as column} {#if column.show} @@ -55,4 +55,4 @@ {/each} -
+ diff --git a/src/routes/console/project-[project]/functions/function-[function]/create.svelte b/src/routes/console/project-[project]/functions/function-[function]/create.svelte index 806ff23ca..4d65e044b 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/create.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/create.svelte @@ -62,10 +62,10 @@ function setCodeSnippets(lang: string) { return { Unix: { - code: `appwrite functions createDeployment \\ - --functionId=${functionId} \\ - --entrypoint='index.${lang}' \\ - --code="." \\ + code: `appwrite functions createDeployment \\ + --functionId=${functionId} \\ + --entrypoint='index.${lang}' \\ + --code="." \\ --activate=true`, language: 'bash' }, diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index fb36561ff..1e783436d 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -110,7 +110,7 @@

You have no execution logs. Create and activate a deployment to see it here.

-

Need a hand? Check out our documentation

+

Need a hand? Learn more in our documentation

- - - -
- - Name - - -
    - -
-
- - - - -
-
- -
- - Execute Access -

- Choose who can execute this function using the client API. For more information, - check out the - Permissions Guide - . -

- - - - - - - -
- - + + + - -
- - Schedule -

- Set a Cron schedule to trigger your function. Leave blank for no schedule. - More details on Cron syntax here. -

- - - - - - - - - - -
- - - Variables -

Set the variables (or secret keys) that will be passed to your function at runtime.

- -
- - -
- {@const limit = 10} - {@const sum = data.variables.total} - {#if sum} -
- - - Key - Value - - - - {#each data.variables.variables.slice(offset, offset + limit) as variable, i} - - - - {variable.key} - - - - - - - - - - - { - selectedVar = variable; - showVariablesDropdown[i] = false; - showVariablesModal = true; - }}> - Edit - - { - handleVariableDeleted(variable); - showVariablesDropdown[i] = false; - }}> - Delete - - - - - - {/each} - -
- -
-

Total variables: {sum}

- -
-
- {:else} - (showVariablesModal = !showVariablesModal)}> - Create a variable to get started - - {/if} -
-
- -
- - Timeout -

- Limit the execution time of your function. Maximum value is 900 seconds (15 - minutes). -

- - - - - - - - - -
-
- - - Delete Function -

- The function will be permanently deleted, including all deployments associated with it. - This action is irreversible. -

- - - -
{$func.name}
-
-

Last Updated: {toLocaleDateTime($func.$updatedAt)}

-
-
- - - - -
+ + + + - - -{#if showVariablesModal} - -{/if} -{#if showVariablesUpload} - -{/if} diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/dangerZone.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/dangerZone.svelte new file mode 100644 index 000000000..d5ec9fbf4 --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/dangerZone.svelte @@ -0,0 +1,33 @@ + + + + Delete Function +

+ The function will be permanently deleted, including all deployments associated with it. This + action is irreversible. +

+ + + +
{$func.name}
+
+

Last Updated: {toLocaleDateTime($func.$updatedAt)}

+
+
+ + + + +
+ + diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/delete.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/deleteModal.svelte similarity index 100% rename from src/routes/console/project-[project]/functions/function-[function]/settings/delete.svelte rename to src/routes/console/project-[project]/functions/function-[function]/settings/deleteModal.svelte diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/executeFunction.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/executeFunction.svelte new file mode 100644 index 000000000..194b18bed --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/executeFunction.svelte @@ -0,0 +1,36 @@ + + + +
+
+ technology +
+
+ {$func.name} + +

{$func.runtime}

+
+
+ +
+
+

Function ID: {$func.$id}

+

Created at: {toLocaleDateTime($func.$createdAt)}

+

Updated at: {toLocaleDateTime($func.$updatedAt)}

+
+
+
+ + + + +
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateName.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateName.svelte new file mode 100644 index 000000000..431d12e5f --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateName.svelte @@ -0,0 +1,66 @@ + + +
+ + Name + + +
    + +
+
+ + + + +
+
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updatePermissions.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updatePermissions.svelte new file mode 100644 index 000000000..369f936a9 --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updatePermissions.svelte @@ -0,0 +1,78 @@ + + +
+ + Execute Access +

+ Choose who can execute this function using the client API. For more information, check + out the + Permissions Guide + . +

+ + + + + + + +
+
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte new file mode 100644 index 000000000..e60ba6e99 --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte @@ -0,0 +1,71 @@ + + +
+ + Schedule +

+ Set a Cron schedule to trigger your function. Leave blank for no schedule. + More details on Cron syntax here. +

+ + + + + + + + + +
+
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateTimeout.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateTimeout.svelte new file mode 100644 index 000000000..94489f929 --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateTimeout.svelte @@ -0,0 +1,66 @@ + + +
+ + Timeout +

Limit the execution time of your function. Maximum value is 900 seconds (15 minutes).

+ + + + + + + + + +
+
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateVariables.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateVariables.svelte new file mode 100644 index 000000000..c3915babc --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateVariables.svelte @@ -0,0 +1,233 @@ + + + + Variables +

Set the variables (or secret keys) that will be passed to your function at runtime.

+ +
+ + +
+ {@const limit = 10} + {@const sum = variableList.total} + {#if sum} +
+ + + Key + Value + + + + {#each variableList.variables.slice(offset, offset + limit) as variable, i} + + + + {variable.key} + + + + + + + + + + + { + selectedVar = variable; + showVariablesDropdown[i] = false; + showVariablesModal = true; + }}> + Edit + + { + handleVariableDeleted(variable); + showVariablesDropdown[i] = false; + }}> + Delete + + + + + + {/each} + +
+ +
+

Total variables: {sum}

+ +
+
+ {:else} + (showVariablesModal = !showVariablesModal)}> + Create a variable to get started + + {/if} +
+
+ +{#if showVariablesModal} + +{/if} +{#if showVariablesUpload} + +{/if} diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariablesModal.svelte similarity index 100% rename from src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte rename to src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariablesModal.svelte diff --git a/src/routes/console/project-[project]/overview/keys/[key]/+page.ts b/src/routes/console/project-[project]/overview/keys/[key]/+page.ts index 1c8f8a44d..e235ed2d6 100644 --- a/src/routes/console/project-[project]/overview/keys/[key]/+page.ts +++ b/src/routes/console/project-[project]/overview/keys/[key]/+page.ts @@ -10,6 +10,8 @@ export const load: PageLoad = async ({ params, depends }) => { const key = await sdk.forConsole.projects.getKey(params.project, params.key); if (key.expire) { key.expire = new Date(key.expire).toISOString().slice(0, 23); + } else { + key.expire = undefined; } return { diff --git a/src/routes/console/project-[project]/overview/platforms/+page.svelte b/src/routes/console/project-[project]/overview/platforms/+page.svelte index 328e7d88d..5c2332b05 100644 --- a/src/routes/console/project-[project]/overview/platforms/+page.svelte +++ b/src/routes/console/project-[project]/overview/platforms/+page.svelte @@ -142,7 +142,7 @@
Create your first platform to get started.

- Need a hand? Check out our documentation. + Need a hand? Learn more in our documentation.

diff --git a/src/routes/console/project-[project]/overview/platforms/wizard/flutter/step2.svelte b/src/routes/console/project-[project]/overview/platforms/wizard/flutter/step2.svelte index 7d7dc3551..a47e93a8d 100644 --- a/src/routes/console/project-[project]/overview/platforms/wizard/flutter/step2.svelte +++ b/src/routes/console/project-[project]/overview/platforms/wizard/flutter/step2.svelte @@ -5,7 +5,7 @@ const example1 = `dependencies: appwrite: ^${$versions['client-flutter']}`; - const example2 = `pub get appwrite`; + const example2 = `flutter pub add appwrite`; diff --git a/src/routes/console/project-[project]/overview/platforms/wizard/web/step2.svelte b/src/routes/console/project-[project]/overview/platforms/wizard/web/step2.svelte index 9699669ff..bff1c05dc 100644 --- a/src/routes/console/project-[project]/overview/platforms/wizard/web/step2.svelte +++ b/src/routes/console/project-[project]/overview/platforms/wizard/web/step2.svelte @@ -35,8 +35,12 @@ {#if method === Method.NPM}

- Use NPM (node package manager) from your command line to add Appwrite SDK to your project. + Use NPM (node package manager) from your command line to add Appwrite SDK + to your project.

diff --git a/src/routes/console/project-[project]/settings/+page.svelte b/src/routes/console/project-[project]/settings/+page.svelte index ccce2b50b..cf8659329 100644 --- a/src/routes/console/project-[project]/settings/+page.svelte +++ b/src/routes/console/project-[project]/settings/+page.svelte @@ -115,7 +115,10 @@ Services -

Choose services you wish to enable or disable.

+

+ Choose services you wish to enable or disable for the client API. When disabled, the + services are not accessible to client SDKs but remain accessible to server SDKs. +

diff --git a/src/routes/console/project-[project]/settings/webhooks/+page.svelte b/src/routes/console/project-[project]/settings/webhooks/+page.svelte index fde1c291e..1e22b243a 100644 --- a/src/routes/console/project-[project]/settings/webhooks/+page.svelte +++ b/src/routes/console/project-[project]/settings/webhooks/+page.svelte @@ -6,13 +6,13 @@ import { Button } from '$lib/elements/forms'; import { Pill } from '$lib/elements'; import { - Table, TableBody, TableRowLink, TableCellHead, TableCell, TableCellText, - TableHeader + TableHeader, + TableScroll } from '$lib/elements/table'; import { Container } from '$lib/layout'; import { wizard } from '$lib/stores/wizard'; @@ -46,10 +46,10 @@
{#if data.webhooks.total} - + - Name - POST URL + Name + POST URL Events @@ -57,7 +57,7 @@ -
+
{webhook.name} {#if webhook.security === false} SLL/TLS disabled @@ -69,7 +69,7 @@ {/each} -
+ {:else} {$bucket?.name} - Bucket ID + {#if $bucket?.$id} + {$bucket.$id} + {/if}