chore: looks and validation

This commit is contained in:
David Buday 2024-11-11 17:32:27 +01:00
parent 653d0f3212
commit 65eb856916
4 changed files with 25 additions and 25 deletions

View file

@ -114,8 +114,6 @@ class Application extends BaseModel
protected $appends = ['server_status'];
protected $with = ['registry'];
protected static function booted()
{
static::saving(function ($application) {

View file

@ -1,4 +1,4 @@
<form wire:submit="submit" class="flex flex-col gap-4">
<form wire:submit="submit" class="flex flex-col gap-4 w-full">
<x-forms.input wire:model="name" required id="name" label="Registry Name" placeholder="My Docker Hub" />
<x-forms.select wire:model.live="type" label="Registry Type">
@ -17,7 +17,7 @@
<x-forms.input wire:model="token" type="password" id="token" label="Token/Password"
placeholder="Authentication token or password" />
<div class="flex justify-end gap-2">
<x-forms.button type="submit">Save Registry</x-forms.button>
<div class="flex gap-2 w-full">
<x-forms.button type="submit" class="w-full">Save Registry</x-forms.button>
</div>
</form>

View file

@ -1,7 +1,8 @@
<div class="flex flex-col p-4 bg-white dark:bg-base border border-coolgray-200 dark:border-coolgray-700">
<div class="flex flex-col p-4 bg-white dark:bg-base border dark:border-coolgray-300">
<form wire:submit="updateRegistry" class="space-y-4">
<div class="flex items-center justify-between mb-4">
<div class="flex items-center gap-2">
<div class="grid grid-cols-2 mb-4 gap-4">
<x-forms.input wire:model="name" label="Name" required />
<div class="flex items-center justify-end gap-2">
<x-forms.button type="submit">Update</x-forms.button>
<x-modal-confirmation title="Confirm Registry Deletion?" isErrorButton buttonTitle="Delete"
submitAction="delete" :actions="['The selected registry will be permanently deleted.']" confirmationText="{{ $registry->name }}"
@ -11,22 +12,20 @@
</div>
<div class="grid grid-cols-2 gap-4">
<x-forms.input wire:model="name" label="Name" required />
<x-forms.select wire:model.live="type" label="Type">
@foreach ($this->registryTypes as $key => $value)
<option value="{{ $key }}">{{ $value }}</option>
@endforeach
</x-forms.select>
@if ($type === 'custom')
<x-forms.input wire:model="url" label="URL" placeholder="registry.example.com" required />
@endif
<x-forms.input disabled="{{ $type !== 'custom' }}" wire:model="url" label="URL"
helper="Only required if the registry type is Custom" placeholder="registry.example.com"
required="required_if:type,custom" />
<x-forms.input wire:model="username" label="Username" placeholder="Username for authentication" />
<x-forms.input wire:model="username" label="Username" placeholder="Username for authentication" required />
<x-forms.input wire:model="token" type="password" label="Token/Password"
placeholder="Authentication token or password" />
placeholder="Authentication token or password" required />
</div>
</form>
</div>

View file

@ -144,23 +144,26 @@
</div>
@if ($application->build_pack === 'dockerimage')
<div class="pt-4 w-fit">
<x-forms.checkbox wire:model.live="application.docker_use_custom_registry"
id="application.docker_use_custom_registry"
helper="Select a registry to pull the image from." label="Use Private Registry" />
</div>
<div class="pt-4 grid grid-cols-2 items-center gap-4">
<div class="w-fit">
<x-forms.checkbox wire:model.live="application.docker_use_custom_registry"
id="application.docker_use_custom_registry"
helper="Select a registry to pull the image from." label="Use Private Registry" />
</div>
@if ($application->docker_use_custom_registry)
<div class="pt-4">
<x-forms.select id="application.docker_registry_id" label="Select Registry"
@if ($application->docker_use_custom_registry)
<x-forms.select wire:model.live="application.docker_registry_id"
id="application.docker_registry_id" label="Select Registry"
required="required_if:application.docker_use_custom_registry,true">
{{-- <option>Select a registry...</option> --}}
@foreach ($registries as $registry)
<option value="{{ $registry['id'] }}">{{ $registry['name'] }}</option>
@endforeach
</x-forms.select>
</div>
@endif
@endif
</div>
@endif
</div>
@endif