lasthourcloud/resources/views/livewire/server/proxy/dynamic-configurations.blade.php

52 lines
2.9 KiB
PHP
Raw Normal View History

<div>
<x-server.navbar :server="$server" :parameters="$parameters" />
<div class="flex gap-2">
<x-server.sidebar :server="$server" :parameters="$parameters" />
<div class="w-full">
@if ($server->isFunctional())
<div class="flex gap-2">
<div>
<div class="flex gap-2">
<h2>Dynamic Configurations</h2>
<x-forms.button wire:click='loadDynamicConfigurations'>Reload</x-forms.button>
2024-03-25 10:33:38 +00:00
<x-modal-input buttonTitle="+ Add" title="New Dynamic Configuration">
<livewire:server.proxy.new-dynamic-configuration />
</x-modal-input>
</div>
2024-03-11 16:31:28 +00:00
<div class='pb-4'>You can add dynamic proxy configurations here.</div>
</div>
</div>
<div wire:loading wire:target="loadDynamicConfigurations">
<x-loading text="Loading dynamic configurations..." />
</div>
<div x-init="$wire.loadDynamicConfigurations" class="flex flex-col gap-4">
@if ($contents?->isNotEmpty())
@foreach ($contents as $fileName => $value)
<div class="flex flex-col gap-2 py-2">
2024-03-25 10:33:38 +00:00
@if (str_replace('|', '.', $fileName) === 'coolify.yaml' ||
str_replace('|', '.', $fileName) === 'Caddyfile' ||
str_replace('|', '.', $fileName) === 'coolify.caddy' ||
str_replace('|', '.', $fileName) === 'default_redirect_404.caddy')
<div>
2024-03-24 15:00:25 +00:00
<h3 class="dark:text-white">File: {{ str_replace('|', '.', $fileName) }}</h3>
</div>
<x-forms.textarea disabled name="proxy_settings"
wire:model="contents.{{ $fileName }}" rows="5" />
@else
<livewire:server.proxy.dynamic-configuration-navbar :server_id="$server->id"
:fileName="$fileName" :value="$value" :newFile="false"
wire:key="{{ $fileName }}-{{ $loop->index }}" />
<x-forms.textarea disabled wire:model="contents.{{ $fileName }}"
rows="10" />
@endif
</div>
@endforeach
2024-02-22 13:45:56 +00:00
@else
<div wire:loading.remove> No dynamic configurations found.</div>
@endif
</div>
@endif
</div>
</div>
</div>