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

26 lines
768 B
PHP
Raw Normal View History

<?php
2023-04-25 09:01:56 +00:00
namespace App\Http\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'];
public function refreshQueue()
{
$this->application_deployment_queue->refresh();
}
public function polling()
{
2023-05-31 12:42:37 +00:00
$this->emit('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;
}
}
}