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

92 lines
4.4 KiB
PHP
Raw Normal View History

2023-05-16 13:11:05 +02:00
<div>
2023-08-11 20:19:42 +02:00
<livewire:project.application.preview.form :application="$application" />
2023-05-30 15:52:17 +02:00
<div>
2023-06-05 12:07:55 +02:00
<div class="flex items-center gap-2">
<h3>Pull Requests on Git</h3>
2023-07-13 13:16:24 +02:00
<x-forms.button wire:click="load_prs">Load Pull Requests
2023-06-05 12:07:55 +02:00
</x-forms.button>
</div>
2023-05-30 15:52:17 +02:00
@isset($rate_limit_remaining)
2023-06-16 12:35:40 +02:00
<div class="pt-1 ">Requests remaning till rate limited by Git: {{ $rate_limit_remaining }}</div>
2023-05-30 15:52:17 +02:00
@endisset
2023-05-31 10:19:29 +02:00
@if (count($pull_requests) > 0)
2023-06-12 21:12:07 +02:00
<div wire:loading.remove wire:target='load_prs'>
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>
<tr>
2023-08-11 20:19:42 +02:00
<th>PR Number</th>
<th>PR Title</th>
<th>Git</th>
<th>Actions</th>
</tr>
2023-08-11 20:19:42 +02:00
</thead>
<tbody>
@foreach ($pull_requests as $pull_request)
<tr>
<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>
<td>
<x-forms.button
wire:click="deploy('{{ data_get($pull_request, 'number') }}', '{{ data_get($pull_request, 'html_url') }}')">
Deploy
</x-forms.button>
</td>
</tr>
@endforeach
2023-06-05 12:07:55 +02:00
</tbody>
</table>
</div>
2023-05-31 10:19:29 +02:00
</div>
@endif
2023-05-16 14:11:55 +02:00
</div>
2023-05-30 15:52:17 +02:00
@if ($application->previews->count() > 0)
2023-06-16 21:16:30 +02:00
<h4 class="py-4" wire:poll.10000ms='previewRefresh'>Deployed Previews</h4>
2023-06-16 12:35:40 +02:00
<div class="flex gap-6 ">
2023-05-30 15:52:17 +02:00
@foreach ($application->previews as $preview)
2023-08-11 20:19:42 +02:00
<div class="flex flex-col p-4 bg-coolgray-200 " x-init="$wire.loadStatus('{{ data_get($preview, 'pull_request_id') }}')">
2023-06-05 12:07:55 +02:00
<div class="flex gap-2">PR #{{ data_get($preview, 'pull_request_id') }} |
@if (data_get($preview, 'status') === 'running')
2023-08-11 20:19:42 +02:00
<x-status.running />
2023-06-08 10:55:50 +02:00
@elseif (data_get($preview, 'status') === 'restarting')
2023-08-11 20:19:42 +02:00
<x-status.restarting />
2023-06-05 12:07:55 +02:00
@else
2023-08-11 20:19:42 +02:00
<x-status.stopped />
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
2023-08-11 20:19:42 +02:00
<x-external-link />
2023-05-30 15:52:17 +02:00
</a>
@endif
2023-05-31 10:19:29 +02:00
|
<a target="_blank" href="{{ data_get($preview, 'pull_request_html_url') }}">Open PR on Git
2023-08-11 20:19:42 +02:00
<x-external-link />
2023-05-31 10:19:29 +02:00
</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-06-05 12:07:55 +02:00
<x-forms.button 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>
@if (data_get($preview, 'status') !== 'exited')
2023-05-31 10:19:29 +02:00
<x-forms.button wire:click="stop({{ data_get($preview, 'pull_request_id') }})">Remove
Preview
2023-05-30 15:52:17 +02:00
</x-forms.button>
@endif
</div>
</div>
@endforeach
</div>
@endif
2023-05-16 13:11:05 +02:00
</div>