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

28 lines
770 B
PHP
Raw Normal View History

<?php
2023-04-25 11:01:56 +02:00
namespace App\Http\Livewire\Project\Application;
2023-06-30 15:57:40 +02:00
use App\Models\ApplicationDeploymentQueue;
use Livewire\Component;
2023-05-24 14:26:50 +02:00
class DeploymentLogs extends Component
{
2023-06-30 15:57:40 +02:00
public ApplicationDeploymentQueue $application_deployment_queue;
public $isKeepAliveOn = true;
2023-06-30 15:57:40 +02:00
protected $listeners = ['refreshQueue'];
2023-06-30 15:57:40 +02:00
public function refreshQueue()
{
$this->application_deployment_queue->refresh();
}
public function polling()
{
2023-05-31 14:42:37 +02:00
$this->emit('deploymentFinished');
2023-06-30 15:57:40 +02: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;
}
}
}