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\Servers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Spatie\QueryBuilder\QueryBuilder;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Pterodactyl\Http\Controllers\Controller;
|
||||
use Pterodactyl\Repositories\Eloquent\ServerRepository;
|
||||
|
@ -42,10 +44,11 @@ class ServerController extends Controller
|
|||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
return $this->view->make('admin.servers.index', [
|
||||
'servers' => $this->repository->setSearchTerm($request->input('query'))->getAllServers(
|
||||
config()->get('pterodactyl.paginate.admin.servers')
|
||||
),
|
||||
]);
|
||||
$servers = QueryBuilder::for(Server::query()->with('node', 'user', 'allocation'))
|
||||
->allowedIncludes(['uuid', 'name', 'image'])
|
||||
->allowedSorts(['id', 'uuid'])
|
||||
->paginate(config()->get('pterodactyl.paginate.admin.servers'));
|
||||
|
||||
return $this->view->make('admin.servers.index', ['servers' => $servers]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue