This commit is contained in:
Andras Bacsai
2023-05-16 11:39:18 +02:00
parent 752c86d8f7
commit a275ac5f41
11 changed files with 69 additions and 59 deletions

View File

@@ -39,7 +39,6 @@
</div>
<div class="pt-3">
@isset($uptime)
<p>Connection: OK</p>
<p>Uptime: {{ $uptime }}</p>
@endisset
@isset($dockerVersion)

View File

@@ -1,27 +1,25 @@
<div>
@if ($server->settings->is_validated)
@if ($this->server->extra_attributes->proxy_status !== 'running')
<select wire:model="selectedProxy">
<option value="{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}">
{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}
</option>
</select>
<x-inputs.button isBold wire:click="setProxy">Set Proxy</x-inputs.button>
@endif
@if ($this->server->extra_attributes->proxy_type)
<div class="flex items-center gap-2">
<h3>Proxy</h3>
<div>{{ $server->extra_attributes->proxy_status }}</div>
</div>
@if ($server->extra_attributes->proxy_type)
<div wire:poll="proxyStatus">
@if (
$this->server->extra_attributes->last_applied_proxy_settings &&
$this->server->extra_attributes->last_saved_proxy_settings !==
$this->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)
<div class="text-red-500">Configuration out of sync.</div>
@endif
@if ($this->server->extra_attributes->proxy_status !== 'running')
@if ($server->extra_attributes->proxy_status !== 'running')
<x-inputs.button isBold wire:click="installProxy">
Install
Start
</x-inputs.button>
@else
<x-inputs.button isWarning wire:click="stopProxy">Stop</x-inputs.button>
@endif
<x-inputs.button isBold wire:click="stopProxy">Stop</x-inputs.button>
<span x-data="{ showConfiguration: false }">
<x-inputs.button isBold x-on:click.prevent="showConfiguration = !showConfiguration">Show
Configuration
@@ -35,16 +33,14 @@
<div wire:loading wire:target="checkProxySettingsInSync">
<x-proxy.loading />
</div>
@isset($this->proxy_settings)
@isset($proxy_settings)
<form wire:submit.prevent='saveConfiguration'>
<x-inputs.button isBold>Save</x-inputs.button>
<x-inputs.button x-on:click="showConfiguration = false" isBold
wire:click.prevent="installProxy">
Apply
</x-inputs.button>
<x-inputs.button isBold wire:click.prevent="resetProxy">
Default
</x-inputs.button>
<div class="pb-2">
<x-inputs.button isBold>Save</x-inputs.button>
<x-inputs.button wire:click.prevent="resetProxy">
Reset Configuration
</x-inputs.button>
</div>
<textarea wire:model.defer="proxy_settings" class="w-full" rows="30"></textarea>
</form>
@endisset
@@ -52,6 +48,13 @@
</template>
</span>
</div>
@else
<select wire:model="selectedProxy">
<option value="{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}">
{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}
</option>
</select>
<x-inputs.button isBold wire:click="setProxy">Set Proxy</x-inputs.button>
@endif
@else
<p>Server is not validated. Validate first.</p>

View File

@@ -2,7 +2,7 @@
@if ($private_keys->count() === 0)
<h2>Create private key</h2>
<div>You need to create a private key before you can create a server.</div>
<livewire:private-key.create />
<livewire:private-key.create from="server" />
@else
<livewire:server.new.by-ip :private_keys="$private_keys" />
@endif

View File

@@ -1,12 +1,5 @@
<x-layout>
<div class="text-3xl font-bold">Server</div>
<div class="flex flex-col pb-4">
@if ($server->settings->is_validated)
<div class="text-green-400">Validated</div>
@else
<div class="text-red-400">Not validated</div>
@endif
</div>
<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'general' }">
<div class="flex gap-4">
<a :class="activeTab === 'general' && 'text-purple-500'"
@@ -39,7 +32,7 @@
<div class="flex items-center gap-2">
<h3>Destinations</h3>
<a href="{{ route('destination.new', ['server_id' => $server->id]) }}">
<x-inputs.button isBold>New</x-inputs.button>
<x-inputs.button>Add a new</x-inputs.button>
</a>
</div>
@if ($server->standaloneDockers->count() > 0)
@@ -51,17 +44,7 @@
@endif
</div>
<div x-cloak x-show="activeTab === 'proxy'">
<div class="flex items-center gap-2">
<h3>Proxy</h3>
@if ($server->settings->is_validated)
<div>{{ $server->extra_attributes->proxy_status }}</div>
@endif
</div>
<livewire:server.proxy :server="$server" />
</div>
</div>
</x-layout>