Files
coolify/resources/views/livewire/project/application/deployment/index.blade.php
Andras Bacsai ba8689fb82 v4.0.0-beta.416 (#5729)
* feat(README): add InterviewPal sponsorship link and corresponding SVG icon

* chore(versions): update coolify version to 4.0.0-beta.413 and nightly version to 4.0.0-beta.414 in configuration files

* fix(terminal): enhance WebSocket client verification with authorized IPs in terminal server

* chore(versions): update realtime version to 1.0.8 in versions.json

* chore(versions): update realtime version to 1.0.8 in versions.json

* chore(docker): update soketi image version to 1.0.8 in production configuration files

* chore(versions): update coolify version to 4.0.0-beta.414 and nightly version to 4.0.0-beta.415 in configuration files

* fix(ApplicationDeploymentJob): ensure source is an object before checking GitHub app properties

* fix(ui): Disable livewire navigate feature (causing spam of setInterval())

* fix(ui): Remove required attribute from image input in service application view

* fix(ui): Change application image validation to be nullable in service application view

* fix(Server): Correct proxy path formatting for Traefik proxy type

* chore(versions): update coolify version to 4.0.0-beta.416 and nightly version to 4.0.0-beta.417 in configuration files; fix links in deployment view

* feat(Service): Add functionality to convert between applications and databases in docker-compose based applications
fix(ui): Fix service layout refresh on compose change

* fix(service): graceful shutdown of old container (#5731)

* refactor(Database): streamline container shutdown process and reduce timeout duration

* fix(ServerCheck): enhance proxy container check to ensure it is running before proceeding

* chore(seeder): update git branch from 'main' to 'v4.x' for multiple examples in ApplicationSeeder

* fix(applications): include pull_request_id in deployment queue check to prevent duplicate deployments

* refactor(core): streamline container stopping process and reduce timeout duration; update related methods for consistency

* fix(database): update label for image input field to improve clarity

* feat(migration): add 'is_migrated' and 'custom_type' columns to service_applications and service_databases tables

* feat(backup): implement custom database type selection and enhance scheduled backups management

* fix(ServerCheck): set default proxy status to 'exited' to handle missing container state

* fix(database): reduce container stop timeout from 300 to 30 seconds for improved responsiveness

* refactor(database): update DB facade usage for consistency across service files

* Update app/Livewire/Project/Service/Database.php

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* refactor(database): enhance application conversion logic and add existence checks for databases and applications

* refactor(actions): standardize method naming for network and configuration deletion across application and service classes

* refactor(logdrain): consolidate log drain stopping logic to reduce redundancy

* refactor(StandaloneMariadb): add type hint for destination method to improve code clarity

* refactor(DeleteResourceJob): streamline resource deletion logic and improve conditional checks for database types

* refactor(jobs): update middleware to prevent job release after expiration for CleanupInstanceStuffsJob, RestartProxyJob, and ServerCheckJob

* fix(ui): system theming for charts (#5740)

* chore(deps-dev): bump vite from 6.2.6 to 6.3.4 (#5743)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.2.6 to 6.3.4.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.3.4/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.3.4
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(dev): mount points?!

* fix(dev): proxy mount point

* fix(ui): allow adding scheduled backups for non-migrated databases

* fix(DatabaseBackupJob): escape PostgreSQL password in backup command (#5759)

* fix(ui): correct closing div tag in service index view

* Revert "fix(dev): mount points?!"

This reverts commit 365bf3cbf0.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jérémy <jeremy.derdaele@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Best Codes <106822363+The-Best-Codes@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: busybox <29630035+busybox11@users.noreply.github.com>
2025-05-05 09:04:09 +02:00

179 lines
12 KiB
PHP

<div>
<x-slot:title>{{ data_get_str($application, 'name')->limit(10) }} > Deployments | Coolify</x-slot>
<h1>Deployments</h1>
<livewire:project.shared.configuration-checker :resource="$application" />
<livewire:project.application.heading :application="$application" />
<div class="flex flex-col gap-2 pb-10"
@if (!$skip) wire:poll.5000ms='reload_deployments' @endif>
<div class="flex items-end gap-2 pt-4">
<h2>Deployments <span class="text-xs">({{ $deployments_count }})</span></h2>
@if ($deployments_count > 0)
<x-forms.button disabled="{{ !$show_prev }}" wire:click="previous_page('{{ $default_take }}')">
<svg class="w-6 h-6" viewBox="0 0 24 24">
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
stroke-width="2" d="m14 6l-6 6l6 6z" />
</svg>
</x-forms.button>
<x-forms.button disabled="{{ !$show_next }}" wire:click="next_page('{{ $default_take }}')">
<svg class="w-6 h-6" viewBox="0 0 24 24">
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
stroke-width="2" d="m10 18l6-6l-6-6z" />
</svg>
</x-forms.button>
@endif
</div>
@if ($deployments_count > 0)
<form class="flex items-end gap-2">
<x-forms.input id="pull_request_id" label="Pull Request"></x-forms.input>
<x-forms.button type="submit">Filter</x-forms.button>
</form>
@endif
@forelse ($deployments as $deployment)
<div @class([
'p-2 border-l-2 bg-white dark:bg-coolgray-100',
'border-blue-500/50 border-dashed' =>
data_get($deployment, 'status') === 'in_progress',
'border-purple-500/50 border-dashed' =>
data_get($deployment, 'status') === 'queued',
'border-white border-dashed' =>
data_get($deployment, 'status') === 'cancelled-by-user',
'border-error' => data_get($deployment, 'status') === 'failed',
'border-success' => data_get($deployment, 'status') === 'finished',
])>
<a href="{{ $current_url . '/' . data_get($deployment, 'deployment_uuid') }}" class="block">
<div class="flex flex-col">
<div class="flex items-center gap-2 mb-2">
<span @class([
'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' =>
data_get($deployment, 'status') === 'in_progress',
'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' =>
data_get($deployment, 'status') === 'failed',
'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' =>
data_get($deployment, 'status') === 'cancelled-by-user',
])>
@php
$statusText = match (data_get($deployment, 'status')) {
'finished' => 'Success',
'in_progress' => 'In Progress',
'cancelled-by-user' => 'Cancelled',
'queued' => 'Queued',
default => ucfirst(data_get($deployment, 'status')),
};
@endphp
{{ $statusText }}
</span>
</div>
@if (data_get($deployment, 'status') !== 'queued')
<div class="text-gray-600 dark:text-gray-400 text-sm">
Started:
{{ formatDateInServerTimezone(data_get($deployment, 'created_at'), data_get($application, 'destination.server')) }}
@if ($deployment->status !== 'in_progress' && $deployment->status !== 'cancelled-by-user')
<br>Ended:
{{ formatDateInServerTimezone(data_get($deployment, 'finished_at'), data_get($application, 'destination.server')) }}
<br>Duration:
{{ calculateDuration(data_get($deployment, 'created_at'), data_get($deployment, 'finished_at')) }}
<br>Finished
{{ \Carbon\Carbon::parse(data_get($deployment, 'finished_at'))->diffForHumans() }}
@elseif($deployment->status === 'in_progress')
<br>Running for:
{{ calculateDuration(data_get($deployment, 'created_at'), now()) }}
@endif
</div>
@endif
<div class="text-gray-600 dark:text-gray-400 text-sm mt-2">
@if (data_get($deployment, 'commit'))
<div x-data="{ expanded: false }">
<div class="flex items-center gap-2">
<span class="font-medium">Commit:</span>
<a href="{{ $application->gitCommitLink(data_get($deployment, 'commit')) }}"
target="_blank" class="underline">
{{ substr(data_get($deployment, 'commit'), 0, 7) }}
</a>
@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">
@if (data_get($deployment, 'is_webhook'))
Webhook
@if (data_get($deployment, 'pull_request_id'))
| Pull Request #{{ data_get($deployment, 'pull_request_id') }}
@endif
@elseif (data_get($deployment, 'pull_request_id'))
Pull Request #{{ data_get($deployment, 'pull_request_id') }}
@elseif (data_get($deployment, 'rollback') === true)
Rollback
@elseif (data_get($deployment, 'is_api'))
API
@else
Manual
@endif
</span>
@endif
@if ($deployment->commitMessage())
<span class="text-gray-600 dark:text-gray-400">-</span>
<a href="{{ $application->gitCommitLink(data_get($deployment, 'commit')) }}"
target="_blank"
class="text-gray-600 dark:text-gray-400 truncate max-w-md underline">
{{ Str::before($deployment->commitMessage(), "\n") }}
</a>
@if ($deployment->commitMessage() !== Str::before($deployment->commitMessage(), "\n"))
<button @click="expanded = !expanded"
class="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">
<path fill="none" stroke="currentColor"
stroke-linecap="round" stroke-linejoin="round"
stroke-width="2" d="m6 9l6 6l6-6" />
</svg>
</button>
@endif
<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'))
Webhook
@if (data_get($deployment, 'pull_request_id'))
| Pull Request #{{ data_get($deployment, 'pull_request_id') }}
@endif
@elseif (data_get($deployment, 'pull_request_id'))
Pull Request #{{ data_get($deployment, 'pull_request_id') }}
@elseif (data_get($deployment, 'rollback') === true)
Rollback
@elseif (data_get($deployment, 'is_api'))
API
@else
Manual
@endif
</span>
@endif
</div>
@if ($deployment->commitMessage())
<div x-show="expanded" x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 transform -translate-y-2"
x-transition:enter-end="opacity-100 transform translate-y-0"
class="mt-2 ml-4 text-gray-600 dark:text-gray-400">
{{ Str::after($deployment->commitMessage(), "\n") }}
</div>
@endif
</div>
@endif
</div>
@if (data_get($deployment, 'server_name') && $application->additional_servers->count() > 0)
<div class="text-gray-600 dark:text-gray-400 text-sm mt-2">
Server: {{ data_get($deployment, 'server_name') }}
</div>
@endif
</div>
</a>
</div>
@empty
<div>No deployments found</div>
@endforelse
</div>
</div>