diff --git a/app/Http/Controllers/Admin/Servers/ServerViewController.php b/app/Http/Controllers/Admin/Servers/ServerViewController.php index 7cf64a2f5..d53a815c3 100644 --- a/app/Http/Controllers/Admin/Servers/ServerViewController.php +++ b/app/Http/Controllers/Admin/Servers/ServerViewController.php @@ -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'), ]); diff --git a/resources/views/admin/servers/view/build.blade.php b/resources/views/admin/servers/view/build.blade.php index f7ba9a2d2..d1f4e1879 100644 --- a/resources/views/admin/servers/view/build.blade.php +++ b/resources/views/admin/servers/view/build.blade.php @@ -129,6 +129,14 @@

Allocation Management

+ @if ($currentState === 'running') +
+ Warning, your server is currently running. + If you remove allocations without restarting, + then you can run into issues using them elsewhere. +
+ @endif +