2023-05-16 11:11:05 +00:00
< div >
2023-05-30 13:52:17 +00:00
< livewire : project . application . preview . form : application = " $application " />
2024-02-11 16:29:14 +00:00
@ if ( count ( $application -> additional_servers ) > 0 )
< div class = " pb-4 " > Previews will be deployed on < span
2024-03-25 09:41:44 +00:00
class = " dark:text-warning " > {{ $application -> destination -> server -> name }} </ span >.</ div >
2024-02-11 16:29:14 +00:00
@ endif
2023-05-30 13:52:17 +00:00
< div >
2024-01-29 09:43:18 +00: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 13:52:17 +00:00
@ isset ( $rate_limit_remaining )
2024-01-07 22:32:54 +00:00
< div class = " pt-1 " > Requests remaining till rate limited by Git : {{ $rate_limit_remaining }} </ div >
2023-05-30 13:52:17 +00:00
@ endisset
2024-03-19 10:05:02 +00:00
< div wire : loading . remove wire : target = 'load_prs' >
@ if ( $pull_requests -> count () > 0 )
2023-06-05 10:07:55 +00:00
< div class = " overflow-x-auto table-md " >
2023-06-12 19:12:07 +00:00
< table >
2023-06-05 10:07:55 +00:00
< thead >
2023-06-12 19:12:07 +00:00
< tr >
2023-06-05 10:07:55 +00: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 19:12:07 +00:00
< tr >
2023-06-05 10:07:55 +00: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 >
2024-05-30 10:28:29 +00:00
< td class = " flex flex-col gap-1 md:flex-row " >
< x - forms . button
wire : click = " add(' { { data_get( $pull_request , 'number') }}', ' { { data_get( $pull_request , 'html_url') }}') " >
2024-06-05 13:14:44 +00:00
Configure
2024-05-30 10:28:29 +00:00
</ x - forms . button >
2023-06-05 10:07:55 +00:00
< x - forms . button
2024-06-12 10:20:58 +00:00
wire : click = " add_and_deploy(' { { data_get( $pull_request , 'number') }}', ' { { data_get( $pull_request , 'html_url') }}') " >
2024-06-05 13:14:44 +00:00
< svg xmlns = " http://www.w3.org/2000/svg " class = " w-5 h-5 dark:text-warning "
viewBox = " 0 0 24 24 " stroke - width = " 1.5 " stroke = " currentColor "
fill = " none " stroke - linecap = " round " stroke - linejoin = " round " >
< path stroke = " none " d = " M0 0h24v24H0z " fill = " none " />
< path d = " M7 4v16l13 -8z " />
</ svg > Deploy
2023-06-05 10:07:55 +00:00
</ x - forms . button >
</ td >
</ tr >
@ endforeach
</ tbody >
</ table >
</ div >
2024-03-19 10:05:02 +00:00
@ endif
</ div >
2023-05-16 12:11:55 +00:00
</ div >
2023-05-30 13:52:17 +00:00
@ if ( $application -> previews -> count () > 0 )
2024-06-05 13:32:56 +00:00
< h3 class = " py-4 " > Deployments </ h3 >
2024-05-30 10:28:29 +00:00
< div class = " flex flex-wrap w-full gap-4 " >
@ foreach ( data_get ( $application , 'previews' ) as $previewName => $preview )
< div class = " flex flex-col w-full p-4 border dark:border-coolgray-200 " >
2023-06-05 10:07:55 +00:00
< div class = " flex gap-2 " > PR #{{ data_get($preview, 'pull_request_id') }} |
2024-06-25 08:37:10 +00:00
@ if ( str ( data_get ( $preview , 'status' )) -> startsWith ( 'running' ))
2023-10-01 10:02:44 +00:00
< x - status . running : status = " data_get( $preview , 'status') " />
2024-06-25 08:37:10 +00:00
@ elseif ( str ( data_get ( $preview , 'status' )) -> startsWith ( 'restarting' ))
2023-10-01 10:02:44 +00:00
< x - status . restarting : status = " data_get( $preview , 'status') " />
2023-06-05 10:07:55 +00:00
@ else
2023-10-01 10:02:44 +00:00
< x - status . stopped : status = " data_get( $preview , 'status') " />
2023-06-05 10:07:55 +00:00
@ endif
2023-05-30 13:52:17 +00: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 08:19:29 +00:00
|
2023-12-07 18:06:32 +00:00
< a target = " _blank " href = " { { data_get( $preview , 'pull_request_html_url') }} " > Open
PR on Git
2023-05-31 08:19:29 +00:00
< x - external - link />
</ a >
2023-05-30 13:52:17 +00:00
</ div >
2024-06-05 13:14:44 +00:00
@ if ( $application -> build_pack === 'dockercompose' )
< div class = " flex flex-col gap-4 pt-4 " >
2024-06-05 13:29:00 +00:00
@ if ( collect ( json_decode ( $preview -> docker_compose_domains )) -> count () === 0 )
< form wire : submit = " save_preview(' { { $preview->id }}') "
class = " flex items-end gap-2 pt-4 " >
< x - forms . input label = " Domain " helper = " One domain per preview. "
id = " application.previews. { { $previewName }}.fqdn " ></ x - forms . input >
< x - forms . button type = " submit " > Save </ x - forms . button >
< x - forms . button wire : click = " generate_preview(' { { $preview->id }}') " > Generate
Domain </ x - forms . button >
</ form >
@ else
@ foreach ( collect ( json_decode ( $preview -> docker_compose_domains )) as $serviceName => $service )
< livewire : project . application . previews - compose wire : key = " { { $preview->id }} "
: service = " $service " : serviceName = " $serviceName " : preview = " $preview " />
@ endforeach
@ endif
2024-06-05 13:14:44 +00:00
</ div >
@ else
< form wire : submit = " save_preview(' { { $preview->id }}') " class = " flex items-end gap-2 pt-4 " >
< x - forms . input label = " Domain " helper = " One domain per preview. "
id = " application.previews. { { $previewName }}.fqdn " ></ x - forms . input >
< x - forms . button type = " submit " > Save </ x - forms . button >
< x - forms . button wire : click = " generate_preview(' { { $preview->id }}') " > Generate
Domain </ x - forms . button >
</ form >
@ endif
2023-05-31 08:19:29 +00:00
< div class = " flex items-center gap-2 pt-6 " >
2024-04-17 13:16:08 +00:00
@ if ( count ( $parameters ) > 0 )
< a
href = " { { route('project.application.deployment.index', [... $parameters , 'pull_request_id' => data_get( $preview , 'pull_request_id')]) }} " >
2024-05-30 10:28:29 +00:00
< x - forms . button >
2024-04-17 13:16:08 +00:00
Deployment Logs
</ x - forms . button >
</ a >
< a
href = " { { route('project.application.logs', [... $parameters , 'pull_request_id' => data_get( $preview , 'pull_request_id')]) }} " >
2024-05-30 10:28:29 +00:00
< x - forms . button >
2024-04-17 13:16:08 +00:00
Application Logs
</ x - forms . button >
</ a >
@ endif
2024-05-30 10:28:29 +00:00
< div class = " flex-1 " ></ div >
2024-06-05 13:14:44 +00:00
< x - forms . button wire : click = " deploy( { { data_get( $preview , 'pull_request_id') }}) " >
@ if ( data_get ( $preview , 'status' ) === 'exited' )
< svg xmlns = " http://www.w3.org/2000/svg " class = " w-5 h-5 dark:text-warning "
viewBox = " 0 0 24 24 " stroke - width = " 1.5 " stroke = " currentColor " fill = " none "
stroke - linecap = " round " stroke - linejoin = " round " >
< path stroke = " none " d = " M0 0h24v24H0z " fill = " none " />
< path d = " M7 4v16l13 -8z " />
</ svg >
Deploy
@ else
< svg xmlns = " http://www.w3.org/2000/svg " class = " w-5 h-5 dark:text-orange-400 "
viewBox = " 0 0 24 24 " stroke - width = " 2 " stroke = " currentColor " fill = " none "
stroke - linecap = " round " stroke - linejoin = " round " >
< path stroke = " none " d = " M0 0h24v24H0z " fill = " none " ></ path >
< path
d = " M10.09 4.01l.496 -.495a2 2 0 0 1 2.828 0l7.071 7.07a2 2 0 0 1 0 2.83l-7.07 7.07a2 2 0 0 1 -2.83 0l-7.07 -7.07a2 2 0 0 1 0 -2.83l3.535 -3.535h-3.988 " >
</ path >
< path d = " M7.05 11.038v-3.988 " ></ path >
</ svg > Redeploy
@ endif
</ x - forms . button >
2024-05-30 10:28:29 +00:00
@ if ( data_get ( $preview , 'status' ) !== 'exited' )
2024-09-03 14:43:50 +00:00
< x - modal - confirmation
title = " Confirm Preview Deployment Stopping? "
buttonTitle = " Stop "
submitAction = " stop( { { data_get( $preview , 'pull_request_id') }}) "
: actions = " ['This preview deployment will be stopped.', 'If the preview deployment is currently in use data could be lost.', 'All non-persistent data of this preview deployment (containers, networks, unused images) will be deleted (don \ 't worry, no data is lost and you can start the preview deployment again).'] "
: confirmWithText = " false "
: confirmWithPassword = " false "
step2ButtonText = " Stop Preview Deployment "
>
2024-05-30 10:28:29 +00:00
< x - slot : customButton >
< svg xmlns = " http://www.w3.org/2000/svg " class = " w-5 h-5 text-error "
viewBox = " 0 0 24 24 " stroke - width = " 2 " stroke = " currentColor " fill = " none "
stroke - linecap = " round " stroke - linejoin = " round " >
< path stroke = " none " d = " M0 0h24v24H0z " fill = " none " ></ path >
< path
d = " M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z " >
</ path >
< path
d = " M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z " >
</ path >
</ svg >
Stop
</ x - slot : customButton >
</ x - modal - confirmation >
@ endif
2024-09-03 14:43:50 +00:00
< x - modal - confirmation
title = " Confirm Preview Deployment Deletion? "
buttonTitle = " Delete "
isErrorButton
submitAction = " delete( { { data_get( $preview , 'pull_request_id') }}) "
: actions = " ['All containers of this preview deployment will be stopped and permanently deleted.'] "
confirmationText = " { { data_get( $preview , 'fqdn'). '/' }} "
confirmationLabel = " Please confirm the execution of the actions by entering the Preview Deployment name below "
shortConfirmationLabel = " Preview Deployment Name "
: confirmWithPassword = " false "
/>
2023-05-30 13:52:17 +00:00
</ div >
</ div >
@ endforeach
</ div >
@ endif
2023-05-16 11:11:05 +00:00
</ div >