Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
fix: templates wouldnt allow empty files to be loaded in the ui
Kyle Mendell33b8303b09b1
diff --git a/frontend/src/lib/components/dialogs/template-selection-dialog.svelte b/frontend/src/lib/components/dialogs/template-selection-dialog.svelteindex a34218589..728a2d062 100644--- a/frontend/src/lib/components/dialogs/template-selection-dialog.svelte+++ b/frontend/src/lib/components/dialogs/template-selection-dialog.svelte@@ -109,14 +109,16 @@try {const details = await templateAPI.getTemplateContent(template.id);- if (!details?.content) {+ if (!details) {toast.error(m.templates_load_failed());return;}+ const compose = typeof details.content === 'string' ? details.content : '';+ const env = typeof details.envContent === 'string' ? details.envContent : '';onSelect({...details.template,- content: details.content,- envContent: details.envContent+ content: compose,+ envContent: env});open = false;toast.success(m.templates_loaded_success({ name: template.name }));diff --git a/frontend/src/routes/projects/new/+page.svelte b/frontend/src/routes/projects/new/+page.svelteindex bcba1e0b4..66da80ac9 100644--- a/frontend/src/routes/projects/new/+page.svelte+++ b/frontend/src/routes/projects/new/+page.svelte@@ -99,10 +99,8 @@async function handleTemplateSelect(template: Template) {showTemplateDialog = false;- $inputs.composeContent.value = template.content;- if (template.envContent) {- $inputs.envContent.value = template.envContent;- }+ $inputs.composeContent.value = template.content ?? '';+ $inputs.envContent.value = template.envContent ?? '';if (!$inputs.name.value?.trim()) {$inputs.name.value = template.name.toLowerCase().replace(/[^a-z0-9-_]/g, '-');@@ -137,7 +135,7 @@<div class="max-w-full px-4 py-3"><div class="flex items-center justify-between"><div class="flex items-center gap-3">- <Button variant="ghost" size="sm" href="/compose" class="gap-2">+ <Button variant="ghost" size="sm" href="/projects" class="gap-2"><ArrowLeftIcon class="size-4" />{m.common_back()}</Button>