fix: resources

This commit is contained in:
Andras Bacsai
2024-02-16 22:15:18 +01:00
parent e0b0dda382
commit f8c86769a7
4 changed files with 27 additions and 6 deletions

View File

@@ -11,7 +11,18 @@ class Resources extends Component
use AuthorizesRequests;
public ?Server $server = null;
public $parameters = [];
public function getListeners()
{
$teamId = auth()->user()->currentTeam()->id;
return [
"echo-private:team.{$teamId},ApplicationStatusChanged" => 'refreshStatus',
];
}
public function refreshStatus() {
$this->server->refresh();
$this->dispatch('success', 'Resource statuses refreshed.');
}
public function mount() {
$this->parameters = get_route_parameters();
try {

View File

@@ -15,6 +15,7 @@ class Services extends Component
public function __construct(
public Service $service,
public string $complexStatus = 'exited',
public bool $showRefreshButton = true
) {
$this->complexStatus = $service->status();
}