-
+
Connect Git repository
Create and deploy a function with a connected git repository.
@@ -81,36 +75,34 @@
on:connect={connect} />
-
- You can also create a function
- or using the CLI.
- Learn more.
-
-
+
Quick start
Use a starter templates to begin with the basics.
-
- {#await loadRuntimes()}
-
- {:then runtimes}
-
+
+ {#await $runtimes}
+ {#each Array(6) as _i}
+ -
+
+
+ {/each}
+ {:then response}
+ {@const runtimes = response.runtimes}
{#each quickStart.runtimes.filter((_template, index) => index < 6) as runtime}
{@const runtimeDetail = runtimes.find(
(r) => r.$id === runtime.name
@@ -150,8 +142,8 @@
{/if}
-
- {/await}
+ {/await}
+
+
+ You can also create a function
+ or using the CLI.
+ Learn more.
+
diff --git a/src/lib/wizards/functions/steps/details.svelte b/src/lib/wizards/functions/steps/details.svelte
index ea0361b35..78c0a4e5b 100644
--- a/src/lib/wizards/functions/steps/details.svelte
+++ b/src/lib/wizards/functions/steps/details.svelte
@@ -3,17 +3,15 @@
import { Pill } from '$lib/elements';
import { InputText, InputSelect, FormList } from '$lib/elements/forms';
import { WizardStep } from '$lib/layout';
- import { sdk } from '$lib/stores/sdk';
import { onMount } from 'svelte';
- import { createFunction } from '../store';
+ import { createFunction, runtimes } from '../store';
let showCustomId = false;
let options = [];
onMount(async () => {
- let runtimes = await sdk.forProject.functions.listRuntimes();
- options = runtimes.runtimes.map((runtime) => ({
+ options = (await $runtimes).runtimes.map((runtime) => ({
label: `${runtime.name} - ${runtime.version}`,
value: runtime.$id
}));
diff --git a/src/lib/wizards/functions/steps/functionConfiguration.svelte b/src/lib/wizards/functions/steps/functionConfiguration.svelte
index c433d3994..c720e89d1 100644
--- a/src/lib/wizards/functions/steps/functionConfiguration.svelte
+++ b/src/lib/wizards/functions/steps/functionConfiguration.svelte
@@ -7,7 +7,7 @@
import { onMount } from 'svelte';
import { sdk } from '$lib/stores/sdk';
import Label from '$lib/elements/forms/label.svelte';
- import { choices, createFunction, installation, repository } from '../store';
+ import { choices, createFunction, installation, repository, runtimes } from '../store';
let showCustomId = false;
@@ -29,8 +29,7 @@
let options = [];
onMount(async () => {
- let runtimes = await sdk.forProject.functions.listRuntimes();
- options = runtimes.runtimes.map((runtime) => ({
+ options = (await $runtimes).runtimes.map((runtime) => ({
label: `${runtime.name} - ${runtime.version}`,
value: runtime.$id
}));
diff --git a/src/lib/wizards/functions/steps/templateConfiguration.svelte b/src/lib/wizards/functions/steps/templateConfiguration.svelte
index 10e7406a9..53e97ecd3 100644
--- a/src/lib/wizards/functions/steps/templateConfiguration.svelte
+++ b/src/lib/wizards/functions/steps/templateConfiguration.svelte
@@ -3,8 +3,7 @@
import { Pill } from '$lib/elements';
import { FormList, InputSelect, InputText } from '$lib/elements/forms';
import { WizardStep } from '$lib/layout';
- import { sdk } from '$lib/stores/sdk';
- import { template, templateConfig } from '../store';
+ import { runtimes, template, templateConfig } from '../store';
let showCustomId = false;
@@ -15,8 +14,7 @@
}
async function loadRuntimes() {
- let runtimes = await sdk.forProject.functions.listRuntimes();
- const options = runtimes.runtimes
+ const options = (await $runtimes).runtimes
.map((runtime) => ({
label: `${runtime.name} - ${runtime.version}`,
value: runtime.$id
diff --git a/src/lib/wizards/functions/store.ts b/src/lib/wizards/functions/store.ts
index 878fbdcc5..afd6121c8 100644
--- a/src/lib/wizards/functions/store.ts
+++ b/src/lib/wizards/functions/store.ts
@@ -33,6 +33,11 @@ export const installations = derived(
($page) => $page.data.installations as Models.InstallationList
);
+export const runtimes = derived(
+ page,
+ ($page) => $page.data.runtimes as Promise
+);
+
const initialCreateFunction: Partial = {
$id: null,
name: null,
diff --git a/src/routes/console/project-[project]/functions/+layout.ts b/src/routes/console/project-[project]/functions/+layout.ts
index 7fb46f02c..2e4caca75 100644
--- a/src/routes/console/project-[project]/functions/+layout.ts
+++ b/src/routes/console/project-[project]/functions/+layout.ts
@@ -11,6 +11,7 @@ export const load: LayoutLoad = async ({ depends }) => {
return {
header: Header,
breadcrumbs: Breadcrumbs,
+ runtimes: sdk.forProject.functions.listRuntimes(),
installations: sdk.forProject.vcs.listInstallations([Query.limit(100)])
};
};
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte
index 6464f80e7..504847e58 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte
@@ -19,7 +19,7 @@
onMount(async () => {
runtime ??= $func.runtime;
- let runtimes = await sdk.forProject.functions.listRuntimes();
+ let runtimes = await $page.data.runtimes;
options = runtimes.runtimes.map((runtime) => ({
label: `${runtime.name} - ${runtime.version}`,
value: runtime.$id
diff --git a/src/routes/console/project-[project]/functions/wizard/step1.svelte b/src/routes/console/project-[project]/functions/wizard/step1.svelte
index fd0c3a118..53c58e72e 100644
--- a/src/routes/console/project-[project]/functions/wizard/step1.svelte
+++ b/src/routes/console/project-[project]/functions/wizard/step1.svelte
@@ -3,17 +3,16 @@
import { Pill } from '$lib/elements';
import { InputText, InputSelect, FormList } from '$lib/elements/forms';
import { WizardStep } from '$lib/layout';
- import { sdk } from '$lib/stores/sdk';
import { onMount } from 'svelte';
import { createFunction } from './store';
+ import { runtimes } from '$lib/wizards/functions/store';
let showCustomId = false;
let options = [];
onMount(async () => {
- let runtimes = await sdk.forProject.functions.listRuntimes();
- options = runtimes.runtimes.map((runtime) => ({
+ options = (await $runtimes).runtimes.map((runtime) => ({
label: `${runtime.name} - ${runtime.version}`,
value: runtime.$id
}));
@@ -22,7 +21,7 @@
Create your function
- Let’s create a function.
+ Let's create a function.
-
-
-
{#if !showCustomId}
(showCustomId = !showCustomId)}>