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 d40e12da5..2a8bb7130 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 @@ -91,6 +91,29 @@ }); } } + + function downloadVariables() { + let data = Object.keys($func.vars) + .map((key) => { + return `${key}=${$func.vars[key]}`; + }) + .join('\n'); + const file = new File([data], '.env', { + type: 'application/x-envoy' + }); + + console.log(file); + const link = document.createElement('a'); + const url = URL.createObjectURL(file); + + link.href = url; + link.download = file.name; + document.body.appendChild(link); + link.click(); + + document.body.removeChild(link); + window.URL.revokeObjectURL(url); + } @@ -185,6 +208,16 @@

Update Function Variables

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

+
+ + +