Cleanup allocation repository

This commit is contained in:
Dane Everitt 2020-09-13 12:47:05 -07:00
parent 9410a54c98
commit 7b57d65edf
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 27 additions and 79 deletions

View file

@ -5,6 +5,7 @@ namespace Pterodactyl\Http\Controllers\Admin\Nodes;
use Illuminate\Http\Request;
use Pterodactyl\Models\Node;
use Illuminate\Support\Collection;
use Pterodactyl\Models\Allocation;
use Illuminate\Contracts\View\Factory;
use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Repositories\Eloquent\NodeRepository;
@ -134,7 +135,10 @@ class NodeViewController extends Controller
return $this->view->make('admin.nodes.view.allocation', [
'node' => $node,
'allocations' => $this->allocationRepository->setColumns(['ip'])->getUniqueAllocationIpsForNode($node->id),
'allocations' => Allocation::query()->where('node_id', $node->id)
->groupBy('ip')
->orderByRaw('INET_ATON(ip) ASC')
->get(['ip']),
]);
}