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

68 lines
3.4 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" />
<h3>Pull Requests on Git</h3>
<div>
2023-06-02 12:34:45 +02:00
<x-forms.button wire:click="load_prs">Load Pull Requests (open)
2023-05-30 15:52:17 +02:00
</x-forms.button>
@isset($rate_limit_remaining)
2023-05-31 10:19:29 +02:00
<div class="pt-1 text-sm">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)
<div wire:loading.remove wire:target='load_prs' class="flex gap-4 py-8">
2023-05-30 15:52:17 +02:00
@foreach ($pull_requests as $pull_request)
2023-05-31 10:19:29 +02:00
<div class="flex flex-col gap-4 p-4 text-sm bg-coolgray-200 hover:bg-coolgray-300">
<div class="text-base font-bold text-white">PR #{{ data_get($pull_request, 'number') }} |
{{ data_get($pull_request, 'title') }}</div>
<div class="flex items-center justify-start gap-2">
<x-forms.button isHighlighted
wire:click="deploy('{{ data_get($pull_request, 'number') }}', '{{ data_get($pull_request, 'html_url') }}')">
Deploy
</x-forms.button>
<a target="_blank" class="text-xs" href="{{ data_get($pull_request, 'html_url') }}">Open PR
on
Git
<x-external-link />
</a>
</div>
2023-05-30 15:52:17 +02:00
</div>
@endforeach
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)
<h3>Preview Deployments</h3>
<div class="flex gap-6 text-sm">
@foreach ($application->previews as $preview)
2023-05-31 10:19:29 +02:00
<div class="flex flex-col p-4 bg-coolgray-200 " x-init="$wire.loadStatus('{{ data_get($preview, 'pull_request_id') }}')">
2023-05-30 15:52:17 +02:00
<div>PR #{{ data_get($preview, 'pull_request_id') }} | {{ data_get($preview, 'status') }}
@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
|
<a target="_blank" href="{{ data_get($preview, 'pull_request_html_url') }}">Open PR on Git
<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-05-30 15:52:17 +02:00
<x-forms.button isHighlighted wire:click="deploy({{ data_get($preview, 'pull_request_id') }})">
@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
2023-05-31 10:19:29 +02:00
2023-05-30 15:52:17 +02:00
</div>
</div>
@endforeach
</div>
@endif
2023-05-16 13:11:05 +02:00
</div>