Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat(ui): use split action button

peaklabs-devab44b1e06991
diff --git a/resources/views/livewire/project/application/heading.blade.php b/resources/views/livewire/project/application/heading.blade.php
index 3892a623ca..df7522eacf 100644
--- a/resources/views/livewire/project/application/heading.blade.php
+++ b/resources/views/livewire/project/application/heading.blade.php
@@ -40,116 +40,62 @@
<div class="w-full xl:hidden">
@if (!($application->build_pack === 'dockercompose' && is_null($application->docker_compose_raw)))
@can('deploy', $application)
- <div id="application-mobile-actions" class="relative mb-3"
- x-data="{ open: false }" @click.outside="open = false"
- @keydown.escape.window="open = false">
- <button type="button" class="button w-full justify-between" @click="open = !open"
- :aria-expanded="open" aria-haspopup="menu">
- <span class="inline-flex items-center gap-2">
- Actions
- </span>
- <span class="inline-flex transition-transform" :class="open && 'rotate-180'">
- <x-reicon name="chevron-down" class="size-3 opacity-55" />
- </span>
- </button>
-
- <div x-cloak x-show="open" x-transition.origin.top.left
- class="listbox-panel top-full! left-0! right-0! mt-1! w-full! min-w-0!" role="menu">
- @if (!str($application->status)->startsWith('exited'))
+ <x-split-action id="application-mobile-actions" class="mb-3 flex w-full">
+ @if (str($application->status)->startsWith('exited'))
+ <x-slot:main wire:click="deploy">
+ <x-reicon name="play-circle" class="size-3.5" />
+ Deploy
+ </x-slot:main>
@if (!$application->destination->server->isSwarm())
- @can('deploy', $application)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- wire:click="deploy" @click="open = false" role="menuitem">
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- Deploy
- </button>
+ <button type="button" class="listbox-option justify-start! gap-2.5!" wire:click="deploy(true)"
+ @click="open = false" role="menuitem">
+ <x-reicon name="refresh" class="size-3.5 opacity-70" />
+ Deploy (without cache)
+ </button>
+ @endif
+ @else
+ @if ($application->destination->server->isSwarm())
+ @if ($application->build_pack !== 'dockercompose')
+ <x-slot:main wire:click="deploy">
+ <x-reicon name="refresh" class="size-3.5" />
+ Update Service
+ </x-slot:main>
@else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled
+ <x-slot:main @click="document.getElementById('application-mobile-stop-trigger')?.click()">
+ <x-reicon name="stop-circle" class="size-3.5" />
+ Stop
+ </x-slot:main>
+ @endif
+ @else
+ <x-slot:main wire:click="deploy">
+ <x-reicon name="refresh" class="size-3.5" />
+ Redeploy
+ </x-slot:main>
+ <button type="button" class="listbox-option justify-start! gap-2.5!"
+ wire:click="{{ str($application->status)->startsWith('running') ? 'force_deploy_without_cache' : 'deploy(true)' }}"
+ @click="open = false" role="menuitem">
+ <x-reicon name="refresh" class="size-3.5 opacity-70" />
+ {{ str($application->status)->startsWith('running') ? 'Redeploy (without cache)' : 'Deploy (without cache)' }}
+ </button>
+ @if ($application->build_pack !== 'dockercompose')
+ <button type="button" class="listbox-option justify-start! gap-2.5!"
+ @click="open = false; document.getElementById('application-mobile-restart-trigger')?.click()"
role="menuitem">
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- Deploy
+ <x-reicon name="restart" class="size-3.5 opacity-70" />
+ Restart
</button>
- @endcan
- @endif
- @if ($application->build_pack !== 'dockercompose')
- @if ($application->destination->server->isSwarm())
- @can('deploy', $application)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- wire:click="deploy" @click="open = false" role="menuitem">
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- Update Service
- </button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled
- role="menuitem">
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- Update Service
- </button>
- @endcan
- @else
- @can('deploy', $application)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; document.getElementById('application-mobile-restart-trigger')?.click()"
- role="menuitem">
- <x-reicon name="restart" class="size-3.5 opacity-70" />
- Restart
- </button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled
- role="menuitem">
- <x-reicon name="restart" class="size-3.5 opacity-70" />
- Restart
- </button>
- @endcan
@endif
@endif
- @can('deploy', $application)
+ @unless ($application->destination->server->isSwarm() && $application->build_pack === 'dockercompose')
<button type="button" class="listbox-option justify-start! gap-2.5!"
@click="open = false; document.getElementById('application-mobile-stop-trigger')?.click()"
role="menuitem">
<x-reicon name="stop-circle" class="size-3.5 text-error" />
Stop
</button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled
- role="menuitem">
- <x-reicon name="stop-circle" class="size-3.5 opacity-70" />
- Stop
- </button>
- @endcan
- @else
- @can('deploy', $application)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- wire:click="deploy" @click="open = false" role="menuitem">
- <x-reicon name="play-circle" class="size-3.5 opacity-70" />
- Deploy
- </button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled
- role="menuitem">
- <x-reicon name="play-circle" class="size-3.5 opacity-70" />
- Deploy
- </button>
- @endcan
+ @endunless
@endif
- @if (!$application->destination->server->isSwarm())
- @can('deploy', $application)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- wire:click="{{ $application->status === 'running' ? 'force_deploy_without_cache' : 'deploy(true)' }}"
- @click="open = false" role="menuitem">
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- Deploy (without cache)
- </button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled
- role="menuitem">
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- Deploy (without cache)
- </button>
- @endcan
- @endif
- </div>
- </div>
+ </x-split-action>
@endcan
@endif
<div class="hidden" aria-hidden="true">
@@ -188,100 +134,62 @@
<x-applications.links :application="$application" />
</div>
@can('deploy', $application)
- <div id="application-desktop-actions" class="relative" x-data="{ open: false }"
- x-effect="$dispatch('resource-actions-toggled', { open })"
- @click.outside="open = false" @keydown.escape.window="open = false">
- <button type="button" class="button button-highlighted" @click="open = !open" :aria-expanded="open"
- aria-haspopup="menu">
- Actions
- <x-reicon name="chevron-down" class="size-3 opacity-55" />
- </button>
-
- <div x-cloak x-show="open" x-transition.origin.top.right
- class="listbox-panel top-full! right-0! left-auto! mt-1! w-60! min-w-0!" role="menu">
+ <x-split-action id="application-desktop-actions">
@if (str($application->status)->startsWith('exited'))
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('deploy', $application))
- wire:click="deploy" @click="open = false" role="menuitem">
- <x-reicon name="play-circle" class="size-3.5 opacity-70" />
+ <x-slot:main wire:click="deploy">
+ <x-reicon name="play-circle" class="size-3.5" />
Deploy
- </button>
+ </x-slot:main>
@if (!$application->destination->server->isSwarm())
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('deploy', $application))
- wire:click="deploy(true)" @click="open = false" role="menuitem">
+ <button type="button" class="listbox-option justify-start! gap-2.5!" wire:click="deploy(true)"
+ @click="open = false" role="menuitem">
<x-reicon name="refresh" class="size-3.5 opacity-70" />
Deploy (without cache)
</button>
@endif
@else
- @if (!$application->destination->server->isSwarm())
- @can('deploy', $application)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- wire:click="deploy" @click="open = false" role="menuitem">
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- Redeploy
- </button>
+ @if ($application->destination->server->isSwarm())
+ @if ($application->build_pack !== 'dockercompose')
+ <x-slot:main wire:click="deploy">
+ <x-reicon name="refresh" class="size-3.5" />
+ Update Service
+ </x-slot:main>
@else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled>
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- Redeploy
- </button>
- @endcan
+ <x-slot:main @click="document.getElementById('application-mobile-stop-trigger')?.click()">
+ <x-reicon name="stop-circle" class="size-3.5" />
+ Stop
+ </x-slot:main>
+ @endif
+ @else
+ <x-slot:main wire:click="deploy">
+ <x-reicon name="refresh" class="size-3.5" />
+ Redeploy
+ </x-slot:main>
<button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('deploy', $application))
wire:click="{{ str($application->status)->startsWith('running') ? 'force_deploy_without_cache' : 'deploy(true)' }}"
@click="open = false" role="menuitem">
<x-reicon name="refresh" class="size-3.5 opacity-70" />
{{ str($application->status)->startsWith('running') ? 'Redeploy (without cache)' : 'Deploy (without cache)' }}
</button>
- @endif
- @if ($application->build_pack !== 'dockercompose')
- @if ($application->destination->server->isSwarm())
- @can('deploy', $application)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- wire:click="deploy" @click="open = false" role="menuitem">
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- Update Service
- </button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled>
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- Update Service
- </button>
- @endcan
- @else
- @can('deploy', $application)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; document.getElementById('application-mobile-restart-trigger')?.click()"
- role="menuitem">
- <x-reicon name="restart" class="size-3.5 opacity-70" />
- Restart
- </button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled>
- <x-reicon name="restart" class="size-3.5 opacity-70" />
- Restart
- </button>
- @endcan
+ @if ($application->build_pack !== 'dockercompose')
+ <button type="button" class="listbox-option justify-start! gap-2.5!"
+ @click="open = false; document.getElementById('application-mobile-restart-trigger')?.click()"
+ role="menuitem">
+ <x-reicon name="restart" class="size-3.5 opacity-70" />
+ Restart
+ </button>
@endif
@endif
- @can('deploy', $application)
+ @unless ($application->destination->server->isSwarm() && $application->build_pack === 'dockercompose')
<button type="button" class="listbox-option justify-start! gap-2.5!"
@click="open = false; document.getElementById('application-mobile-stop-trigger')?.click()"
role="menuitem">
<x-reicon name="stop-circle" class="size-3.5 text-error" />
Stop
</button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled>
- <x-reicon name="stop-circle" class="size-3.5 opacity-70" />
- Stop
- </button>
- @endcan
+ @endunless
@endif
- </div>
- </div>
+ </x-split-action>
@endcan
@endif
</div>
diff --git a/resources/views/livewire/project/database/heading.blade.php b/resources/views/livewire/project/database/heading.blade.php
index bcdf1cf855..6519b419d1 100644
--- a/resources/views/livewire/project/database/heading.blade.php
+++ b/resources/views/livewire/project/database/heading.blade.php
@@ -70,64 +70,24 @@
<div class="w-full xl:hidden">
@if ($database->destination->server->isFunctional())
@can('manage', $database)
- <div id="database-mobile-actions" class="relative mb-3"
- x-data="{ open: false }" @click.outside="open = false"
- @keydown.escape.window="open = false">
- <button type="button" class="button w-full justify-between" @click="open = !open"
- :aria-expanded="open" aria-haspopup="menu">
- <span class="inline-flex items-center gap-2">
- Actions
- </span>
- <span class="inline-flex transition-transform" :class="open && 'rotate-180'">
- <x-reicon name="chevron-down" class="size-3 opacity-55" />
- </span>
- </button>
-
- <div x-cloak x-show="open" x-transition.origin.top.left
- class="listbox-panel top-full! left-0! right-0! mt-1! w-full! min-w-0!" role="menu">
+ <x-split-action id="database-mobile-actions" class="mb-3 flex w-full">
@if (! $databaseStatus->startsWith('exited'))
- @can('manage', $database)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; document.getElementById('database-restart-trigger')?.click()"
- role="menuitem">
- <x-reicon name="restart" class="size-3.5 opacity-70" />
- Restart
- </button>
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; document.getElementById('database-stop-trigger')?.click()"
- role="menuitem">
- <x-reicon name="stop" class="size-3.5 text-error" />
- Stop
- </button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled
- role="menuitem">
- <x-reicon name="restart" class="size-3.5 opacity-70" />
- Restart
- </button>
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled
- role="menuitem">
- <x-reicon name="stop" class="size-3.5 opacity-70" />
- Stop
- </button>
- @endcan
+ <x-slot:main @click="document.getElementById('database-restart-trigger')?.click()">
+ <x-reicon name="restart" class="size-3.5" />
+ Restart
+ </x-slot:main>
+ <button type="button" class="listbox-option justify-start! gap-2.5!"
+ @click="open = false; document.getElementById('database-stop-trigger')?.click()" role="menuitem">
+ <x-reicon name="stop-circle" class="size-3.5 text-error" />
+ Stop
+ </button>
@else
- @can('manage', $database)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; $wire.dispatch('startEvent')" role="menuitem">
- <x-reicon name="play-circle" class="size-3.5 opacity-70" />
- Start
- </button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled
- role="menuitem">
- <x-reicon name="play-circle" class="size-3.5 opacity-70" />
- Start
- </button>
- @endcan
+ <x-slot:main @click="$wire.dispatch('startEvent')">
+ <x-reicon name="play-circle" class="size-3.5" />
+ Start
+ </x-slot:main>
@endif
- </div>
- </div>
+ </x-split-action>
@endcan
@endif
@@ -140,25 +100,24 @@
<div class="resource-heading-actions flex shrink-0 items-center gap-0.5">
@if ($database->destination->server->isFunctional())
@can('manage', $database)
- <div id="database-desktop-actions" class="flex items-center gap-0.5">
- @if (! $databaseStatus->startsWith('exited'))
- <button type="button" class="button button-highlighted"
- @disabled(!auth()->user()->can('manage', $database))
- @click="document.getElementById('database-restart-trigger')?.click()">
- Restart
- </button>
- <button type="button" class="button"
- @disabled(!auth()->user()->can('manage', $database))
- @click="document.getElementById('database-stop-trigger')?.click()">
- Stop
- </button>
- @else
- <x-forms.button class="button-highlighted" canGate="manage" :canResource="$database"
- @click="$wire.dispatch('startEvent')">
- Start
- </x-forms.button>
- @endif
- </div>
+ <x-split-action id="database-desktop-actions">
+ @if (! $databaseStatus->startsWith('exited'))
+ <x-slot:main @click="document.getElementById('database-restart-trigger')?.click()">
+ <x-reicon name="restart" class="size-3.5" />
+ Restart
+ </x-slot:main>
+ <button type="button" class="listbox-option justify-start! gap-2.5!"
+ @click="open = false; document.getElementById('database-stop-trigger')?.click()" role="menuitem">
+ <x-reicon name="stop-circle" class="size-3.5 text-error" />
+ Stop
+ </button>
+ @else
+ <x-slot:main @click="$wire.dispatch('startEvent')">
+ <x-reicon name="play-circle" class="size-3.5" />
+ Start
+ </x-slot:main>
+ @endif
+ </x-split-action>
@endcan
@else
<x-status-badge status="Server unavailable" type="error" />
diff --git a/resources/views/livewire/project/service/heading.blade.php b/resources/views/livewire/project/service/heading.blade.php
index b022eef10c..d08572dd7c 100644
--- a/resources/views/livewire/project/service/heading.blade.php
+++ b/resources/views/livewire/project/service/heading.blade.php
@@ -74,85 +74,40 @@
<div class="w-full xl:hidden">
@if ($service->isDeployable)
@can('deploy', $service)
- <div id="service-mobile-actions" class="relative mb-3"
- x-data="{ open: false }" @click.outside="open = false"
- @keydown.escape.window="open = false">
- <button type="button" class="button w-full justify-between" x-bind:disabled="deploying"
- @click="open = !open"
- :aria-expanded="open" aria-haspopup="menu">
- <span class="inline-flex items-center gap-2">
- <x-loading-on-button x-show="deploying" x-cloak />
- <span x-text="deploying ? 'Deploying…' : 'Actions'">Actions</span>
- </span>
- <span class="inline-flex transition-transform" :class="open && 'rotate-180'">
- <x-reicon name="chevron-down" class="size-3 opacity-55" />
- </span>
- </button>
-
- <div x-cloak x-show="open" x-transition.origin.top.left
- class="listbox-panel top-full! left-0! right-0! mt-1! w-full! min-w-0!" role="menu">
+ <x-split-action id="service-mobile-actions" class="mb-3 flex w-full">
@if ($serviceStatus->contains('running') || $serviceStatus->contains('degraded'))
- @can('deploy', $service)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; document.getElementById('service-restart-trigger')?.click()"
- role="menuitem">
- <x-reicon name="restart" class="size-3.5 opacity-70" />
- Restart current version
- </button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled
- role="menuitem">
- <x-reicon name="restart" class="size-3.5 opacity-70" />
- Restart current version
- </button>
- @endcan
+ <x-slot:main x-bind:disabled="deploying"
+ @click="document.getElementById('service-restart-trigger')?.click()">
+ <x-reicon name="restart" class="size-3.5" />
+ Restart
+ </x-slot:main>
@if ($serviceStatus->contains('running'))
<button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('deploy', $service))
- @click="$wire.dispatch('pullAndRestartEvent'); open = false"
- role="menuitem">
+ @click="$wire.dispatch('pullAndRestartEvent'); open = false" role="menuitem">
<x-reicon name="refresh" class="size-3.5 opacity-70" />
- Pull latest and restart
+ Restart (pull latest)
</button>
- @else
+ @endif
+ @if ($serviceStatus->contains('degraded'))
<button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('deploy', $service))
- @click="$wire.dispatch('forceDeployEvent'); open = false"
- role="menuitem">
+ @click="$wire.dispatch('forceDeployEvent'); open = false" role="menuitem">
<x-reicon name="refresh" class="size-3.5 opacity-70" />
Force Restart
</button>
@endif
- @can('stop', $service)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; document.getElementById('service-stop-trigger')?.click()"
- role="menuitem">
- <x-reicon name="stop-circle" class="size-3.5 text-error" />
- Stop
- </button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled
- role="menuitem">
- <x-reicon name="stop-circle" class="size-3.5 opacity-70" />
- Stop
- </button>
- @endcan
+ <button type="button" class="listbox-option justify-start! gap-2.5!"
+ @disabled(!auth()->user()->can('stop', $service))
+ @click="open = false; document.getElementById('service-stop-trigger')?.click()" role="menuitem">
+ <x-reicon name="stop-circle" class="size-3.5 text-error" />
+ Stop
+ </button>
@else
- @can('deploy', $service)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; deploying = true; $wire.dispatch('startEvent')" role="menuitem">
- <x-reicon name="play-circle" class="size-3.5 opacity-70" />
- Deploy
- </button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!" disabled
- role="menuitem">
- <x-reicon name="play-circle" class="size-3.5 opacity-70" />
- Deploy
- </button>
- @endcan
+ <x-slot:main x-bind:disabled="deploying" @click="deploying = true; $wire.dispatch('startEvent')">
+ <x-loading-on-button x-show="deploying" x-cloak />
+ <x-reicon name="play-circle" class="size-3.5" x-show="!deploying" />
+ <span x-text="deploying ? 'Deploying…' : 'Deploy'">Deploy</span>
+ </x-slot:main>
<button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('deploy', $service))
@click="$wire.dispatch('forceDeployEvent'); open = false" role="menuitem">
<x-reicon name="refresh" class="size-3.5 opacity-70" />
Force Deploy
@@ -164,8 +119,7 @@
Force Cleanup Containers
</button>
@endif
- </div>
- </div>
+ </x-split-action>
@endcan
@else
<a href="{{ $environmentVariablesUrl }}" {{ wireNavigate() }}
@@ -186,70 +140,52 @@
<x-services.links :service="$service" />
</div>
@can('deploy', $service)
- <div id="service-desktop-actions" class="relative" x-data="{ open: false }"
- x-effect="$dispatch('resource-actions-toggled', { open })"
- @click.outside="open = false" @keydown.escape.window="open = false">
- <button type="button" class="button button-highlighted" @click="open = !open" :aria-expanded="open">
- Actions
- <x-reicon name="chevron-down" class="size-3 opacity-55" />
- </button>
- <div x-cloak x-show="open" x-transition.origin.top.right
- class="listbox-panel top-full! right-0! left-auto! mt-1! w-64! min-w-0!" role="menu">
- @if ($serviceStatus->contains('running') || $serviceStatus->contains('degraded'))
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('deploy', $service))
- @click="open = false; document.getElementById('service-restart-trigger')?.click()">
- <x-reicon name="restart" class="size-3.5 opacity-70" />
- Restart
- </button>
- @if ($serviceStatus->contains('running'))
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('deploy', $service))
- @click="$wire.dispatch('pullAndRestartEvent'); open = false">
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- Restart (pull latest)
- </button>
- @endif
+ <x-split-action id="service-desktop-actions">
+ @if ($serviceStatus->contains('running') || $serviceStatus->contains('degraded'))
+ <x-slot:main x-bind:disabled="deploying"
+ @click="document.getElementById('service-restart-trigger')?.click()">
+ <x-reicon name="restart" class="size-3.5" />
+ Restart
+ </x-slot:main>
+ @if ($serviceStatus->contains('running'))
<button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('stop', $service))
- @click="open = false; document.getElementById('service-stop-trigger')?.click()">
- <x-reicon name="stop-circle" class="size-3.5 text-error" />
- Stop
- </button>
- @elseif (! $serviceStatus->contains('running'))
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('deploy', $service))
- @click="deploying = true; $wire.dispatch('startEvent'); open = false">
- <x-reicon name="play-circle" class="size-3.5 opacity-70" />
- Deploy
+ @click="$wire.dispatch('pullAndRestartEvent'); open = false" role="menuitem">
+ <x-reicon name="refresh" class="size-3.5 opacity-70" />
+ Restart (pull latest)
</button>
@endif
- @if (! $serviceStatus->contains('running'))
- <div class="my-1 border-t border-coolgray-200 dark:border-coolgray-300" role="separator"></div>
- @endif
@if ($serviceStatus->contains('degraded'))
<button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('deploy', $service))
- @click="$wire.dispatch('forceDeployEvent'); open = false">
+ @click="$wire.dispatch('forceDeployEvent'); open = false" role="menuitem">
<x-reicon name="refresh" class="size-3.5 opacity-70" />
Force Restart
</button>
- @elseif (! $serviceStatus->contains('running'))
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('deploy', $service))
- @click="$wire.dispatch('forceDeployEvent'); open = false">
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- Force Deploy
- </button>
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @disabled(!auth()->user()->can('stop', $service))
- @click="$wire.dispatch('cleanupEvent'); open = false">
- <x-reicon name="trash" class="size-3.5 opacity-70" />
- Force Cleanup Containers
- </button>
@endif
- </div>
- </div>
+ <button type="button" class="listbox-option justify-start! gap-2.5!"
+ @disabled(!auth()->user()->can('stop', $service))
+ @click="open = false; document.getElementById('service-stop-trigger')?.click()" role="menuitem">
+ <x-reicon name="stop-circle" class="size-3.5 text-error" />
+ Stop
+ </button>
+ @else
+ <x-slot:main x-bind:disabled="deploying" @click="deploying = true; $wire.dispatch('startEvent')">
+ <x-loading-on-button x-show="deploying" x-cloak />
+ <x-reicon name="play-circle" class="size-3.5" x-show="!deploying" />
+ <span x-text="deploying ? 'Deploying…' : 'Deploy'">Deploy</span>
+ </x-slot:main>
+ <button type="button" class="listbox-option justify-start! gap-2.5!"
+ @click="$wire.dispatch('forceDeployEvent'); open = false" role="menuitem">
+ <x-reicon name="refresh" class="size-3.5 opacity-70" />
+ Force Deploy
+ </button>
+ <button type="button" class="listbox-option justify-start! gap-2.5!"
+ @disabled(!auth()->user()->can('stop', $service))
+ @click="$wire.dispatch('cleanupEvent'); open = false" role="menuitem">
+ <x-reicon name="trash" class="size-3.5 opacity-70" />
+ Force Cleanup Containers
+ </button>
+ @endif
+ </x-split-action>
@endcan
@else
<a href="{{ $environmentVariablesUrl }}" {{ wireNavigate() }}
diff --git a/resources/views/livewire/server/navbar.blade.php b/resources/views/livewire/server/navbar.blade.php
index e75f77b5b4..d974262990 100644
--- a/resources/views/livewire/server/navbar.blade.php
+++ b/resources/views/livewire/server/navbar.blade.php
@@ -165,66 +165,40 @@
<div class="w-full xl:hidden">
@if ($server->proxySet())
@can('manageProxy', $server)
- <div id="server-mobile-actions" class="relative mb-3"
- x-data="{ open: false }" @click.outside="open = false"
- @keydown.escape.window="open = false">
- <button type="button" class="button w-full justify-between" @click="open = !open"
- :aria-expanded="open" aria-haspopup="menu">
- <span class="inline-flex items-center gap-2">
- Actions
- </span>
- <span class="inline-flex transition-transform" :class="open && 'rotate-180'">
- <x-reicon name="chevron-down" class="size-3 opacity-55" />
- </span>
- </button>
-
- <div x-cloak x-show="open" x-transition.origin.top.left
- class="listbox-panel top-full! left-0! right-0! mt-1! w-full! min-w-0!" role="menu">
- @if ($proxyCanBeStopped)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; document.getElementById('server-mobile-restart-proxy-trigger')?.click()"
- role="menuitem">
- <span class="flex size-4 shrink-0 items-center justify-center">
- <x-reicon name="restart" class="size-3.5 text-orange-500 dark:text-warning" />
- </span>
- Restart Proxy
- </button>
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; document.getElementById('server-mobile-stop-proxy-trigger')?.click()"
- role="menuitem">
- <span class="flex size-4 shrink-0 items-center justify-center">
- <x-reicon name="stop-circle" class="size-3.5 text-error" />
- </span>
- Stop Proxy
- </button>
- @if ($traefikDashboardAvailable)
- <a class="listbox-option justify-start! gap-2.5!" target="_blank"
- href="http://{{ $serverIp }}:8080" @click="open = false" role="menuitem">
- <span class="flex size-4 shrink-0 items-center justify-center">
- <x-reicon name="external-link" class="size-3! opacity-70" />
- </span>
- Traefik Dashboard
- </a>
- @endif
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; $wire.dispatch('checkProxyEvent')" role="menuitem">
- <span class="flex size-4 shrink-0 items-center justify-center">
- <x-reicon name="play-circle" class="size-3.5 text-warning" />
- </span>
- Start Proxy
- </button>
- @endif
+ <x-split-action id="server-mobile-actions" class="mb-3 flex w-full">
+ @if ($proxyCanBeStopped)
+ <x-slot:main wire:loading.attr="disabled" wire:loading.class="is-loading"
+ wire:target="checkProxy,startProxy"
+ @click="document.getElementById('server-mobile-restart-proxy-trigger')?.click()">
+ <x-reicon name="restart" class="size-3.5" />
+ Restart Proxy
+ </x-slot:main>
<button type="button" class="listbox-option justify-start! gap-2.5!"
- wire:click="checkProxyStatus" wire:loading.attr="disabled"
- @click="open = false" role="menuitem">
- <span class="flex size-4 shrink-0 items-center justify-center">
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- </span>
- Refresh Proxy Status
+ @click="open = false; document.getElementById('server-mobile-stop-proxy-trigger')?.click()"
+ role="menuitem">
+ <x-reicon name="stop-circle" class="size-3.5 text-error" />
+ Stop Proxy
</button>
- </div>
- </div>
+ @else
+ <x-slot:main wire:loading.attr="disabled" wire:loading.class="is-loading"
+ wire:target="checkProxy,startProxy" @click="$wire.dispatch('checkProxyEvent')">
+ <x-reicon name="play-circle" class="size-3.5" />
+ Start Proxy
+ </x-slot:main>
+ @endif
+ <button type="button" class="listbox-option justify-start! gap-2.5!" wire:click="checkProxyStatus"
+ wire:loading.attr="disabled" @click="open = false" role="menuitem">
+ <x-reicon name="refresh" class="size-3.5 opacity-70" />
+ Refresh Proxy Status
+ </button>
+ @if ($traefikDashboardAvailable)
+ <a class="listbox-option justify-start! gap-2.5!" target="_blank"
+ href="http://{{ $serverIp }}:8080" @click="open = false" role="menuitem">
+ <x-reicon name="external-link" class="size-3.5 opacity-70" />
+ Traefik Dashboard
+ </a>
+ @endif
+ </x-split-action>
{{-- Programmatic open only (clicked from the Actions menu). Keep fully
display:none so the modal shells never reserve a layout row. --}}
@@ -299,66 +273,40 @@
@if ($server->proxySet())
@can('manageProxy', $server)
- <div id="server-desktop-actions" class="resource-heading-actions relative shrink-0"
- x-data="{ open: false }" x-effect="$dispatch('resource-actions-toggled', { open })"
- @click.outside="open = false"
- @keydown.escape.window="open = false">
- <button type="button" class="button button-highlighted" @click="open = !open" :aria-expanded="open"
- aria-haspopup="menu" wire:loading.attr="disabled" wire:loading.class="is-loading"
- wire:target="checkProxy,startProxy">
- Actions
- <x-reicon name="chevron-down" class="size-3 opacity-55" />
- </button>
-
- <div x-cloak x-show="open" x-transition.origin.top.right
- class="listbox-panel top-full! right-0! left-auto! mt-1! w-60! min-w-0!" role="menu">
- @if ($proxyCanBeStopped)
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; document.getElementById('server-mobile-restart-proxy-trigger')?.click()"
- role="menuitem">
- <span class="flex size-4 shrink-0 items-center justify-center">
- <x-reicon name="restart" class="size-3.5 opacity-70" />
- </span>
- Restart Proxy
- </button>
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; document.getElementById('server-mobile-stop-proxy-trigger')?.click()"
- role="menuitem">
- <span class="flex size-4 shrink-0 items-center justify-center">
- <x-reicon name="stop-circle" class="size-3.5 text-error" />
- </span>
- Stop Proxy
- </button>
- @else
- <button type="button" class="listbox-option justify-start! gap-2.5!"
- @click="open = false; $wire.dispatch('checkProxyEvent')" role="menuitem">
- <span class="flex size-4 shrink-0 items-center justify-center">
- <x-reicon name="play-circle" class="size-3.5 opacity-70" />
- </span>
- Start Proxy
- </button>
- @endif
- <div class="my-1 border-t border-coolgray-200 dark:border-coolgray-300"
- role="separator"></div>
+ <x-split-action id="server-desktop-actions" class="resource-heading-actions shrink-0">
+ @if ($proxyCanBeStopped)
+ <x-slot:main wire:loading.attr="disabled" wire:loading.class="is-loading"
+ wire:target="checkProxy,startProxy"
+ @click="document.getElementById('server-mobile-restart-proxy-trigger')?.click()">
+ <x-reicon name="restart" class="size-3.5" />
+ Restart Proxy
+ </x-slot:main>
<button type="button" class="listbox-option justify-start! gap-2.5!"
- wire:click="checkProxyStatus" wire:loading.attr="disabled"
- @click="open = false" role="menuitem">
- <span class="flex size-4 shrink-0 items-center justify-center">
- <x-reicon name="refresh" class="size-3.5 opacity-70" />
- </span>
- Refresh Proxy Status
+ @click="open = false; document.getElementById('server-mobile-stop-proxy-trigger')?.click()"
+ role="menuitem">
+ <x-reicon name="stop-circle" class="size-3.5 text-error" />
+ Stop Proxy
</button>
+ @else
+ <x-slot:main wire:loading.attr="disabled" wire:loading.class="is-loading"
+ wire:target="checkProxy,startProxy" @click="$wire.dispatch('checkProxyEvent')">
+ <x-reicon name="play-circle" class="size-3.5" />
+ Start Proxy
+ </x-slot:main>
+ @endif
+ <button type="button" class="listbox-option justify-start! gap-2.5!" wire:click="checkProxyStatus"
+ wire:loading.attr="disabled" @click="open = false" role="menuitem">
+ <x-reicon name="refresh" class="size-3.5 opacity-70" />
+ Refresh Proxy Status
+ </button>
@if ($traefikDashboardAvailable)
<a class="listbox-option justify-start! gap-2.5!" target="_blank"
href="http://{{ $serverIp }}:8080" @click="open = false" role="menuitem">
- <span class="flex size-4 shrink-0 items-center justify-center">
- <x-reicon name="external-link" class="size-3! opacity-70" />
- </span>
+ <x-reicon name="external-link" class="size-3.5 opacity-70" />
Traefik Dashboard
</a>
@endif
- </div>
- </div>
+ </x-split-action>
@endcan
@endif
</div>