This commit is contained in:
Andras Bacsai 2023-05-22 12:09:24 +02:00
parent e00ccf65cf
commit f5bf07a7c3
4 changed files with 25 additions and 20 deletions

View File

@ -1,4 +1,3 @@
<x-layout> <x-layout>
<h1>New Destination</h1>
<livewire:destination.new.standalone-docker :servers="$servers" :server_id="$server_id" /> <livewire:destination.new.standalone-docker :servers="$servers" :server_id="$server_id" />
</x-layout> </x-layout>

View File

@ -1,5 +1,11 @@
<div> <div>
<form class="flex items-end gap-4" wire:submit.prevent='submit'> <form class="flex flex-col gap-4" wire:submit.prevent='submit'>
<div class="flex gap-2">
<h1>New Destination</h1>
<x-inputs.button type="submit">
Save
</x-inputs.button>
</div>
<x-inputs.input id="name" label="Name" required /> <x-inputs.input id="name" label="Name" required />
<x-inputs.input id="network" label="Network" required /> <x-inputs.input id="network" label="Network" required />
<x-inputs.select id="server_id" label="Select a server" required> <x-inputs.select id="server_id" label="Select a server" required>
@ -8,8 +14,6 @@
<option value="{{ $server->id }}">{{ $server->name }}</option> <option value="{{ $server->id }}">{{ $server->name }}</option>
@endforeach @endforeach
</x-inputs.select> </x-inputs.select>
<x-inputs.button type="submit">
Submit
</x-inputs.button>
</form> </form>
</div> </div>

View File

@ -1,13 +1,19 @@
<div x-data="{ deleteServer: false }"> <div x-data="{ deleteServer: false }">
<h2>General</h2>
<x-naked-modal show="deleteServer" message='Are you sure you would like to delete this server?' /> <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"> <form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex gap-2">
<h2>General</h2>
<x-inputs.button type="submit">Save</x-inputs.button>
<x-inputs.button isWarning x-on:click.prevent="deleteServer = true">
Delete
</x-inputs.button>
</div>
<div class="flex flex-col gap-2 xl:flex-row"> <div class="flex flex-col gap-2 xl:flex-row">
<div class="flex flex-col w-96"> <div class="flex flex-col w-96">
<x-inputs.input id="server.name" label="Name" required /> <x-inputs.input id="server.name" label="Name" required />
<x-inputs.input id="server.description" label="Description" /> <x-inputs.input id="server.description" label="Description" />
<x-inputs.checkbox disabled type="checkbox" id="server.settings.is_part_of_swarm" {{-- <x-inputs.checkbox disabled type="checkbox" id="server.settings.is_part_of_swarm"
label="Is it part of a Swarm cluster?" /> label="Is it part of a Swarm cluster?" /> --}}
</div> </div>
<div class="flex flex-col w-96"> <div class="flex flex-col w-96">
@if ($server->id === 0) @if ($server->id === 0)
@ -23,9 +29,7 @@
</div> </div>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<x-inputs.button type="submit">Save</x-inputs.button> <x-inputs.button isHighlighted wire:click.prevent='validateServer'>
<x-inputs.button wire:click.prevent='validateServer'>
@if ($server->settings->is_validated) @if ($server->settings->is_validated)
Check Connection Check Connection
@else @else
@ -34,9 +38,7 @@
</x-inputs.button> </x-inputs.button>
{{-- <x-inputs.button wire:click.prevent='installDocker'>Install Docker</x-inputs.button> --}} {{-- <x-inputs.button wire:click.prevent='installDocker'>Install Docker</x-inputs.button> --}}
<x-inputs.button x-on:click.prevent="deleteServer = true">
Delete
</x-inputs.button>
</div> </div>
<div class="pt-3"> <div class="pt-3">
@isset($uptime) @isset($uptime)

View File

@ -8,21 +8,22 @@
</div> </div>
@if ($server->extra_attributes->proxy_type) @if ($server->extra_attributes->proxy_type)
<h3>Actions</h3>
<div wire:poll="proxyStatus"> <div wire:poll="proxyStatus">
@if ( @if (
$server->extra_attributes->last_applied_proxy_settings && $server->extra_attributes->last_applied_proxy_settings &&
$server->extra_attributes->last_saved_proxy_settings !== $server->extra_attributes->last_applied_proxy_settings) $server->extra_attributes->last_saved_proxy_settings !== $server->extra_attributes->last_applied_proxy_settings)
<div class="text-red-500">Configuration out of sync.</div> <div class="text-red-500">Configuration out of sync.</div>
<x-inputs.button wire:click="installProxy"> <x-inputs.button isHighlighted wire:click="installProxy">
Reconfigure Reconfigure
</x-inputs.button> </x-inputs.button>
@endif @endif
@if ($server->extra_attributes->proxy_status !== 'running') @if ($server->extra_attributes->proxy_status !== 'running')
<x-inputs.button wire:click="installProxy"> <x-inputs.button isHighlighted wire:click="installProxy">
Start Start
</x-inputs.button> </x-inputs.button>
@else @else
<x-inputs.button x-on:click.prevent="stopProxy = true">Stop <x-inputs.button isWarning x-on:click.prevent="stopProxy = true">Stop
</x-inputs.button> </x-inputs.button>
@endif @endif
<div class="py-4"> <div class="py-4">
@ -33,10 +34,10 @@
<x-loading /> <x-loading />
</div> </div>
@isset($proxy_settings) @isset($proxy_settings)
<h3>Configuration</h3>
@if ($selectedProxy->value === 'TRAEFIK_V2') @if ($selectedProxy->value === 'TRAEFIK_V2')
<form wire:submit.prevent='saveConfiguration'> <form wire:submit.prevent='saveConfiguration'>
<div class="py-2 pb-8"> <div class="flex items-center gap-2">
<h3>Configuration</h3>
<x-inputs.button type="submit">Save</x-inputs.button> <x-inputs.button type="submit">Save</x-inputs.button>
<x-inputs.button wire:click.prevent="resetProxy"> <x-inputs.button wire:click.prevent="resetProxy">
Reset Configuration Reset Configuration
@ -61,5 +62,4 @@
@else @else
<p>Server is not validated. Validate first.</p> <p>Server is not validated. Validate first.</p>
@endif @endif
</div> </div>