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

55 lines
3.1 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>
<x-slide-over>
<x-slot:title>New Dynamic Configuration</x-slot:title>
<x-slot:content>
<livewire:server.proxy.new-dynamic-configuration />
</x-slot:content>
<button @click="slideOverOpen=true"
2024-03-19 14:37:16 +00:00
class="button">+
Add</button>
</x-slide-over>
</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">
@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>