This commit is contained in:
Andras Bacsai 2023-10-04 10:34:44 +02:00
parent 4ac8e1cc67
commit a5e6975dac
4 changed files with 29 additions and 30 deletions

View File

@ -3,7 +3,6 @@
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Symfony\Component\Yaml\Yaml;
class ServiceDatabase extends BaseModel class ServiceDatabase extends BaseModel
{ {

View File

@ -26,27 +26,29 @@
<x-forms.input label="Image" id="database.image" required <x-forms.input label="Image" id="database.image" required
helper="For all available images, check here:<br><br><a target='_blank' href='https://hub.docker.com/_/postgres'>https://hub.docker.com/_/postgres</a>" /> helper="For all available images, check here:<br><br><a target='_blank' href='https://hub.docker.com/_/postgres'>https://hub.docker.com/_/postgres</a>" />
</div> </div>
<div class="flex gap-2">
@if ($database->started_at) @if ($database->started_at)
<x-forms.input label="Username" id="database.postgres_username" placeholder="If empty: postgres" <div class="flex gap-2">
readonly helper="You can only modify it before the initial start." /> <x-forms.input label="Initial Username" id="database.postgres_username" placeholder="If empty: postgres"
<x-forms.input label="Password" id="database.postgres_password" type="password" required readonly readonly helper="You can only change this in the database." />
helper="You can only modify it before the initial start." /> <x-forms.input label="Initial Password" id="database.postgres_password" type="password" required readonly
<x-forms.input label="Database" id="database.postgres_db" helper="You can only change this in the database." />
<x-forms.input label="Initial Database" id="database.postgres_db"
placeholder="If empty, it will be the same as Username." readonly placeholder="If empty, it will be the same as Username." readonly
helper="You can only modify it before the initial start." /> helper="You can only change this in the database." />
@else </div>
<x-forms.input label="Username" id="database.postgres_user" placeholder="If empty: postgres" @else
helper="You can only modify it before the initial start." /> <div class="pt-8 text-warning">Please verify these values. You can only modify them before the initial start. After that, you need to modify it in the database.
<x-forms.input label="Password" id="database.postgres_password" type="password" required </div>
helper="You can only modify it before the initial start." /> <div class="flex gap-2 pb-8">
<x-forms.input label="Username" id="database.postgres_user" placeholder="If empty: postgres" />
<x-forms.input label="Password" id="database.postgres_password" type="password" required />
<x-forms.input label="Database" id="database.postgres_db" <x-forms.input label="Database" id="database.postgres_db"
placeholder="If empty, it will be the same as Username." placeholder="If empty, it will be the same as Username." />
helper="You can only modify it before the initial start." /> </div>
@endif @endif
</div>
<div class="flex gap-2"> <div class="flex gap-2">
<x-forms.input label="Initial Arguments" id="database.postgres_initdb_args" <x-forms.input label="Initial Database Arguments" id="database.postgres_initdb_args"
placeholder="If empty, use default. See in docker docs." /> placeholder="If empty, use default. See in docker docs." />
<x-forms.input label="Host Auth Method" id="database.postgres_host_auth_method" <x-forms.input label="Host Auth Method" id="database.postgres_host_auth_method"
placeholder="If empty, use default. See in docker docs." /> placeholder="If empty, use default. See in docker docs." />
@ -55,11 +57,12 @@
<h3 class="py-2">Network</h3> <h3 class="py-2">Network</h3>
<div class="flex items-end gap-2"> <div class="flex items-end gap-2">
<x-forms.input placeholder="3000:5432" id="database.ports_mappings" label="Ports Mappings" <x-forms.input placeholder="3000:5432" id="database.ports_mappings" label="Ports Mappings"
helper="A comma separated list of ports you would like to map to the host system.<br><span class='inline-block font-bold text-warning'>Example</span>3000:5432,3002:5433" /> helper="A comma separated list of ports you would like to map to the host system.<br><span class='inline-block font-bold text-warning'>Example</span>3000:5432,3002:5433" />
<x-forms.input placeholder="5432" disabled="{{$database->is_public}}" id="database.public_port" label="Public Port" /> <x-forms.input placeholder="5432" disabled="{{ $database->is_public }}" id="database.public_port"
<x-forms.checkbox instantSave id="database.is_public" label="Accessible over the internet" /> label="Public Port" />
</div> <x-forms.checkbox instantSave id="database.is_public" label="Accessible over the internet" />
<x-forms.input label="Postgres URL" readonly wire:model="db_url" /> </div>
<x-forms.input label="Postgres URL" readonly wire:model="db_url" />
</div> </div>
</form> </form>
<div class="pb-16"> <div class="pb-16">

View File

@ -106,8 +106,7 @@
<h2>Storages</h2> <h2>Storages</h2>
</div> </div>
<div class="pb-4">Persistent storage to preserve data between deployments.</div> <div class="pb-4">Persistent storage to preserve data between deployments.</div>
<span class="text-warning">Please modify storage layout in your <a class="underline" <span class="text-warning">Please modify storage layout in your Docker Compose file.</span>
href="{{ Str::of(url()->current())->beforeLast('/') }}">Docker Compose</a> file.</span>
@foreach ($applications as $application) @foreach ($applications as $application)
<livewire:project.service.storage wire:key="application-{{ $application->id }}" <livewire:project.service.storage wire:key="application-{{ $application->id }}"
:resource="$application" /> :resource="$application" />

View File

@ -28,8 +28,7 @@
<h2>Storages</h2> <h2>Storages</h2>
</div> </div>
<div class="pb-4">Persistent storage to preserve data between deployments.</div> <div class="pb-4">Persistent storage to preserve data between deployments.</div>
<span class="text-warning">Please modify storage layout in your <a class="underline" <span class="text-warning">Please modify storage layout in your Docker Compose file.</span>
href="{{ Str::of(url()->current())->beforeLast('/') }}">Docker Compose</a> file.</span>
<livewire:project.service.storage wire:key="application-{{ $serviceApplication->id }}" <livewire:project.service.storage wire:key="application-{{ $serviceApplication->id }}"
:resource="$serviceApplication" /> :resource="$serviceApplication" />
</div> </div>
@ -43,8 +42,7 @@
<h2>Storages</h2> <h2>Storages</h2>
</div> </div>
<div class="pb-4">Persistent storage to preserve data between deployments.</div> <div class="pb-4">Persistent storage to preserve data between deployments.</div>
<span class="text-warning">Please modify storage layout in your <a class="underline" <span class="text-warning">Please modify storage layout in your Docker Compose file.</span>
href="{{ Str::of(url()->current())->beforeLast('/') }}">Docker Compose</a> file.</span>
<livewire:project.service.storage wire:key="application-{{ $serviceDatabase->id }}" <livewire:project.service.storage wire:key="application-{{ $serviceDatabase->id }}"
:resource="$serviceDatabase" /> :resource="$serviceDatabase" />
</div> </div>