updates
This commit is contained in:
parent
5b3a3edcd0
commit
25870dadd8
@ -49,9 +49,10 @@ class Deploy extends Component
|
||||
deployment_uuid: $this->deployment_uuid,
|
||||
force_rebuild: $force,
|
||||
);
|
||||
return redirect()->route('project.application.deployments', [
|
||||
return redirect()->route('project.application.deployment', [
|
||||
'project_uuid' => $this->parameters['project_uuid'],
|
||||
'application_uuid' => $this->parameters['application_uuid'],
|
||||
'deployment_uuid' => $this->deployment_uuid,
|
||||
'environment_name' => $this->parameters['environment_name'],
|
||||
]);
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ class DeploymentLogs extends Component
|
||||
public $deployment_uuid;
|
||||
public function polling()
|
||||
{
|
||||
$this->emit('deploymentFinished');
|
||||
if (is_null($this->activity) && isset($this->deployment_uuid)) {
|
||||
$this->activity = Activity::query()
|
||||
->where('properties->type', '=', ActivityTypes::DEPLOYMENT->value)
|
||||
|
@ -12,6 +12,11 @@ class DeploymentNavbar extends Component
|
||||
public Application $application;
|
||||
public $activity;
|
||||
public string $deployment_uuid;
|
||||
protected $listeners = ['deploymentFinished'];
|
||||
public function deploymentFinished()
|
||||
{
|
||||
$this->activity->refresh();
|
||||
}
|
||||
public function cancel()
|
||||
{
|
||||
try {
|
||||
|
@ -59,9 +59,10 @@ class Previews extends Component
|
||||
force_rebuild: true,
|
||||
pull_request_id: $pull_request_id,
|
||||
);
|
||||
return redirect()->route('project.application.deployments', [
|
||||
return redirect()->route('project.application.deployment', [
|
||||
'project_uuid' => $this->parameters['project_uuid'],
|
||||
'application_uuid' => $this->parameters['application_uuid'],
|
||||
'deployment_uuid' => $this->deployment_uuid,
|
||||
'environment_name' => $this->parameters['environment_name'],
|
||||
]);
|
||||
} catch (\Throwable $th) {
|
||||
|
@ -29,9 +29,10 @@ class Rollback extends Component
|
||||
force_rebuild: false,
|
||||
);
|
||||
|
||||
return redirect()->route('project.application.deployments', [
|
||||
return redirect()->route('project.application.deployment', [
|
||||
'project_uuid' => $this->parameters['project_uuid'],
|
||||
'application_uuid' => $this->parameters['application_uuid'],
|
||||
'deployment_uuid' => $deployment_uuid,
|
||||
'environment_name' => $this->parameters['environment_name'],
|
||||
]);
|
||||
}
|
||||
|
@ -1,7 +1,15 @@
|
||||
<div>
|
||||
<div class="pt-2 text-sm">Build status: {{ data_get($activity, 'properties.status') }}</div>
|
||||
<livewire:project.application.deployment-navbar :activity="$activity" :application="$application" :deployment_uuid="$deployment_uuid" />
|
||||
<h3 class="pb-0">Logs</h3>
|
||||
@if (data_get($activity, 'properties.status') === 'in_progress')
|
||||
<livewire:project.application.deployment-navbar :activity="$activity" :application="$application" :deployment_uuid="$deployment_uuid" />
|
||||
<div class="pt-2 text-sm">Deployment is
|
||||
<span class="text-warning">{{ Str::headline(data_get($activity, 'properties.status')) }}</span>. Logs will
|
||||
be updated
|
||||
automatically.
|
||||
</div>
|
||||
@else
|
||||
<div class="pt-2 text-sm">Deployment is <span
|
||||
class="text-warning">{{ Str::headline(data_get($activity, 'properties.status')) }}</span>.</div>
|
||||
@endif
|
||||
<div
|
||||
class="scrollbar flex flex-col-reverse w-full overflow-y-auto border border-solid rounded border-coolgray-300 max-h-[32rem] p-4 mt-4 text-xs text-white">
|
||||
|
@ -1,3 +1,8 @@
|
||||
<div>
|
||||
<x-forms.button wire:click.prevent="cancel">Cancel deployment</x-forms.button>
|
||||
<h3>Actions</h3>
|
||||
@if (data_get($activity, 'properties.status') === 'in_progress')
|
||||
<x-forms.button wire:click.prevent="cancel">Cancel deployment</x-forms.button>
|
||||
@else
|
||||
<x-forms.button disabled>Cancel deployment</x-forms.button>
|
||||
@endif
|
||||
</div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="flex flex-col gap-2 pt-2 " wire:init='load_deployments'
|
||||
<div class="flex flex-col gap-2" wire:init='load_deployments'
|
||||
@if ($skip == 0) wire:poll.5000ms='reload_deployments' @endif>
|
||||
<div>
|
||||
<h3>Actions</h3>
|
||||
@ -10,9 +10,6 @@
|
||||
@endif
|
||||
</div>
|
||||
<h3>Deployments</h3>
|
||||
<div wire:loading wire:target='load_deployments'>
|
||||
<x-loading />
|
||||
</div>
|
||||
@foreach ($deployments as $deployment)
|
||||
<a @class([
|
||||
'bg-coolgray-200 p-2 border-l border-dashed transition-colors hover:no-underline',
|
||||
@ -52,7 +49,7 @@
|
||||
@endif
|
||||
|
||||
<div class="flex flex-col" x-data="elapsedTime('{{ $deployment->deployment_uuid }}', '{{ $deployment->status }}', '{{ $deployment->created_at }}', '{{ $deployment->updated_at }}')">
|
||||
<div>Finished <span x-text="measure_since_started()">0s</span> in <span class="font-bold text-white"
|
||||
<div>Finished <span x-text="measure_since_started()">0s</span> in <span class="font-bold"
|
||||
x-text="measure_finished_time()">0s</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,8 +12,5 @@
|
||||
</ul>
|
||||
</div>
|
||||
<x-applications.navbar :application="$application" />
|
||||
{{-- @if (data_get($activity, 'properties.status') === 'in_progress' && (data_get($deployment, 'metadata.status') !== 'error' || data_get($deployment, 'metadata.status') !== 'finished'))
|
||||
<livewire:project.application.deployment-cancel :activity="$activity" :application="$application" :deployment_uuid="$deployment_uuid" />
|
||||
@endif --}}
|
||||
<livewire:project.application.deployment-logs :activity="$activity" :application="$application" :deployment_uuid="$deployment_uuid" />
|
||||
</x-layout>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<x-layout>
|
||||
<h1 class="pb-0">Deployments</h1>
|
||||
<div class="pb-10 text-sm breadcrumbs">
|
||||
<ul>
|
||||
<ul>`
|
||||
<li><a
|
||||
href="{{ route('project.show', ['project_uuid' => request()->route('project_uuid')]) }}">{{ $application->environment->project->name }}</a>
|
||||
</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user