diff --git a/package-lock.json b/package-lock.json index ad6057f69..65e610578 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "dependencies": { "@analytics/google-analytics": "^1.0.5", - "@aw-labs/appwrite-console": "npm:matej-appwrite-console@7.1.10", + "@aw-labs/appwrite-console": "npm:matej-appwrite-console@7.1.12", "@aw-labs/icons": "0.0.0-77", "@aw-labs/ui": "0.0.0-77", "@popperjs/core": "^2.11.6", @@ -146,9 +146,9 @@ }, "node_modules/@aw-labs/appwrite-console": { "name": "matej-appwrite-console", - "version": "7.1.10", - "resolved": "https://registry.npmjs.org/matej-appwrite-console/-/matej-appwrite-console-7.1.10.tgz", - "integrity": "sha512-GlNTTkJ5iHpUYgyJ3rexeGmCdD2WQ0zwSw6yFA2lf4aLVh+VuZQdoEEmW0K1dpTnBtg8EGkqhMCIIZTRV4mgcw==", + "version": "7.1.12", + "resolved": "https://registry.npmjs.org/matej-appwrite-console/-/matej-appwrite-console-7.1.12.tgz", + "integrity": "sha512-5vHZZKR/d6cf1xlia38fKubZkUBnio6KuTgFUKRpoh0NzdNNMeavKD1KsWC1mH/hpKnhzVks+h2Y5zZq2ShD8g==", "dependencies": { "cross-fetch": "3.1.5", "isomorphic-form-data": "2.0.0" @@ -7741,9 +7741,9 @@ "integrity": "sha512-1Yw7u/COtxx06BfwlI+kVhsa/upKYzmCNrT4c8QDeCY2KMYlnijkUjtHiPU08HxyTIVB5j6d75O0YWVIHwQS8g==" }, "@aw-labs/appwrite-console": { - "version": "npm:matej-appwrite-console@7.1.10", - "resolved": "https://registry.npmjs.org/matej-appwrite-console/-/matej-appwrite-console-7.1.10.tgz", - "integrity": "sha512-GlNTTkJ5iHpUYgyJ3rexeGmCdD2WQ0zwSw6yFA2lf4aLVh+VuZQdoEEmW0K1dpTnBtg8EGkqhMCIIZTRV4mgcw==", + "version": "npm:matej-appwrite-console@7.1.12", + "resolved": "https://registry.npmjs.org/matej-appwrite-console/-/matej-appwrite-console-7.1.12.tgz", + "integrity": "sha512-5vHZZKR/d6cf1xlia38fKubZkUBnio6KuTgFUKRpoh0NzdNNMeavKD1KsWC1mH/hpKnhzVks+h2Y5zZq2ShD8g==", "requires": { "cross-fetch": "3.1.5", "isomorphic-form-data": "2.0.0" diff --git a/package.json b/package.json index 39b8a04f9..54edb2aed 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "dependencies": { "@analytics/google-analytics": "^1.0.5", "analytics": "^0.8.1", - "@aw-labs/appwrite-console": "npm:matej-appwrite-console@7.1.10", + "@aw-labs/appwrite-console": "npm:matej-appwrite-console@7.1.12", "@aw-labs/icons": "0.0.0-77", "@aw-labs/ui": "0.0.0-77", "@popperjs/core": "^2.11.6", diff --git a/src/lib/components/code.svelte b/src/lib/components/code.svelte index f5b23ab26..ab0505d91 100644 --- a/src/lib/components/code.svelte +++ b/src/lib/components/code.svelte @@ -2,10 +2,10 @@ import { Pill } from '$lib/elements'; import Prism from 'prismjs'; import 'prismjs/components/prism-ruby'; - import 'prismjs/components/prism-php'; import 'prismjs/components/prism-dart'; import 'prismjs/components/prism-kotlin'; import 'prismjs/components/prism-python'; + import 'prismjs/components/prism-javascript'; import 'prismjs/components/prism-json'; import 'prismjs/components/prism-bash'; import 'prismjs/components/prism-yaml'; diff --git a/src/lib/components/environmentVariables/snippet.svelte b/src/lib/components/environmentVariables/snippet.svelte index adee0be5c..40909417e 100644 --- a/src/lib/components/environmentVariables/snippet.svelte +++ b/src/lib/components/environmentVariables/snippet.svelte @@ -51,6 +51,7 @@ Swift +

Code snippet showing how to read environment variables in Appwrite Functions.

{#if language === Language.NodeJs} diff --git a/src/lib/components/environmentVariables/variables.svelte b/src/lib/components/environmentVariables/variables.svelte index b0d0d3328..08d717b86 100644 --- a/src/lib/components/environmentVariables/variables.svelte +++ b/src/lib/components/environmentVariables/variables.svelte @@ -230,6 +230,7 @@ on:click={() => { snippetKey = variable.key; showSnippet = true; + showVariablesDropdown[i] = false; }}> Code snippets 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 c8e2f9e08..2c70e47da 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/create.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/create.svelte @@ -173,7 +173,7 @@ placeholder={`main.${lang}`} id="entrypoint" bind:value={entrypoint} - required /> + required={false} /> This deployment will be activated after the build is completed. diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte index 477eaaa9f..4f9ee26d4 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte @@ -35,6 +35,7 @@ let permissions: string[] = []; let arePermsDisabled = true; let logging: boolean = null; + let entrypoint: string = null; const eventSet: Writable> = writable(new Set()); let showEvents = false; @@ -46,6 +47,7 @@ functionSchedule ??= $func.schedule; permissions = $func.execute; logging = $func.logging; + entrypoint ??= $func.entrypoint; $eventSet = new Set($func.events); }); @@ -59,7 +61,8 @@ $func.schedule, $func.timeout, $func.enabled, - $func.logging + $func.logging, + $func.entrypoint ); invalidate(Dependencies.FUNCTION); addNotification({ @@ -85,7 +88,8 @@ $func.schedule, $func.timeout, $func.enabled, - logging + logging, + $func.entrypoint ); invalidate(Dependencies.FUNCTION); addNotification({ @@ -111,7 +115,8 @@ $func.schedule, $func.timeout, $func.enabled, - $func.logging + $func.logging, + $func.entrypoint ); invalidate(Dependencies.FUNCTION); addNotification({ @@ -137,7 +142,8 @@ $func.schedule, $func.timeout, $func.enabled, - $func.logging + $func.logging, + $func.entrypoint ); invalidate(Dependencies.FUNCTION); addNotification({ @@ -163,7 +169,8 @@ functionSchedule, $func.timeout, $func.enabled, - $func.logging + $func.logging, + $func.entrypoint ); invalidate(Dependencies.FUNCTION); @@ -190,7 +197,8 @@ $func.schedule, timeout, $func.enabled, - $func.logging + $func.logging, + $func.entrypoint ); invalidate(Dependencies.FUNCTION); @@ -207,6 +215,34 @@ } } + async function updateDeploymentSettings() { + try { + await sdkForProject.functions.update( + functionId, + $func.name, + $func.execute, + $func.events, + $func.schedule, + $func.timeout, + $func.enabled, + $func.logging, + entrypoint + ); + + invalidate(Dependencies.FUNCTION); + addNotification({ + type: 'success', + message: 'Deployment settings has been updated' + }); + trackEvent('submit_function_update_deployment_settings'); + } catch (error) { + addNotification({ + type: 'error', + message: error.message + }); + } + } + function handleEvent(event: CustomEvent) { eventSet.set($eventSet.add(event.detail)); } @@ -290,6 +326,31 @@ +
+ + Update Deployment Settings +

+ These settings are used default values when creating a deployment. They can be + ovewritten when creating deployment. +

+ +
    + +
+
+ + + +
+
+
Update Logging