mirror of
https://github.com/coollabsio/coolify.git
synced 2026-06-14 03:19:51 +00:00
322bf7c1b2
Extract the database import form into its own component and add realtime status refresh components for application server badges and service resource cards.
42 lines
905 B
PHP
42 lines
905 B
PHP
<?php
|
|
|
|
namespace App\Livewire\Project\Application;
|
|
|
|
use App\Models\Application;
|
|
use Illuminate\Contracts\View\View;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Livewire\Component;
|
|
|
|
class ServerStatusBadge extends Component
|
|
{
|
|
public Application $application;
|
|
|
|
public function getListeners(): array
|
|
{
|
|
$user = Auth::user();
|
|
if (! $user) {
|
|
return [];
|
|
}
|
|
|
|
$team = $user->currentTeam();
|
|
if (! $team) {
|
|
return [];
|
|
}
|
|
|
|
return [
|
|
"echo-private:team.{$team->id},ServiceStatusChanged" => 'refreshStatus',
|
|
"echo-private:team.{$team->id},ServiceChecked" => 'refreshStatus',
|
|
];
|
|
}
|
|
|
|
public function refreshStatus(): void
|
|
{
|
|
$this->application->refresh();
|
|
}
|
|
|
|
public function render(): View
|
|
{
|
|
return view('livewire.project.application.server-status-badge');
|
|
}
|
|
}
|