mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
init
This commit is contained in:
34
app/Http/Livewire/Application/DeploymentsList.php
Normal file
34
app/Http/Livewire/Application/DeploymentsList.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?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),
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user