repository->loadLocationAndServerCount($node); $stats = $this->repository->getUsageStats($node); return $this->view->make('admin.nodes.view.index', [ 'node' => $node, 'stats' => $stats, 'version' => $this->versionService, ]); } /** * Returns the settings page for a specific node. */ public function settings(Request $request, Node $node): View { return $this->view->make('admin.nodes.view.settings', [ 'node' => $node, 'locations' => $this->locationRepository->all(), 'daemonTypes' => DaemonType::all(), 'backupDisks' => Adapters::all_sorted(), ]); } /** * Return the node configuration page for a specific node. */ public function configuration(Request $request, Node $node): View { return $this->view->make('admin.nodes.view.configuration', compact('node')); } /** * Return the node allocation management page. */ public function allocations(Request $request, Node $node): View { $node = $this->repository->loadNodeAllocations($node); $this->plainInject(['node' => Collection::wrap($node)->only(['id'])]); switch (DB::getPdo()->getAttribute(DB::getPdo()::ATTR_DRIVER_NAME)) { default: return $this->view->make('admin.nodes.view.allocation', [ 'node' => $node, 'allocations' => Allocation::query()->where('node_id', $node->id) ->groupBy('ip') ->orderByRaw('INET_ATON(ip) ASC') ->get(['ip']), ]); case 'pgsql': return $this->view->make('admin.nodes.view.allocation', [ 'node' => $node, 'allocations' => Allocation::query()->where('node_id', $node->id) ->groupBy('ip') ->orderByRaw('ip::inet ASC') ->get(['ip']), ]); } } /** * Return a listing of servers that exist for this specific node. */ public function servers(Request $request, Node $node): View { $this->plainInject([ 'node' => Collection::wrap($node->makeVisible(['daemon_token_id', 'daemon_token'])) ->only(['scheme', 'fqdn', 'daemonListen', 'daemon_token_id', 'daemon_token']), ]); return $this->view->make('admin.nodes.view.servers', [ 'node' => $node, 'servers' => $this->serverRepository->loadAllServersForNode($node->id, 25), ]); } }