fix(server): implement refreshServer method and update navbar event listener for improved server state management
This commit is contained in:
parent
9bd80e4c07
commit
f9ed02a0b7
2 changed files with 9 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ public function getListeners()
|
|||
$teamId = auth()->user()->currentTeam()->id;
|
||||
|
||||
return [
|
||||
'refreshServerShow' => '$refresh',
|
||||
'refreshServerShow' => 'refreshServer',
|
||||
"echo-private:team.{$teamId},ProxyStatusChangedUI" => 'showNotification',
|
||||
];
|
||||
}
|
||||
|
|
@ -134,6 +134,12 @@ public function showNotification()
|
|||
|
||||
}
|
||||
|
||||
public function refreshServer()
|
||||
{
|
||||
$this->server->refresh();
|
||||
$this->server->load('settings');
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.server.navbar');
|
||||
|
|
|
|||
|
|
@ -310,6 +310,8 @@ public function updatedIsBuildServer($value)
|
|||
$this->dispatch('info', 'Sentinel has been disabled as build servers cannot run Sentinel.');
|
||||
}
|
||||
$this->submit();
|
||||
// Dispatch event to refresh the navbar
|
||||
$this->dispatch('refreshServerShow');
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue