fix: deploy instead of restart in case swarm is used

This commit is contained in:
Andras Bacsai
2023-12-27 17:12:09 +01:00
parent f03aa57758
commit 52d05005ed

View File

@@ -1,19 +1,19 @@
<div class="navbar-main"> <div class="navbar-main">
<a class="{{ request()->routeIs('project.application.configuration') ? 'text-white' : '' }}" <a class="{{ request()->routeIs('project.application.configuration') ? 'text-white' : '' }}"
href="{{ route('project.application.configuration', $parameters) }}"> href="{{ route('project.application.configuration', $parameters) }}">
<button>Configuration</button> <button>Configuration</button>
</a> </a>
@if(!$application->destination->server->isSwarm()) @if (!$application->destination->server->isSwarm())
<a class="{{ request()->routeIs('project.application.command') ? 'text-white' : '' }}" <a class="{{ request()->routeIs('project.application.command') ? 'text-white' : '' }}"
href="{{ route('project.application.command', $parameters) }}"> href="{{ route('project.application.command', $parameters) }}">
<button>Execute Command</button> <button>Execute Command</button>
</a> </a>
@endif @endif
<a class="{{ request()->routeIs('project.application.logs') ? 'text-white' : '' }}" <a class="{{ request()->routeIs('project.application.logs') ? 'text-white' : '' }}"
href="{{ route('project.application.logs', $parameters) }}"> href="{{ route('project.application.logs', $parameters) }}">
<button>Logs</button> <button>Logs</button>
</a> </a>
<a class="{{ request()->routeIs('project.application.deployments') ? 'text-white' : '' }}" <a class="{{ request()->routeIs('project.application.deployments') ? 'text-white' : '' }}"
href="{{ route('project.application.deployments', $parameters) }}"> href="{{ route('project.application.deployments', $parameters) }}">
<button>Deployments</button> <button>Deployments</button>
</a> </a>
@@ -42,21 +42,32 @@
</button> </button>
@endif @endif
@if ($application->build_pack !== 'dockercompose') @if ($application->build_pack !== 'dockercompose')
<button title="Restart without rebuilding" wire:click='restart' @if ($application->destination->server->isSwarm())
class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400"> <button title="Restart without rebuilding" wire:click='deploy'
<svg class="w-5 h-5 text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" <svg class="w-5 h-5 text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
stroke-width="2"> <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
<path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" /> stroke-width="2">
<path d="M20 4v5h-5" /> <path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
</g> <path d="M20 4v5h-5" />
</svg> </g>
@if ($application->destination->server->isSwarm()) </svg>
Update Service Update Service
@else </button>
Restart @else
@endif <button title="Restart without rebuilding" wire:click='restart'
</button> class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">
<svg class="w-5 h-5 text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
stroke-width="2">
<path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
<path d="M20 4v5h-5" />
</g>
</svg>
Restart
</button>
@endif
{{-- @if (isDev()) {{-- @if (isDev())
<button title="Restart without rebuilding" wire:click='restartNew' <button title="Restart without rebuilding" wire:click='restartNew'
class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400"> class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">