lasthourcloud/app/Livewire/Project/Application/DeploymentLogs.php

28 lines
769 B
PHP
Raw Normal View History

<?php
2023-12-07 18:06:32 +00:00
namespace App\Livewire\Project\Application;
2023-06-30 13:57:40 +00:00
use App\Models\ApplicationDeploymentQueue;
use Livewire\Component;
2023-05-24 12:26:50 +00:00
class DeploymentLogs extends Component
{
2023-06-30 13:57:40 +00:00
public ApplicationDeploymentQueue $application_deployment_queue;
public $isKeepAliveOn = true;
2023-06-30 13:57:40 +00:00
protected $listeners = ['refreshQueue'];
2023-06-30 13:57:40 +00:00
public function refreshQueue()
{
$this->application_deployment_queue->refresh();
}
public function polling()
{
2023-12-07 18:06:32 +00:00
$this->dispatch('deploymentFinished');
2023-06-30 13:57:40 +00:00
$this->application_deployment_queue->refresh();
if (data_get($this->application_deployment_queue, 'status') == 'finished' || data_get($this->application_deployment_queue, 'status') == 'failed') {
$this->isKeepAliveOn = false;
}
}
}