refactor: Improve storage mount forms in add.blade.php

This commit is contained in:
Andras Bacsai
2024-08-16 11:36:21 +02:00
parent fcfbba4dc6
commit 9ec7d748df

View File

@@ -1,43 +1,47 @@
<div class="flex flex-col w-full gap-2 rounded"> <div class="flex flex-col w-full gap-2 rounded max-h-[80vh] overflow-y-auto scrollbar">
You can add Volumes, Files and Directories to your resources here. <div class="p-4">
<form class="flex flex-col w-full gap-2 rounded" wire:submit='submitPersistentVolume'> You can add Volumes, Files and Directories to your resources here.
<h3>Volume Mount</h3> <form class="flex flex-col w-full gap-2 rounded" wire:submit='submitPersistentVolume'>
@if ($isSwarm) <h3>Volume Mount</h3>
<h5>Swarm Mode detected: You need to set a shared volume (EFS/NFS/etc) on all the worker nodes if you would @if ($isSwarm)
like to use a persistent volumes.</h5> <h5>Swarm Mode detected: You need to set a shared volume (EFS/NFS/etc) on all the worker nodes if you
@endif would
<x-forms.input placeholder="pv-name" id="name" label="Name" required helper="Volume name." /> like to use a persistent volumes.</h5>
@if ($isSwarm) @endif
<x-forms.input placeholder="/root" id="host_path" label="Source Path" required <x-forms.input placeholder="pv-name" id="name" label="Name" required helper="Volume name." />
@if ($isSwarm)
<x-forms.input placeholder="/root" id="host_path" label="Source Path" required
helper="Directory on the host system." />
@else
<x-forms.input placeholder="/root" id="host_path" label="Source Path"
helper="Directory on the host system." />
@endif
<x-forms.input placeholder="/tmp/root" id="mount_path" label="Destination Path" required
helper="Directory inside the container." />
<x-forms.button type="submit" @click="modalOpen=false">
Save
</x-forms.button>
</form>
<form class="flex flex-col w-full gap-2 rounded" wire:submit='submitFileStorage'>
<h3>File Mount</h3>
<x-forms.input placeholder="/etc/nginx/nginx.conf" id="file_storage_path" label="Destination Path" required
helper="File inside the container" />
<x-forms.textarea label="Content" id="file_storage_content"></x-forms.textarea>
<x-forms.button type="submit" @click="modalOpen=false">
Save
</x-forms.button>
</form>
<form class="flex flex-col w-full gap-2 rounded" wire:submit='submitFileStorageDirectory'>
<h3>Directory Mount</h3>
<x-forms.input placeholder="{{ application_configuration_dir() }}/{{ $resource->uuid }}/etc/nginx"
id="file_storage_directory_source" label="Source Directory" required
helper="Directory on the host system." /> helper="Directory on the host system." />
@else <x-forms.input placeholder="/etc/nginx" id="file_storage_directory_destination"
<x-forms.input placeholder="/root" id="host_path" label="Source Path" label="Destination Directory" required helper="Directory inside the container." />
helper="Directory on the host system." /> <x-forms.button type="submit" @click="modalOpen=false">
@endif Save
<x-forms.input placeholder="/tmp/root" id="mount_path" label="Destination Path" required </x-forms.button>
helper="Directory inside the container." /> </form>
<x-forms.button type="submit" @click="modalOpen=false"> </div>
Save
</x-forms.button>
</form>
<form class="flex flex-col w-full gap-2 rounded" wire:submit='submitFileStorage'>
<h3>File Mount</h3>
<x-forms.input placeholder="/etc/nginx/nginx.conf" id="file_storage_path" label="Destination Path" required
helper="File inside the container" />
<x-forms.textarea label="Content" id="file_storage_content"></x-forms.textarea>
<x-forms.button type="submit" @click="modalOpen=false">
Save
</x-forms.button>
</form>
<form class="flex flex-col w-full gap-2 rounded" wire:submit='submitFileStorageDirectory'>
<h3>Directory Mount</h3>
<x-forms.input placeholder="{{ application_configuration_dir() }}/{{ $resource->uuid }}/etc/nginx"
id="file_storage_directory_source" label="Source Directory" required
helper="Directory on the host system." />
<x-forms.input placeholder="/etc/nginx" id="file_storage_directory_destination" label="Destination Directory"
required helper="Directory inside the container." />
<x-forms.button type="submit" @click="modalOpen=false">
Save
</x-forms.button>
</form>
</div> </div>