rollback job

This commit is contained in:
Andras Bacsai
2023-05-22 10:34:00 +02:00
parent 828ecc6803
commit ecf0b30513
8 changed files with 443 additions and 36 deletions

View File

@@ -3,28 +3,32 @@
'disabled' => null,
'confirm' => null,
'confirmAction' => null,
'tooltip' => null,
])
@if ($type === 'submit')
<button {{ $attributes }} type="submit" @if ($disabled !== null) disabled @endif wire:target="submit"
wire:loading.delay.shorter.class="loading"
@isset($confirm)
<div class="tooltip tooltip-warning" @isset($tooltip) data-tip="{{ $tooltip }}" @endisset>
@if ($type === 'submit')
<button {{ $attributes }} type="submit" @if ($disabled !== null) disabled @endif wire:target="submit"
wire:loading.delay.shorter.class="loading"
@isset($confirm)
x-on:click="toggleConfirmModal('{{ $confirm }}', '{{ explode('(', $confirmAction)[0] }}')"
@endisset
@isset($confirmAction)
@isset($confirmAction)
x-on:{{ explode('(', $confirmAction)[0] }}.window="$wire.{{ explode('(', $confirmAction)[0] }}"
@endisset>
{{ $slot }}
</button>
@elseif($type === 'button')
<button {{ $attributes }} @if ($disabled !== null) disabled @endif type="button"
wire:target="{{ explode('(', $attributes->whereStartsWith('wire:click')->first())[0] }}"
wire:loading.delay.shorter.class="loading"
@isset($confirm)
{{ $slot }}
</button>
@elseif($type === 'button')
<button {{ $attributes }} @if ($disabled !== null) disabled @endif type="button"
wire:target="{{ explode('(', $attributes->whereStartsWith('wire:click')->first())[0] }}"
wire:loading.delay.shorter.class="loading"
@isset($confirm)
x-on:click="toggleConfirmModal('{{ $confirm }}', '{{ explode('(', $confirmAction)[0] }}')"
@endisset
@isset($confirmAction)
@isset($confirmAction)
x-on:{{ explode('(', $confirmAction)[0] }}.window="$wire.{{ explode('(', $confirmAction)[0] }}"
@endisset>
{{ $slot }}
</button>
@endif
{{ $slot }}
</button>
@endif
</div>

View File

@@ -16,7 +16,7 @@
{{ $id }}
@endif
@if ($helper)
<div class="-mb-1 dropdown dropdown-right">
<div class="-mb-1 dropdown dropdown-right dropdown-hover">
<label tabindex="0" class="cursor-pointer text-warning">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
class="w-4 h-4 stroke-current">
@@ -25,7 +25,7 @@
</svg>
</label>
<div tabindex="0"
class="border-2 shadow whitespace-nowrap w-max-fit border-coolgray-500 card compact dropdown-content bg-coolgray-200">
class="border rounded shadow border-warning/30 card compact dropdown-content bg-coolgray-200 w-96">
<div class="card-body">
{!! $helper !!}
</div>

View File

@@ -22,7 +22,7 @@
<span class="text-warning">*</span>
@endif
@if ($helper)
<div class="-mb-1 dropdown dropdown-right">
<div class="-mb-1 dropdown dropdown-right dropdown-hover">
<label tabindex="0" class="cursor-pointer text-warning">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
class="w-4 h-4 stroke-current">
@@ -31,7 +31,7 @@
</svg>
</label>
<div tabindex="0"
class="border-2 shadow w-96 border-coolgray-500 card compact dropdown-content bg-coolgray-200">
class="border rounded shadow border-warning/30 card compact dropdown-content bg-coolgray-200 w-96">
<div class="card-body">
{!! $helper !!}
</div>

View File

@@ -1,8 +1,7 @@
<div>
<h2>Destination</h2>
<p>Server Name: {{ data_get($destination, 'server.name') }}</p>
@if (data_get($destination, 'server.description'))
<p>Description: {{ data_get($destination, 'server.description') }}</p>
@endif
<p>Docker Network: {{ $destination->network }}</p>
<div>
<p>Server: {{ data_get($destination, 'server.name') }}</p>
<p>Destination: {{ $destination->network }}</p>
</div>
</div>

View File

@@ -6,6 +6,7 @@
Save
</x-inputs.button>
</div>
<x-inputs.checkbox instantSave id="is_static" label="Static website?" />
<div class="flex flex-col gap-2 pb-4">
<div class="flex flex-col gap-2 xl:flex-row">
<x-inputs.input class="w-full" id="application.name" label="Name" required />
@@ -49,11 +50,12 @@
helper="A comma separated list of ports you would like to map to the host system. Useful when you do not want to use domains.<br><span class='inline-block font-bold text-warning'>Example</span>3000:3000,3002:3002" />
</div>
</div>
<h3>Advanced</h3>
<div class="flex flex-col">
<x-inputs.checkbox helper="More logs will be visible during a deployment." instantSave id="is_debug"
label="Debug" />
<x-inputs.checkbox instantSave id="is_static" label="Static website?" />
<x-inputs.checkbox helper="Git Webhooks won't deploy your application is you turn it off." instantSave
<x-inputs.checkbox helper="Automatically deploy new commits based on Git webhooks." instantSave
id="is_auto_deploy" label="Auto Deploy?" />
{{-- <x-inputs.checkbox helper="Preview deployments" instantSave id="is_previews" label="Previews?" /> --}}
<x-inputs.checkbox instantSave id="is_git_submodules_allowed" label="Git Submodules Allowed?" />

View File

@@ -9,23 +9,28 @@
<div wire:loading.remove wire:target='loadImages'>
<div class="flex flex-wrap">
@forelse ($images as $image)
<div class="w-1/2 p-2">
<div class="w-2/4 p-2">
<div class="rounded-lg shadow-lg bg-coolgray-200">
<div class="p-2">
<div class="text-sm">
@if (data_get($image, 'is_current'))
<span class="font-bold text-coollabs">LIVE</span>
<span class="font-bold text-warning">LIVE</span>
|
@endif
{{ data_get($image, 'tag') }}
SHA: {{ data_get($image, 'tag') }}
</div>
<div class="text-xs">{{ data_get($image, 'created_at') }}</div>
</div>
<div class="flex justify-end p-2">
<x-inputs.button wire:click="revertImage('{{ data_get($image, 'tag') }}')">
Revert
</x-inputs.button>
@if (data_get($image, 'is_current'))
<x-inputs.button disabled tooltip="This image is currently running.">
Rollback
</x-inputs.button>
@else
<x-inputs.button wire:click="rollbackImage('{{ data_get($image, 'tag') }}')">
Rollback
</x-inputs.button>
@endif
</div>
</div>
</div>