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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: prevent divide-by-zero in env-var autocomplete navigation
Andras Bacsai92dff0c0c736
diff --git a/resources/views/components/forms/env-var-input.blade.php b/resources/views/components/forms/env-var-input.blade.phpindex 5639cdbcad..0859db78d3 100644--- a/resources/views/components/forms/env-var-input.blade.php+++ b/resources/views/components/forms/env-var-input.blade.php@@ -47,6 +47,11 @@return;}+ if (lastBraceIndex > 0 && textBeforeCursor[lastBraceIndex - 1] === '{') {+ this.showDropdown = false;+ return;+ }+const textAfterBrace = textBeforeCursor.substring(lastBraceIndex);const closeBraces = '}' + '}';if (textAfterBrace.includes(closeBraces)) {@@ -156,6 +161,7 @@handleKeydown(event) {if (!this.showDropdown) return;+ if (!this.suggestions || this.suggestions.length === 0) return;if (event.key === 'ArrowDown') {event.preventDefault();@@ -225,12 +231,6 @@</div></template>- <template x-if="suggestions.length === 0 && !currentScope">- <div class="px-3 py-2 text-sm text-neutral-500 dark:text-neutral-400">- No suggestions- </div>- </template>-<div x-show="suggestions.length > 0"x-ref="dropdownList"class="max-h-48 overflow-y-scroll"diff --git a/resources/views/livewire/project/shared/environment-variable/add.blade.php b/resources/views/livewire/project/shared/environment-variable/add.blade.phpindex 6b6c660ec0..9bc4f06a33 100644--- a/resources/views/livewire/project/shared/environment-variable/add.blade.php+++ b/resources/views/livewire/project/shared/environment-variable/add.blade.php@@ -1,14 +1,16 @@<form class="flex flex-col w-full gap-2 rounded-sm" wire:submit='submit'><x-forms.input placeholder="NODE_ENV" id="key" label="Name" required />- <x-forms.textarea x-show="$wire.is_multiline === true" x-cloak id="value" label="Value" required />- <x-forms.env-var-input x-show="$wire.is_multiline === false" x-cloak placeholder="production" id="value"- x-bind:label="$wire.is_multiline === false && 'Value'" required- :availableVars="$shared ? [] : $this->availableSharedVariables"- :projectUuid="data_get($parameters, 'project_uuid')"- :environmentUuid="data_get($parameters, 'environment_uuid')" />+ @if ($is_multiline)+ <x-forms.textarea id="value" label="Value" required />+ @else+ <x-forms.env-var-input placeholder="production" id="value" label="Value" required+ :availableVars="$shared ? [] : $this->availableSharedVariables"+ :projectUuid="data_get($parameters, 'project_uuid')"+ :environmentUuid="data_get($parameters, 'environment_uuid')" />+ @endif- @if (!$shared)- <div x-show="$wire.is_multiline === false" x-cloak class="text-xs text-neutral-500 dark:text-neutral-400 -mt-1">+ @if (!$shared && !$is_multiline)+ <div class="text-xs text-neutral-500 dark:text-neutral-400 -mt-1">Tip: Type <span class="font-mono dark:text-warning text-coollabs">{{</span> to reference a shared environmentvariable</div>