coolify/resources/views/livewire/project/application/previews.blade.php

110 lines
5.5 KiB
PHP
Raw Normal View History

2023-05-16 13:11:05 +02:00
<div>
2023-05-30 15:52:17 +02:00
<livewire:project.application.preview.form :application="$application" />
@if (count($application->additional_servers) > 0)
<div class="pb-4">Previews will be deployed on <span
2024-03-25 10:41:44 +01:00
class="dark:text-warning">{{ $application->destination->server->name }}</span>.</div>
@endif
2023-05-30 15:52:17 +02:00
<div>
2024-01-29 10:43:18 +01:00
@if ($application->is_github_based())
<div class="flex items-center gap-2">
<h3>Pull Requests on Git</h3>
<x-forms.button wire:click="load_prs">Load Pull Requests
</x-forms.button>
</div>
@endif
2023-05-30 15:52:17 +02:00
@isset($rate_limit_remaining)
2024-01-07 23:32:54 +01:00
<div class="pt-1 ">Requests remaining till rate limited by Git: {{ $rate_limit_remaining }}</div>
2023-05-30 15:52:17 +02:00
@endisset
<div wire:loading.remove wire:target='load_prs'>
@if ($pull_requests->count() > 0)
2023-06-05 12:07:55 +02:00
<div class="overflow-x-auto table-md">
2023-06-12 21:12:07 +02:00
<table>
2023-06-05 12:07:55 +02:00
<thead>
2023-06-12 21:12:07 +02:00
<tr>
2023-06-05 12:07:55 +02:00
<th>PR Number</th>
<th>PR Title</th>
<th>Git</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@foreach ($pull_requests as $pull_request)
2023-06-12 21:12:07 +02:00
<tr>
2023-06-05 12:07:55 +02:00
<th>{{ data_get($pull_request, 'number') }}</th>
<td>{{ data_get($pull_request, 'title') }}</td>
<td>
<a target="_blank" class="text-xs"
href="{{ data_get($pull_request, 'html_url') }}">Open PR on
Git
<x-external-link />
</a>
</td>
2023-06-12 21:12:07 +02:00
<td>
2023-06-05 12:07:55 +02:00
<x-forms.button
wire:click="deploy('{{ data_get($pull_request, 'number') }}', '{{ data_get($pull_request, 'html_url') }}')">
Deploy
</x-forms.button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
2023-05-16 14:11:55 +02:00
</div>
2023-05-30 15:52:17 +02:00
@if ($application->previews->count() > 0)
<div class="pb-4">Previews</div>
2024-02-10 07:40:35 +01:00
<div class="flex flex-wrap gap-6">
2023-05-30 15:52:17 +02:00
@foreach ($application->previews as $preview)
2023-09-14 15:52:04 +02:00
<div class="flex flex-col p-4 bg-coolgray-200">
2023-06-05 12:07:55 +02:00
<div class="flex gap-2">PR #{{ data_get($preview, 'pull_request_id') }} |
2023-09-22 15:29:19 +02:00
@if (Str::of(data_get($preview, 'status'))->startsWith('running'))
<x-status.running :status="data_get($preview, 'status')" />
2023-09-22 15:29:19 +02:00
@elseif(Str::of(data_get($preview, 'status'))->startsWith('restarting'))
<x-status.restarting :status="data_get($preview, 'status')" />
2023-06-05 12:07:55 +02:00
@else
<x-status.stopped :status="data_get($preview, 'status')" />
2023-06-05 12:07:55 +02:00
@endif
2023-05-30 15:52:17 +02:00
@if (data_get($preview, 'status') !== 'exited')
| <a target="_blank" href="{{ data_get($preview, 'fqdn') }}">Open Preview
<x-external-link />
</a>
@endif
2023-05-31 10:19:29 +02:00
|
2023-12-07 19:06:32 +01:00
<a target="_blank" href="{{ data_get($preview, 'pull_request_html_url') }}">Open
PR on Git
2023-05-31 10:19:29 +02:00
<x-external-link />
</a>
2023-05-30 15:52:17 +02:00
</div>
2023-05-31 10:19:29 +02:00
<div class="flex items-center gap-2 pt-6">
2023-11-27 15:25:15 +01:00
<x-forms.button class="bg-coolgray-500"
wire:click="deploy({{ data_get($preview, 'pull_request_id') }})">
2023-05-30 15:52:17 +02:00
@if (data_get($preview, 'status') === 'exited')
Deploy
@else
Redeploy
@endif
</x-forms.button>
<a
2024-01-07 16:23:41 +01:00
href="{{ route('project.application.deployment.index', [...$parameters, 'pull_request_id' => data_get($preview, 'pull_request_id')]) }}">
<x-forms.button class="bg-coolgray-500">
2024-02-27 09:01:19 +01:00
Deployment Logs
</x-forms.button>
</a>
2024-02-27 09:01:19 +01:00
<a
href="{{ route('project.application.logs', [...$parameters, 'pull_request_id' => data_get($preview, 'pull_request_id')]) }}">
<x-forms.button class="bg-coolgray-500">
Application Logs
</x-forms.button>
</a>
<x-forms.button isError class="bg-coolgray-500"
wire:click="stop({{ data_get($preview, 'pull_request_id') }})">Delete
</x-forms.button>
2023-05-30 15:52:17 +02:00
</div>
</div>
@endforeach
</div>
@endif
2023-05-16 13:11:05 +02:00
</div>