mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-20 10:21:37 +00:00
35 lines
837 B
PHP
35 lines
837 B
PHP
<?php
|
|
|
|
namespace App\Http\Livewire\Application;
|
|
|
|
use App\Models\Site;
|
|
use App\Traits\HasCustomPaginationView;
|
|
use App\Traits\RefreshComponentOnBroadcast;
|
|
use Illuminate\Contracts\View\View;
|
|
use Livewire\Component;
|
|
|
|
class DeploymentsList extends Component
|
|
{
|
|
use RefreshComponentOnBroadcast;
|
|
use HasCustomPaginationView;
|
|
|
|
public Site $site;
|
|
|
|
public string $logContent;
|
|
|
|
public function showLog(int $id): void
|
|
{
|
|
$deployment = $this->site->deployments()->findOrFail($id);
|
|
$this->logContent = $deployment->log->content;
|
|
|
|
$this->dispatchBrowserEvent('open-modal', 'show-log');
|
|
}
|
|
|
|
public function render(): View
|
|
{
|
|
return view('livewire.application.deployments-list', [
|
|
'deployments' => $this->site->deployments()->latest()->simplePaginate(10),
|
|
]);
|
|
}
|
|
}
|