Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Merge branch 'main' into restray_i18n

Restray4a6062522e36
diff --cc src/routes/applications/[id]/secrets/_BatchSecrets.svelte
index 7e6cd737de,8d0a65aeec..d7c23938f3
--- a/src/routes/applications/[id]/secrets/_BatchSecrets.svelte
+++ b/src/routes/applications/[id]/secrets/_BatchSecrets.svelte
@@@ -39,11 -38,11 +39,11 @@@
}
</script>
-<h2 class="title my-6 font-bold">Paste .env file</h2>
+<h2 class="title my-6 font-bold">{$t('application.secret__batch_dot_env')}</h2>
- <form on:submit={getValues} class="mb-12 w-full">
- <textarea value={batchSecrets} on:change={setBatchValue} class="mb-2 min-h-[200px] w-full" />
+ <form on:submit|preventDefault={getValues} class="mb-12 w-full">
+ <textarea bind:value={batchSecrets} class="mb-2 min-h-[200px] w-full" />
<button
class="bg-green-600 hover:bg-green-500 disabled:text-white disabled:opacity-40"
- type="submit">Batch add secrets</button
+ type="submit">{$t('application.batch_secrets')}</button
>
</form>
diff --cc src/routes/applications/[id]/secrets/_Secret.svelte
index 8adc2726bd,48f750e61c..18ed868cec
--- a/src/routes/applications/[id]/secrets/_Secret.svelte
+++ b/src/routes/applications/[id]/secrets/_Secret.svelte
@@@ -12,7 -12,7 +12,8 @@@
import { del } from '$lib/api';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import { errorNotification } from '$lib/form';
+ import { t } from '$lib/translations';
+ import { toast } from '@zerodevx/svelte-toast';
import { createEventDispatcher } from 'svelte';
import { saveSecret } from './utils';
@@@ -82,11 -100,11 +101,11 @@@
class="relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out"
class:bg-green-600={isBuildSecret}
class:bg-stone-700={!isBuildSecret}
- class:opacity-50={!isNewSecret}
- class:cursor-not-allowed={!isNewSecret}
- class:cursor-pointer={isNewSecret}
+ class:opacity-50={isPRMRSecret}
+ class:cursor-not-allowed={isPRMRSecret}
+ class:cursor-pointer={!isPRMRSecret}
>
- <span class="sr-only">Use isBuildSecret</span>
+ <span class="sr-only">{$t('application.secrets.use_isbuildsecret')}</span>
<span
class="pointer-events-none relative inline-block h-5 w-5 transform rounded-full bg-white shadow transition duration-200 ease-in-out"
class:translate-x-5={isBuildSecret}
diff --cc src/routes/applications/[id]/secrets/index.svelte
index da851f8861,5ca2bbfcb3..d939ed41eb
--- a/src/routes/applications/[id]/secrets/index.svelte
+++ b/src/routes/applications/[id]/secrets/index.svelte
@@@ -22,15 -22,17 +22,18 @@@
<script lang="ts">
export let secrets;
export let application;
+ import pLimit from 'p-limit';
import Secret from './_Secret.svelte';
- import { getDomain } from '$lib/components/common';
import { page } from '$app/stores';
- import { get } from '$lib/api';
+ import { t } from '$lib/translations';
- import BatchSecrets from './_BatchSecrets.svelte';
+ import { get } from '$lib/api';
+ import { saveSecret } from './utils';
+ import { toast } from '@zerodevx/svelte-toast';
+ const limit = pLimit(1);
const { id } = $page.params;
+ let batchSecrets = '';
async function refreshSecrets() {
const data = await get(`/applications/${id}/secrets.json`);
secrets = [...data.secrets];
diff --cc src/routes/applications/[id]/secrets/utils.ts
index 94afe3b9e4,d86acbe2c0..965802d8cd
--- a/src/routes/applications/[id]/secrets/utils.ts
+++ b/src/routes/applications/[id]/secrets/utils.ts
@@@ -21,11 -19,10 +20,10 @@@ export async function saveSecret(
isBuildSecret,
isPRMRSecret,
isNewSecret,
- applicationId,
- dispatch
+ applicationId
}: Props): Promise<void> {
- if (!name) return errorNotification('Name is required.');
- if (!value) return errorNotification('Value is required.');
+ if (!name) return errorNotification(`${t.get('forms.name')} ${t.get('forms.is_required')}`);
+ if (!value) return errorNotification(`${t.get('forms.value')} ${t.get('forms.is_required')}`);
try {
await post(`/applications/${applicationId}/secrets.json`, {
name,