This commit is contained in:
Andras Bacsai
2023-05-16 11:02:51 +02:00
parent 57c64d0b86
commit 752c86d8f7
16 changed files with 165 additions and 92 deletions

View File

@@ -1,27 +1,12 @@
<div x-data="{ deleteServer: false }">
<x-naked-modal show="deleteServer" message='Are you sure you would like to delete this server?' />
<form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex flex-col pb-4">
<div class="flex items-center gap-2">
<div class="text-3xl font-bold">Server</div>
<x-inputs.button isBold type="submit">Submit</x-inputs.button>
<x-inputs.button isWarning x-on:click.prevent="deleteServer = true">
Delete
</x-inputs.button>
</div>
<div>
@if ($server->settings->is_validated)
<div class="text-green-400/90">Validated</div>
@else
<div class="text-red-400/90">Not validated</div>
@endif
</div>
</div>
<div class="flex flex-col gap-2 xl:flex-row">
<div class="flex flex-col w-96">
<x-inputs.input id="server.name" label="Name" required />
<x-inputs.input id="server.description" label="Description" />
<x-inputs.input disabled type="checkbox" id="server.settings.is_part_of_swarm"
label="Is it part of a Swarm cluster?" />
</div>
<div class="flex flex-col w-96">
@if ($server->id === 0)
@@ -35,19 +20,34 @@
@endif
</div>
</div>
<div class="flex gap-2">
<x-inputs.button isBold wire:click.prevent='validateServer'>Validate Server</x-inputs.button>
<x-inputs.button isBold wire:click.prevent='installDocker'>Install Docker</x-inputs.button>
<div class="flex items-center gap-2">
<x-inputs.button isBold type="submit">Save</x-inputs.button>
<x-inputs.button isBold wire:click.prevent='validateServer'>
@if ($server->settings->is_validated)
Check Connection
@else
Validate Server
@endif
</x-inputs.button>
{{-- <x-inputs.button isBold wire:click.prevent='installDocker'>Install Docker</x-inputs.button> --}}
<x-inputs.button isWarning x-on:click.prevent="deleteServer = true">
Delete
</x-inputs.button>
</div>
<div class="pt-3">
@isset($uptime)
<p>Connection: OK</p>
<p>Uptime: {{ $uptime }}</p>
@endisset
@isset($dockerVersion)
<p>Docker Engine {{ $dockerVersion }}</p>
@endisset
@isset($dockerComposeVersion)
<p>{{ $dockerComposeVersion }}</p>
@endisset
</div>
</form>
@isset($uptime)
<p>Uptime: {{ $uptime }}</p>
@endisset
@isset($dockerVersion)
<p>Docker Engine: {{ $dockerVersion }}</p>
@endisset
@isset($dockerComposeVersion)
<p>Docker Compose: {{ $dockerComposeVersion }}</p>
@endisset
</div>

View File

@@ -7,7 +7,7 @@
<x-inputs.input id="user" label="User" />
<x-inputs.input type="number" id="port" label="Port" />
<label>Private Key</label>
<select wire:model.defer="private_key_id">
<x-inputs.select wire:model.defer="private_key_id">
<option disabled>Select a private key</option>
@foreach ($private_keys as $key)
@if ($loop->first)
@@ -16,7 +16,9 @@
<option value="{{ $key->id }}">{{ $key->name }}</option>
@endif
@endforeach
</select>
</x-inputs.select>
<x-inputs.input instantSave noDirty type="checkbox" id="is_part_of_swarm"
label="Is it part of a Swarm cluster?" />
<x-inputs.button isBold type="submit">
Save
</x-inputs.button>