Update all remaining code pathways to use new search tooling
This commit is contained in:
parent
12fe3f1a4e
commit
d8c338df3e
14 changed files with 54 additions and 305 deletions
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue