Show warning for a server's allocations if it's currently running

This commit is contained in:
Lance Pioch 2022-11-07 22:12:24 -05:00
parent 87a2fff3b7
commit 6ffb7fd7f6
2 changed files with 15 additions and 0 deletions

View file

@ -61,8 +61,15 @@ class ServerViewController extends Controller
{
$allocations = $server->node->allocations->toBase();
try {
$stats = $server->getStats();
} catch (\Exception) {
// Can't connect to daemon
}
return $this->view->make('admin.servers.view.build', [
'server' => $server,
'currentState' => $stats['current_state'] ?? null,
'assigned' => $allocations->where('server_id', $server->id)->sortBy('port')->sortBy('ip'),
'unassigned' => $allocations->where('server_id', null)->sortBy('port')->sortBy('ip'),
]);