From 52a5b62c86135fa5967840c78b7a37b5b4b7ac8c Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 1 Feb 2023 13:41:39 +0100 Subject: [PATCH 1/6] feat: execute redirection, create fixes, small fixes --- src/lib/layout/logs.svelte | 7 ++-- .../function-[function]/create.svelte | 37 +++++++++++++------ .../function-[function]/execute.svelte | 7 +++- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/lib/layout/logs.svelte b/src/lib/layout/logs.svelte index ac6f8cfa3..39cd7b650 100644 --- a/src/lib/layout/logs.svelte +++ b/src/lib/layout/logs.svelte @@ -79,11 +79,10 @@
Size: {size.value} {size.unit}
-
+
{$log.data.status} -

- {calculateTime($log.data.buildTime)} -

+ +
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 be7c21ddb..4d952eb97 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/create.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/create.svelte @@ -26,6 +26,7 @@ let files: FileList; let lang = 'js'; let codeSnippets = {}; + let OS = 'unknown'; const functionId = $page.params.function; const dispatch = createEventDispatcher(); @@ -33,6 +34,7 @@ onMount(() => { lang = setLanguage($func.runtime); codeSnippets = setCodeSnippets(lang); + OS = navigator?.userAgentData?.platform || navigator?.platform || 'unknown'; }); function setLanguage(runtime: string) { @@ -107,6 +109,21 @@ }); } } + + function openCategory(category: string, index: number) { + switch (category) { + case 'CMD': + return OS.includes('Win'); + case 'PowerShell': + return OS.includes('Win'); + case 'Unix': + return ( + OS === 'unknown' || OS.includes('Linux') || OS.includes('Mac') || index === 0 + ); + default: + return index === 0; + } + } @@ -144,7 +161,7 @@

{#each ['Unix', 'CMD', 'PowerShell'] as category, i} - + {category} {:else if mode === Mode.Github} -
-
- {#if $app.themeInUse === 'dark'} - github - {:else} - github - {/if} -
-
+
+ {#if $app.themeInUse === 'dark'} + github + {:else} + github + {/if} +

Coming Soon!

Creating deployments will be easier than ever with our upcoming Git Integration. - Just set up a repository and we’ll do the rest. + Just set up a repository and we'll do the rest.

diff --git a/src/routes/console/project-[project]/functions/function-[function]/execute.svelte b/src/routes/console/project-[project]/functions/function-[function]/execute.svelte index 24f026f25..14f845a9a 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/execute.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/execute.svelte @@ -1,5 +1,7 @@