From b80e0d15fb338511d7b81baf4e707892d5d53dcc Mon Sep 17 00:00:00 2001 From: Sara Vieira Date: Sat, 2 Apr 2022 23:25:55 +0200 Subject: [PATCH 1/2] feat: Add abilitry to paste env files --- package.json | 1 + .../applications/[id]/logs/index.svelte | 4 +- .../applications/[id]/previews/index.svelte | 3 +- .../[id]/secrets/_BatchSecrets.svelte | 48 +++++++++++++++++++ .../applications/[id]/secrets/_Secret.svelte | 44 ++++++++--------- .../applications/[id]/secrets/index.json.ts | 8 ++-- .../applications/[id]/secrets/index.svelte | 3 ++ src/routes/applications/[id]/secrets/utils.ts | 46 ++++++++++++++++++ 8 files changed, 125 insertions(+), 32 deletions(-) create mode 100644 src/routes/applications/[id]/secrets/_BatchSecrets.svelte create mode 100644 src/routes/applications/[id]/secrets/utils.ts diff --git a/package.json b/package.json index 6c7237198..3ddbdd408 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "jsonwebtoken": "8.5.1", "mustache": "^4.2.0", "node-forge": "1.3.0", + "p-limit": "^4.0.0", "svelte-kit-cookie-session": "2.1.2", "tailwindcss-scrollbar": "^0.1.0", "unique-names-generator": "4.7.1" diff --git a/src/routes/applications/[id]/logs/index.svelte b/src/routes/applications/[id]/logs/index.svelte index 036832f6c..9a6dd4445 100644 --- a/src/routes/applications/[id]/logs/index.svelte +++ b/src/routes/applications/[id]/logs/index.svelte @@ -77,7 +77,7 @@ {#if logs.length === 0}
Waiting for the logs...
{:else} -
+
diff --git a/src/routes/applications/[id]/previews/index.svelte b/src/routes/applications/[id]/previews/index.svelte index e78e46efd..5c580f527 100644 --- a/src/routes/applications/[id]/previews/index.svelte +++ b/src/routes/applications/[id]/previews/index.svelte @@ -11,7 +11,6 @@ } }; } - return { status: res.status, error: new Error(`Could not load ${endpoint}`) @@ -31,6 +30,7 @@ import Explainer from '$lib/components/Explainer.svelte'; import { errorNotification } from '$lib/form'; import { toast } from '@zerodevx/svelte-toast'; + import BatchSecrets from '../secrets/_BatchSecrets.svelte'; const { id } = $page.params; async function refreshSecrets() { @@ -116,3 +116,4 @@ {/if}
+ diff --git a/src/routes/applications/[id]/secrets/_BatchSecrets.svelte b/src/routes/applications/[id]/secrets/_BatchSecrets.svelte new file mode 100644 index 000000000..3f6ee9ec2 --- /dev/null +++ b/src/routes/applications/[id]/secrets/_BatchSecrets.svelte @@ -0,0 +1,48 @@ + + +

Paste .env file

+
+