mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 16:17:10 +00:00
refactor(database): split import form into Livewire child
Extract the database import form into its own component and add realtime status refresh components for application server badges and service resource cards.
This commit is contained in:
1 parent
4401bee941
commit
322bf7c1b2
11 files changed
+1450
-1135
No files matched your search
@@ -0,0 +1,41 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user