chore: remove unused code and fix import
This commit is contained in:
@@ -18,7 +18,7 @@ use App\Models\SwarmDocker;
|
|||||||
use App\Notifications\Application\DeploymentFailed;
|
use App\Notifications\Application\DeploymentFailed;
|
||||||
use App\Notifications\Application\DeploymentSuccess;
|
use App\Notifications\Application\DeploymentSuccess;
|
||||||
use App\Traits\ExecuteRemoteCommand;
|
use App\Traits\ExecuteRemoteCommand;
|
||||||
use Exception;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
|||||||
@@ -1,25 +1,22 @@
|
|||||||
<div>
|
<div>
|
||||||
<x-slot:title>
|
<x-slot:title>{{ data_get_str($application, 'name')->limit(10) }} > Deployments | Coolify</x-slot>
|
||||||
{{ data_get_str($application, 'name')->limit(10) }} > Deployments | Coolify
|
|
||||||
</x-slot>
|
|
||||||
<h1>Deployments</h1>
|
<h1>Deployments</h1>
|
||||||
<livewire:project.shared.configuration-checker :resource="$application" />
|
<livewire:project.shared.configuration-checker :resource="$application" />
|
||||||
<livewire:project.application.heading :application="$application" />
|
<livewire:project.application.heading :application="$application" />
|
||||||
<div class="flex flex-col gap-2 pb-10"
|
<div class="flex flex-col gap-2 pb-10" @if (!$skip) wire:poll.5000ms='reload_deployments' @endif>
|
||||||
@if ($skip == 0) wire:poll.5000ms='reload_deployments' @endif>
|
|
||||||
<div class="flex items-end gap-2 pt-4">
|
<div class="flex items-end gap-2 pt-4">
|
||||||
<h2>Deployments <span class="text-xs">({{ $deployments_count }})</span></h2>
|
<h2>Deployments <span class="text-xs">({{ $deployments_count }})</span></h2>
|
||||||
@if ($deployments_count > 0)
|
@if ($deployments_count > 0)
|
||||||
<x-forms.button disabled="{{ !$show_prev }}" wire:click="previous_page('{{ $default_take }}')"><svg
|
<x-forms.button disabled="{{ !$show_prev }}" wire:click="previous_page('{{ $default_take }}')">
|
||||||
class="w-6 h-6" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
<svg class="w-6 h-6" viewBox="0 0 24 24">
|
||||||
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m14 6l-6 6l6 6z" />
|
||||||
stroke-width="2" d="m14 6l-6 6l6 6z" />
|
</svg>
|
||||||
</svg></x-forms.button>
|
</x-forms.button>
|
||||||
<x-forms.button disabled="{{ !$show_next }}" wire:click="next_page('{{ $default_take }}')"><svg
|
<x-forms.button disabled="{{ !$show_next }}" wire:click="next_page('{{ $default_take }}')">
|
||||||
class="w-6 h-6" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
<svg class="w-6 h-6" viewBox="0 0 24 24">
|
||||||
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m10 18l6-6l-6-6z" />
|
||||||
stroke-width="2" d="m10 18l6-6l-6-6z" />
|
</svg>
|
||||||
</svg></x-forms.button>
|
</x-forms.button>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@if ($deployments_count > 0)
|
@if ($deployments_count > 0)
|
||||||
@@ -30,25 +27,23 @@
|
|||||||
@endif
|
@endif
|
||||||
@forelse ($deployments as $deployment)
|
@forelse ($deployments as $deployment)
|
||||||
<div @class([
|
<div @class([
|
||||||
'dark:bg-coolgray-100 p-2 border-l-2 transition-colors box-without-bg-without-border bg-white flex-col',
|
'p-2 border-l-2 bg-white dark:bg-coolgray-100',
|
||||||
'border-blue-500/50 border-dashed' => data_get($deployment, 'status') === 'in_progress',
|
'border-blue-500/50 border-dashed' => data_get($deployment, 'status') === 'in_progress',
|
||||||
'border-purple-500/50 border-dashed' => data_get($deployment, 'status') === 'queued',
|
'border-purple-500/50 border-dashed' => data_get($deployment, 'status') === 'queued',
|
||||||
'border-white border-dashed' => data_get($deployment, 'status') === 'cancelled-by-user',
|
'border-white border-dashed' => data_get($deployment, 'status') === 'cancelled-by-user',
|
||||||
'border-error' => data_get($deployment, 'status') === 'failed',
|
'border-error' => data_get($deployment, 'status') === 'failed',
|
||||||
'border-success' => data_get($deployment, 'status') === 'finished',
|
'border-success' => data_get($deployment, 'status') === 'finished',
|
||||||
])>
|
])>
|
||||||
<a href="{{ $current_url . '/' . data_get($deployment, 'deployment_uuid') }}"
|
<a href="{{ $current_url . '/' . data_get($deployment, 'deployment_uuid') }}" wire:navigate class="block">
|
||||||
wire:navigate
|
<div class="flex flex-col">
|
||||||
class="block">
|
|
||||||
<div class="flex flex-col justify-start">
|
|
||||||
<div class="flex items-center gap-2 mb-2">
|
<div class="flex items-center gap-2 mb-2">
|
||||||
<span @class([
|
<span @class([
|
||||||
'px-3 py-1 rounded-md text-xs font-medium tracking-wide shadow-sm',
|
'px-3 py-1 rounded-md text-xs font-medium shadow-sm',
|
||||||
'bg-blue-100/80 text-blue-700 dark:bg-blue-500/20 dark:text-blue-300 dark:shadow-blue-900/5' => data_get($deployment, 'status') === 'in_progress',
|
'bg-blue-100/80 text-blue-700 dark:bg-blue-500/20 dark:text-blue-300' => data_get($deployment, 'status') === 'in_progress',
|
||||||
'bg-purple-100/80 text-purple-700 dark:bg-purple-500/20 dark:text-purple-300 dark:shadow-purple-900/5' => data_get($deployment, 'status') === 'queued',
|
'bg-purple-100/80 text-purple-700 dark:bg-purple-500/20 dark:text-purple-300' => data_get($deployment, 'status') === 'queued',
|
||||||
'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-200 dark:shadow-red-900/5' => data_get($deployment, 'status') === 'failed',
|
'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-200' => data_get($deployment, 'status') === 'failed',
|
||||||
'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 dark:shadow-green-900/5' => data_get($deployment, 'status') === 'finished',
|
'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200' => data_get($deployment, 'status') === 'finished',
|
||||||
'bg-gray-100 text-gray-700 dark:bg-gray-600/30 dark:text-gray-300 dark:shadow-gray-900/5' => data_get($deployment, 'status') === 'cancelled-by-user',
|
'bg-gray-100 text-gray-700 dark:bg-gray-600/30 dark:text-gray-300' => data_get($deployment, 'status') === 'cancelled-by-user',
|
||||||
])>
|
])>
|
||||||
@php
|
@php
|
||||||
$statusText = match(data_get($deployment, 'status')) {
|
$statusText = match(data_get($deployment, 'status')) {
|
||||||
@@ -75,20 +70,18 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="text-gray-600 dark:text-gray-400 text-sm mt-2">
|
<div class="text-gray-600 dark:text-gray-400 text-sm mt-2">
|
||||||
<div class="flex flex-col gap-1">
|
|
||||||
@if (data_get($deployment, 'commit'))
|
@if (data_get($deployment, 'commit'))
|
||||||
<div class="flex flex-col" x-data="{ expanded: false }">
|
<div x-data="{ expanded: false }">
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<span class="font-medium">Commit:</span>
|
<span class="font-medium">Commit:</span>
|
||||||
<a wire:navigate.prevent
|
<a wire:navigate.prevent
|
||||||
href="{{ $application->gitCommitLink(data_get($deployment, 'commit')) }}"
|
href="{{ $application->gitCommitLink(data_get($deployment, 'commit')) }}"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="underline"
|
class="underline">
|
||||||
>
|
|
||||||
{{ substr(data_get($deployment, 'commit'), 0, 7) }}
|
{{ substr(data_get($deployment, 'commit'), 0, 7) }}
|
||||||
</a>
|
</a>
|
||||||
@if (!$deployment->commitMessage())
|
@if (!$deployment->commitMessage())
|
||||||
<span class="bg-gray-200/70 dark:bg-gray-600/20 px-2 py-0.5 rounded-md text-xs text-gray-800 dark:text-gray-100 border border-gray-400/30 dark:border-gray-500/30 font-medium backdrop-blur-sm">
|
<span class="bg-gray-200/70 dark:bg-gray-600/20 px-2 py-0.5 rounded-md text-xs text-gray-800 dark:text-gray-100 border border-gray-400/30">
|
||||||
@if (data_get($deployment, 'is_webhook'))
|
@if (data_get($deployment, 'is_webhook'))
|
||||||
Webhook
|
Webhook
|
||||||
@if (data_get($deployment, 'pull_request_id'))
|
@if (data_get($deployment, 'pull_request_id'))
|
||||||
@@ -106,22 +99,20 @@
|
|||||||
</span>
|
</span>
|
||||||
@endif
|
@endif
|
||||||
@if ($deployment->commitMessage())
|
@if ($deployment->commitMessage())
|
||||||
<span class="text-sm text-gray-600 dark:text-gray-400">-</span>
|
<span class="text-gray-600 dark:text-gray-400">-</span>
|
||||||
<a wire:navigate.prevent
|
<a wire:navigate.prevent
|
||||||
href="{{ $application->gitCommitLink(data_get($deployment, 'commit')) }}"
|
href="{{ $application->gitCommitLink(data_get($deployment, 'commit')) }}"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="text-sm text-gray-600 dark:text-gray-400 truncate max-w-md underline"
|
class="text-gray-600 dark:text-gray-400 truncate max-w-md underline">
|
||||||
>
|
|
||||||
{{ Str::before($deployment->commitMessage(), "\n") }}
|
{{ Str::before($deployment->commitMessage(), "\n") }}
|
||||||
</a>
|
</a>
|
||||||
<button
|
<button @click="expanded = !expanded"
|
||||||
@click="expanded = !expanded"
|
class="text-gray-600 dark:text-gray-400 flex items-center gap-1">
|
||||||
class="text-sm text-gray-600 dark:text-gray-400 flex items-center gap-1 ">
|
|
||||||
<svg x-bind:class="{'rotate-180': expanded}" class="w-4 h-4 transition-transform" viewBox="0 0 24 24">
|
<svg x-bind:class="{'rotate-180': expanded}" class="w-4 h-4 transition-transform" viewBox="0 0 24 24">
|
||||||
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m6 9l6 6l6-6"/>
|
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m6 9l6 6l6-6"/>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<span class="bg-gray-200/70 dark:bg-gray-600/20 px-2 py-0.5 rounded-md text-xs text-gray-800 dark:text-gray-100 border border-gray-400/30 dark:border-gray-500/30 font-medium backdrop-blur-sm">
|
<span class="bg-gray-200/70 dark:bg-gray-600/20 px-2 py-0.5 rounded-md text-xs text-gray-800 dark:text-gray-100 border border-gray-400/30">
|
||||||
@if (data_get($deployment, 'is_webhook'))
|
@if (data_get($deployment, 'is_webhook'))
|
||||||
Webhook
|
Webhook
|
||||||
@if (data_get($deployment, 'pull_request_id'))
|
@if (data_get($deployment, 'pull_request_id'))
|
||||||
@@ -144,14 +135,13 @@
|
|||||||
x-transition:enter="transition ease-out duration-200"
|
x-transition:enter="transition ease-out duration-200"
|
||||||
x-transition:enter-start="opacity-0 transform -translate-y-2"
|
x-transition:enter-start="opacity-0 transform -translate-y-2"
|
||||||
x-transition:enter-end="opacity-100 transform translate-y-0"
|
x-transition:enter-end="opacity-100 transform translate-y-0"
|
||||||
class="mt-2 ml-4 text-sm text-gray-600 dark:text-gray-400">
|
class="mt-2 ml-4 text-gray-600 dark:text-gray-400">
|
||||||
{{ Str::after($deployment->commitMessage(), "\n") }}
|
{{ Str::after($deployment->commitMessage(), "\n") }}
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
@if (data_get($deployment, 'server_name') && $application->additional_servers->count() > 0)
|
@if (data_get($deployment, 'server_name') && $application->additional_servers->count() > 0)
|
||||||
<div class="text-gray-600 dark:text-gray-400 text-sm mt-2">
|
<div class="text-gray-600 dark:text-gray-400 text-sm mt-2">
|
||||||
@@ -162,7 +152,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@empty
|
@empty
|
||||||
<div class="">No deployments found</div>
|
<div>No deployments found</div>
|
||||||
@endforelse
|
@endforelse
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user