This commit is contained in:
Andras Bacsai
2023-05-22 22:30:33 +02:00
parent a044354294
commit c023fdae8b
30 changed files with 251 additions and 243 deletions

View File

@@ -0,0 +1,10 @@
<div>
<form wire:submit.prevent='submit'>
<div class="flex items-center gap-2">
<h3>Profile</h3>
<x-inputs.button type="submit" label="Save">Save</x-inputs.button>
</div>
<x-inputs.input id="name" label="Name" required />
<x-inputs.input id="email" label="Email" readonly />
</form>
</div>

View File

@@ -1,5 +1,5 @@
<div x-data="{ deleteApplication: false }">
<h2>Danger Zone</h2>
<x-naked-modal show="deleteApplication" />
<x-inputs.button isWarning x-on:click.prevent="deleteApplication = true">Delete this application</x-inputs.button>
<x-inputs.button x-on:click.prevent="deleteApplication = true">Delete this application</x-inputs.button>
</div>

View File

@@ -2,7 +2,7 @@
@if ($application->status === 'running')
<div class="dropdown dropdown-bottom">
<button tabindex="0"
class="flex items-center justify-center h-full text-white normal-case rounded bg-primary btn btn-xs hover:bg-primary no-animation">
class="flex items-center justify-center h-full text-white normal-case rounded-none bg-primary btn btn-xs hover:bg-primary no-animation">
Actions
<x-chevron-down />
</button>
@@ -16,11 +16,10 @@
</li>
</ul>
</div>
running
@else
<div class="dropdown dropdown-bottom">
<button tabindex="0"
class="flex items-center justify-center h-full text-white normal-case rounded bg-primary btn btn-xs hover:bg-primary no-animation">
class="flex items-center justify-center h-full text-white normal-case rounded-none bg-primary btn btn-xs hover:bg-primary no-animation">
Actions
<x-chevron-down />
</button>
@@ -34,15 +33,5 @@
</li>
</ul>
</div>
stopped
@endif
<span wire:poll.5000ms='pollingStatus'>
{{-- @if ($application->status === 'running')
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
<span class="text-green-500" wire:loading.remove.delay.longer>{{ $application->status }}</span>
@else
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
<span class="text-red-500" wire:loading.remove.delay.longer>{{ $application->status }}</span>
@endif --}}
</span>
</div>

View File

@@ -1,4 +1,4 @@
<form wire:submit.prevent='submit' class="flex flex-col px-2 max-w-fit">
<form wire:submit.prevent='submit' class="flex flex-col max-w-fit">
<div class="flex gap-2">
<x-inputs.input placeholder="NODE_ENV" noDirty id="key" label="Name" required />
<x-inputs.input placeholder="production" noDirty id="value" label="Value" required />

View File

@@ -1,5 +1,5 @@
<div x-data="{ deleteEnvironment: false }">
<form wire:submit.prevent='submit' class="flex flex-col px-2 max-w-fit">
<form wire:submit.prevent='submit' class="flex flex-col max-w-fit">
<div class="flex gap-2">
<x-inputs.input label="Name" id="env.key" />
<x-inputs.input label="Value" id="env.value" />

View File

@@ -1,4 +1,4 @@
<div
class="flex flex-col-reverse w-full overflow-y-auto border border-solid rounded border-coolgray-300 max-h-[32rem] p-4 text-xs text-white">
class="flex flex-col-reverse w-full overflow-y-auto border border-solid rounded border-coolgray-300 max-h-[32rem] p-4 mt-4 text-xs text-white">
<pre class="font-mono whitespace-pre-wrap" @if ($isKeepAliveOn) wire:poll.1000ms="polling" @endif>{{ \App\Actions\CoolifyTask\RunRemoteProcess::decodeOutput($activity) }}</pre>
</div>

View File

@@ -0,0 +1,15 @@
<div wire:poll.5000ms='pollingStatus'>
@if ($application->status === 'running')
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
<div class="flex items-center gap-2 text-sm" wire:loading.remove.delay.longer>
<span class="flex w-3 h-3 rounded-full bg-success"></span>
<span class="text-green-500">Running</span>
</div>
@else
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
<div class="flex items-center gap-2 text-sm" wire:loading.remove.delay.longer>
<span class="flex w-3 h-3 rounded-full bg-error"></span>
<span class="text-error">Stopped</span>
</div>
@endif
</div>

View File

@@ -5,7 +5,7 @@
<h2>General</h2>
<x-inputs.button type="submit">Save</x-inputs.button>
@if ($server_id !== 0)
<x-inputs.button isWarning x-on:click.prevent="deleteServer = true">
<x-inputs.button x-on:click.prevent="deleteServer = true">
Delete
</x-inputs.button>
@endif
@@ -17,32 +17,32 @@
{{-- <x-inputs.checkbox 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">
<div class="flex flex-col">
@if ($server->id === 0)
<x-inputs.input id="server.ip" label="IP Address" readonly />
<x-inputs.input id="server.user" label="User" readonly />
<x-inputs.input type="number" id="server.port" label="Port" readonly />
@else
<x-inputs.input id="server.ip" label="IP Address" required readonly />
<x-inputs.input id="server.user" label="User" required />
<x-inputs.input type="number" id="server.port" label="Port" required />
<div class="flex gap-2">
<x-inputs.input id="server.user" label="User" required />
<x-inputs.input type="number" id="server.port" label="Port" required />
</div>
@endif
</div>
</div>
<h3>Quick Actions</h3>
<div class="flex items-center gap-2">
<x-inputs.button isHighlighted wire:click.prevent='validateServer'>
<x-inputs.button wire:click.prevent='validateServer'>
@if ($server->settings->is_validated)
Check Connection
@else
Validate Server
@endif
</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> --}}
</div>
<div class="pt-3">
<div class="pt-3 text-sm">
@isset($uptime)
<p>Uptime: {{ $uptime }}</p>
@endisset
@@ -55,27 +55,25 @@
</div>
</form>
<div class="flex items-center gap-2 py-4">
<div class="font-bold">Private Key</div>
<a class="px-2"
href="{{ route('private-key.show', ['private_key_uuid' => data_get($server, 'privateKey.uuid')]) }}">
{{ data_get($server, 'privateKey.uuid') }}
</a>
<h3>Private Key</h3>
<a href="{{ route('server.private-key', ['server_uuid' => $server->uuid]) }}">
<x-inputs.button>Change</x-inputs.button>
</a>
</div>
<a href="{{ route('private-key.show', ['private_key_uuid' => data_get($server, 'privateKey.uuid')]) }}">
<button class="text-white btn-link">{{ data_get($server, 'privateKey.name') }}</button>
</a>
<div class="flex items-center gap-2 py-4">
<div class="font-bold">Destinations</div>
<div>
@foreach ($server->standaloneDockers as $docker)
<a class="px-2"
href="{{ route('destination.show', ['destination_uuid' => data_get($docker, 'uuid')]) }}">
{{ data_get($docker, 'network') }}
</a>
@endforeach
</div>
<h3>Destinations</h3>
<a href="{{ route('destination.new', ['server_id' => $server->id]) }}">
<x-inputs.button>Add</x-inputs.button>
</a>
</div>
<div>
@foreach ($server->standaloneDockers as $docker)
<a href="{{ route('destination.show', ['destination_uuid' => data_get($docker, 'uuid')]) }}">
<button class="text-white btn-link">{{ data_get($docker, 'network') }}</button>
</a>
@endforeach
</div>
</div>

View File

@@ -1,6 +1,9 @@
<div>
<div class="flex flex-wrap gap-2">
@forelse ($private_keys as $private_key)
<x-inputs.button wire:click='setPrivateKey({{ $private_key->id }})'>{{ $private_key->name }}</x-inputs.button>
<div class="w-64 box">
<button wire:click='setPrivateKey({{ $private_key->id }})'>{{ $private_key->name }}
</button>
</div>
@empty
<p>No private keys found</p>
@endforelse

View File

@@ -2,54 +2,61 @@
<x-naked-modal show="stopProxy" action="stopProxy"
message='Are you sure you would like to stop the proxy? All resources will be unavailable.' />
@if ($server->settings->is_validated)
<div class="flex items-center gap-2 mb-4">
<h2>Proxy</h2>
<div>{{ $server->extra_attributes->proxy_status }}</div>
<div class="flex items-center gap-2 mb-2">
<h2 class="pb-0">Proxy</h2>
@if ($server->extra_attributes->proxy_type)
<x-inputs.button isHighlighted wire:click.prevent="installProxy">
Start/Reconfigure Proxy
</x-inputs.button>
<x-inputs.button x-on:click.prevent="stopProxy = true">Stop
</x-inputs.button>
<div wire:poll="proxyStatus">
@if (
$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
</div>
@endif
@if ($server->extra_attributes->proxy_status === 'running')
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
<div class="flex items-center gap-2 text-sm" wire:loading.remove.delay.longer>
<span class="flex w-3 h-3 rounded-full bg-success"></span>
<span class="text-green-500">Running</span>
</div>
@else
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
<div class="flex items-center gap-2 text-sm" wire:loading.remove.delay.longer>
<span class="flex w-3 h-3 rounded-full bg-error"></span>
<span class="text-error">Stopped</span>
</div>
@endif
</div>
<livewire:activity-monitor />
@if ($server->extra_attributes->proxy_type)
<h3>Actions</h3>
<div wire:poll="proxyStatus">
@if (
$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>
<x-inputs.button isHighlighted wire:click="installProxy">
Reconfigure
</x-inputs.button>
@endif
@if ($server->extra_attributes->proxy_status !== 'running')
<x-inputs.button isHighlighted wire:click="installProxy">
Start
</x-inputs.button>
@else
<x-inputs.button isWarning x-on:click.prevent="stopProxy = true">Stop
</x-inputs.button>
@endif
<div class="py-4">
<livewire:activity-monitor />
</div>
<div x-init="$wire.checkProxySettingsInSync">
<div wire:loading wire:target="checkProxySettingsInSync">
<x-loading />
</div>
@isset($proxy_settings)
@if ($selectedProxy->value === 'TRAEFIK_V2')
<form wire:submit.prevent='saveConfiguration'>
<div class="flex items-center gap-2">
<h3>Configuration</h3>
<x-inputs.button type="submit">Save</x-inputs.button>
<x-inputs.button wire:click.prevent="resetProxy">
Reset Configuration
</x-inputs.button>
</div>
<h4>traefik.conf</h4>
<x-inputs.textarea noDirty name="proxy_settings" wire:model.defer="proxy_settings"
rows="30" />
</form>
@endif
@endisset
<div x-init="$wire.checkProxySettingsInSync">
<div wire:loading wire:target="checkProxySettingsInSync">
<x-loading />
</div>
@isset($proxy_settings)
@if ($selectedProxy->value === 'TRAEFIK_V2')
<form wire:submit.prevent='saveConfiguration'>
<div class="flex items-center gap-2">
<h3>Configuration</h3>
<x-inputs.button type="submit">Save</x-inputs.button>
<x-inputs.button wire:click.prevent="resetProxy">
Reset Configuration
</x-inputs.button>
</div>
<h4>traefik.conf</h4>
<x-inputs.textarea class="text-xs" noDirty name="proxy_settings"
wire:model.defer="proxy_settings" rows="30" />
</form>
@endif
@endisset
</div>
@else
<select wire:model="selectedProxy">

View File

@@ -1,6 +1,6 @@
<div class="pt-4">
<h3>Switch Team</h3>
@if (auth()->user()->otherTeams()->count() > 0)
<p>Switch to:</p>
<div class="flex gap-2">
@foreach (auth()->user()->otherTeams() as $team)
<x-inputs.button isHighlighted wire:key="{{ $team->id }}"
@@ -9,5 +9,4 @@
@endforeach
</div>
@endif
</div>