fix deployment button ux (#186)

This commit is contained in:
Saeed Vaziry 2024-05-01 09:34:01 +02:00 committed by GitHub
parent ebbd81348a
commit 3c4435701d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,15 +1,26 @@
<div> <div>
@if ($site->deploymentScript) @php
<form $hasDeploymentScript = (bool) $site->deploymentScript;
id="deploy" @endphp
<form
id="deploy"
@if ($hasDeploymentScript)
hx-post="{{ route("servers.sites.application.deploy", ["server" => $server, "site" => $site]) }}" hx-post="{{ route("servers.sites.application.deploy", ["server" => $server, "site" => $site]) }}"
hx-swap="outerHTML" hx-swap="outerHTML"
hx-select="#deploy" hx-select="#deploy"
@else
data-tooltip="Click the Manage button to add a deployment script first"
@endif
>
<x-primary-button
class="flex items-center justify-between"
:active="true"
hx-disable
:disabled="(bool) !$hasDeploymentScript"
> >
<x-primary-button class="flex items-center justify-between" :active="true" hx-disable> {{ __("Deploy") }}
{{ __("Deploy") }} <x-heroicon name="o-play-circle" class="ml-1 h-5 w-5" />
<x-heroicon name="o-play-circle" class="ml-1 h-5 w-5" /> </x-primary-button>
</x-primary-button> </form>
</form>
@endif
</div> </div>