mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-12 11:23:47 +02:00
Update all remaining code pathways to use new search tooling
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace Pterodactyl\Http\Controllers\Admin\Nodes;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Pterodactyl\Models\Node;
|
||||
use Spatie\QueryBuilder\QueryBuilder;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Pterodactyl\Http\Controllers\Controller;
|
||||
use Pterodactyl\Repositories\Eloquent\NodeRepository;
|
||||
@@ -39,10 +41,13 @@ class NodeController extends Controller
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$nodes = $this->repository
|
||||
->setSearchTerm($request->input('query'))
|
||||
->getNodeListingData();
|
||||
$nodes = QueryBuilder::for(
|
||||
Node::query()->with('location')->withCount('servers')
|
||||
)
|
||||
->allowedFilters(['uuid', 'name'])
|
||||
->allowedSorts(['id'])
|
||||
->paginate(25);
|
||||
|
||||
return $this->view->make('admin.nodes.index', compact('nodes'));
|
||||
return $this->view->make('admin.nodes.index', ['nodes' => $nodes]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user