mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-29 20:52:10 +00:00
Merge branch 'main' into restray_i18n
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
import { page, session } from '$app/stores';
|
||||
import { errorNotification } from '$lib/form';
|
||||
import { onMount } from 'svelte';
|
||||
import Select from 'svelte-select';
|
||||
|
||||
import Explainer from '$lib/components/Explainer.svelte';
|
||||
import Setting from '$lib/components/Setting.svelte';
|
||||
@@ -58,6 +59,23 @@
|
||||
let previews = application.settings.previews;
|
||||
let dualCerts = application.settings.dualCerts;
|
||||
let autodeploy = application.settings.autodeploy;
|
||||
|
||||
let wsgis = [
|
||||
{
|
||||
value: 'None',
|
||||
label: 'None'
|
||||
},
|
||||
{
|
||||
value: 'Gunicorn',
|
||||
label: 'Gunicorn'
|
||||
}
|
||||
// },
|
||||
// {
|
||||
// value: 'uWSGI',
|
||||
// label: 'uWSGI'
|
||||
// }
|
||||
];
|
||||
|
||||
if (browser && window.location.hostname === 'demo.coolify.io' && !application.fqdn) {
|
||||
application.fqdn = `http://${cuid()}.demo.coolify.io`;
|
||||
}
|
||||
@@ -112,7 +130,7 @@
|
||||
await post(`/applications/${id}.json`, { ...application });
|
||||
return window.location.reload();
|
||||
} catch ({ error }) {
|
||||
if (error.startsWith($t('application.dns_not_set_partial_error'))) {
|
||||
if (error?.startsWith($t('application.dns_not_set_partial_error'))) {
|
||||
forceSave = true;
|
||||
}
|
||||
return errorNotification(error);
|
||||
@@ -120,12 +138,19 @@
|
||||
loading = false;
|
||||
}
|
||||
}
|
||||
async function selectWSGI(event) {
|
||||
application.pythonWSGI = event.detail.value;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex items-center space-x-2 p-5 px-6 font-bold">
|
||||
<div class="md:max-w-64 truncate text-base tracking-tight md:text-2xl lg:block">
|
||||
{application.name}
|
||||
<div class="-mb-5 flex-col">
|
||||
<div class="md:max-w-64 truncate text-base tracking-tight md:text-2xl lg:block">
|
||||
Configuration
|
||||
</div>
|
||||
<span class="text-xs">{application.name} </span>
|
||||
</div>
|
||||
|
||||
{#if application.fqdn}
|
||||
<a
|
||||
href={application.fqdn}
|
||||
@@ -300,7 +325,7 @@
|
||||
>
|
||||
{#if browser && window.location.hostname === 'demo.coolify.io'}
|
||||
<Explainer
|
||||
text="<span class='text-white font-bold'>You can use the predefined random domain name or enter your own domain name.</span>"
|
||||
text="<span class='text-white font-bold'>You can use the predefined random url name or enter your own domain name.</span>"
|
||||
/>
|
||||
{/if}
|
||||
<Explainer text={$t('application.https_explainer')} />
|
||||
@@ -328,6 +353,39 @@
|
||||
on:click={() => !isRunning && changeSettings('dualCerts')}
|
||||
/>
|
||||
</div>
|
||||
{#if application.buildPack === 'python'}
|
||||
<div class="grid grid-cols-2 items-center">
|
||||
<label for="pythonModule" class="text-base font-bold text-stone-100">WSGI</label>
|
||||
<div class="custom-select-wrapper">
|
||||
<Select id="wsgi" items={wsgis} on:select={selectWSGI} value={application.pythonWSGI} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 items-center">
|
||||
<label for="pythonModule" class="text-base font-bold text-stone-100">Module</label>
|
||||
<input
|
||||
readonly={!$session.isAdmin}
|
||||
name="pythonModule"
|
||||
id="pythonModule"
|
||||
required
|
||||
bind:value={application.pythonModule}
|
||||
placeholder={application.pythonWSGI?.toLowerCase() !== 'gunicorn' ? 'main.py' : 'main'}
|
||||
/>
|
||||
</div>
|
||||
{#if application.pythonWSGI?.toLowerCase() === 'gunicorn'}
|
||||
<div class="grid grid-cols-2 items-center">
|
||||
<label for="pythonVariable" class="text-base font-bold text-stone-100">Variable</label>
|
||||
<input
|
||||
readonly={!$session.isAdmin}
|
||||
name="pythonVariable"
|
||||
id="pythonVariable"
|
||||
required
|
||||
bind:value={application.pythonVariable}
|
||||
placeholder="default: app"
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if !staticDeployments.includes(application.buildPack)}
|
||||
<div class="grid grid-cols-2 items-center">
|
||||
<label for="port" class="text-base font-bold text-stone-100">{$t('forms.port')}</label>
|
||||
@@ -336,7 +394,7 @@
|
||||
name="port"
|
||||
id="port"
|
||||
bind:value={application.port}
|
||||
placeholder="{$t('forms.default')}: 3000"
|
||||
placeholder="{$t('forms.default')}: 'python' ? '8000' : '3000'"
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user