coolify/resources/views/livewire/project/shared/environment-variable/all.blade.php

49 lines
2.4 KiB
PHP
Raw Normal View History

2024-03-22 11:34:15 +01:00
<div class="flex flex-col gap-4">
2023-08-07 22:14:21 +02:00
<div>
<div class="flex items-center gap-2">
<h2>Environment Variables</h2>
2024-01-23 17:13:23 +01:00
@if ($resource->type() !== 'service')
2024-03-25 11:33:38 +01:00
<x-modal-input buttonTitle="+ Add" title="New Environment Variable">
<livewire:project.shared.environment-variable.add />
</x-modal-input>
2024-01-23 17:13:23 +01:00
@endif
2023-09-08 16:16:59 +02:00
<x-forms.button
wire:click='switch'>{{ $view === 'normal' ? 'Developer view' : 'Normal view' }}</x-forms.button>
2023-08-07 22:14:21 +02:00
</div>
2023-09-08 16:16:59 +02:00
<div>Environment variables (secrets) for this resource.</div>
2024-01-23 17:13:23 +01:00
@if ($resource->type() === 'service')
<div>Hardcoded variables are not shown here.</div>
2024-01-23 17:13:23 +01:00
@endif
2023-08-07 22:14:21 +02:00
</div>
2023-09-08 16:16:59 +02:00
@if ($view === 'normal')
2024-01-23 17:13:23 +01:00
@forelse ($resource->environment_variables->sort()->sortBy('real_value') as $env)
2023-08-07 22:14:21 +02:00
<livewire:project.shared.environment-variable.show wire:key="environment-{{ $env->id }}"
2023-09-22 11:23:49 +02:00
:env="$env" :type="$resource->type()" />
2023-09-08 16:16:59 +02:00
@empty
2024-03-21 12:44:32 +01:00
<div>No environment variables found.</div>
2023-09-08 16:16:59 +02:00
@endforelse
@if ($resource->type() === 'application' && $resource->environment_variables_preview->count() > 0 && $showPreview)
<div>
<h3>Preview Deployments</h3>
<div>Environment (secrets) variables for Preview Deployments.</div>
</div>
2024-01-23 17:13:23 +01:00
@foreach ($resource->environment_variables_preview->sort()->sortBy('real_value') as $env)
2023-09-08 16:16:59 +02:00
<livewire:project.shared.environment-variable.show wire:key="environment-{{ $env->id }}"
2023-09-22 11:23:49 +02:00
:env="$env" :type="$resource->type()" />
2023-09-08 16:16:59 +02:00
@endforeach
@endif
@else
2023-12-07 19:06:32 +01:00
<form wire:submit='saveVariables(false)' class="flex flex-col gap-2">
2024-01-23 19:01:17 +01:00
<x-forms.textarea rows="10" class="whitespace-pre-wrap" id="variables"></x-forms.textarea>
2023-09-08 16:16:59 +02:00
<x-forms.button type="submit" class="btn btn-primary">Save</x-forms.button>
</form>
@if ($showPreview)
2023-12-07 19:06:32 +01:00
<form wire:submit='saveVariables(true)' class="flex flex-col gap-2">
2024-01-23 19:01:17 +01:00
<x-forms.textarea rows="10" class="whitespace-pre-wrap" label="Preview Environment Variables"
2023-09-08 16:16:59 +02:00
id="variablesPreview"></x-forms.textarea>
<x-forms.button type="submit" class="btn btn-primary">Save</x-forms.button>
</form>
@endif
2023-08-07 22:14:21 +02:00
@endif
</div>