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.

feat(environment): add dynamic checkbox options for environment variable settings based on user permissions and variable types

Andras Bacsai99fd4b424d18
diff --git a/resources/views/livewire/project/shared/environment-variable/show.blade.php b/resources/views/livewire/project/shared/environment-variable/show.blade.php
index 953bc59faf..a04b477d5e 100644
--- a/resources/views/livewire/project/shared/environment-variable/show.blade.php
+++ b/resources/views/livewire/project/shared/environment-variable/show.blade.php
@@ -21,6 +21,95 @@
step2ButtonText="Permanently Delete" />
@endcan
</div>
+ @can('update', $this->env)
+ <div class="flex flex-col w-full gap-3">
+ <div class="flex w-full items-center gap-4 overflow-x-auto whitespace-nowrap">
+ @if (!$is_redis_credential)
+ @if ($type === 'service')
+ <x-forms.checkbox instantSave id="is_buildtime"
+ helper="Make this variable available during Docker build process. Useful for build secrets and dependencies."
+ label="Available at Buildtime" />
+ <x-forms.checkbox instantSave id="is_runtime"
+ helper="Make this variable available in the running container at runtime."
+ label="Available at Runtime" />
+ <x-forms.checkbox instantSave id="is_multiline" label="Is Multiline?" />
+ <x-forms.checkbox instantSave id="is_literal"
+ helper="This means that when you use $VARIABLES in a value, it should be interpreted as the actual characters '$VARIABLES' and not as the value of a variable named VARIABLE.<br><br>Useful if you have $ sign in your value and there are some characters after it, but you would not like to interpolate it from another value. In this case, you should set this to true."
+ label="Is Literal?" />
+ @else
+ @if ($is_shared)
+ <x-forms.checkbox instantSave id="is_literal"
+ helper="This means that when you use $VARIABLES in a value, it should be interpreted as the actual characters '$VARIABLES' and not as the value of a variable named VARIABLE.<br><br>Useful if you have $ sign in your value and there are some characters after it, but you would not like to interpolate it from another value. In this case, you should set this to true."
+ label="Is Literal?" />
+ @else
+ @if ($isSharedVariable)
+ <x-forms.checkbox instantSave id="is_multiline" label="Is Multiline?" />
+ @else
+ @if (!$env->is_nixpacks)
+ <x-forms.checkbox instantSave id="is_buildtime"
+ helper="Make this variable available during Docker build process. Useful for build secrets and dependencies."
+ label="Available at Buildtime" />
+ @endif
+ <x-forms.checkbox instantSave id="is_runtime"
+ helper="Make this variable available in the running container at runtime."
+ label="Available at Runtime" />
+ @if (!$env->is_nixpacks)
+ <x-forms.checkbox instantSave id="is_multiline" label="Is Multiline?" />
+ @if ($is_multiline === false)
+ <x-forms.checkbox instantSave id="is_literal"
+ helper="This means that when you use $VARIABLES in a value, it should be interpreted as the actual characters '$VARIABLES' and not as the value of a variable named VARIABLE.<br><br>Useful if you have $ sign in your value and there are some characters after it, but you would not like to interpolate it from another value. In this case, you should set this to true."
+ label="Is Literal?" />
+ @endif
+ @endif
+ @endif
+ @endif
+ @endif
+ @endif
+ </div>
+ </div>
+ @else
+ <div class="flex flex-col w-full gap-3">
+ <div class="flex w-full items-center gap-4 overflow-x-auto whitespace-nowrap">
+ @if (!$is_redis_credential)
+ @if ($type === 'service')
+ <x-forms.checkbox disabled id="is_buildtime"
+ helper="Make this variable available during Docker build process. Useful for build secrets and dependencies."
+ label="Available at Buildtime" />
+ <x-forms.checkbox disabled id="is_runtime"
+ helper="Make this variable available in the running container at runtime."
+ label="Available at Runtime" />
+ <x-forms.checkbox disabled id="is_multiline" label="Is Multiline?" />
+ <x-forms.checkbox disabled id="is_literal"
+ helper="This means that when you use $VARIABLES in a value, it should be interpreted as the actual characters '$VARIABLES' and not as the value of a variable named VARIABLE.<br><br>Useful if you have $ sign in your value and there are some characters after it, but you would not like to interpolate it from another value. In this case, you should set this to true."
+ label="Is Literal?" />
+ @else
+ @if ($is_shared)
+ <x-forms.checkbox disabled id="is_literal"
+ helper="This means that when you use $VARIABLES in a value, it should be interpreted as the actual characters '$VARIABLES' and not as the value of a variable named VARIABLE.<br><br>Useful if you have $ sign in your value and there are some characters after it, but you would not like to interpolate it from another value. In this case, you should set this to true."
+ label="Is Literal?" />
+ @else
+ @if ($isSharedVariable)
+ <x-forms.checkbox disabled id="is_multiline" label="Is Multiline?" />
+ @else
+ <x-forms.checkbox disabled id="is_buildtime"
+ helper="Make this variable available during Docker build process. Useful for build secrets and dependencies."
+ label="Available at Buildtime" />
+ <x-forms.checkbox disabled id="is_runtime"
+ helper="Make this variable available in the running container at runtime."
+ label="Available at Runtime" />
+ <x-forms.checkbox disabled id="is_multiline" label="Is Multiline?" />
+ @if ($is_multiline === false)
+ <x-forms.checkbox disabled id="is_literal"
+ helper="This means that when you use $VARIABLES in a value, it should be interpreted as the actual characters '$VARIABLES' and not as the value of a variable named VARIABLE.<br><br>Useful if you have $ sign in your value and there are some characters after it, but you would not like to interpolate it from another value. In this case, you should set this to true."
+ label="Is Literal?" />
+ @endif
+ @endif
+ @endif
+ @endif
+ @endif
+ </div>
+ </div>
+ @endcan
@else
@can('update', $this->env)
@if ($isDisabled)