Support searching servers in admin area using name; closes #2100

This commit is contained in:
Dane Everitt 2020-09-13 12:26:15 -07:00
parent d8c338df3e
commit 88300e5448
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 3 additions and 3 deletions

View file

@ -45,7 +45,7 @@ class ServerController extends Controller
public function index(Request $request)
{
$servers = QueryBuilder::for(Server::query()->with('node', 'user', 'allocation'))
->allowedIncludes(['uuid', 'name', 'image'])
->allowedFilters(['uuid', 'name', 'image'])
->allowedSorts(['id', 'uuid'])
->paginate(config()->get('pterodactyl.paginate.admin.servers'));

View file

@ -85,7 +85,7 @@ class UserController extends Controller
public function index(Request $request)
{
$users = QueryBuilder::for(User::query()->withCount('servers'))
->allowedIncludes(['username', 'email', 'uuid'])
->allowedFilters(['username', 'email', 'uuid'])
->allowedSorts(['id', 'uuid'])
->paginate(50);

View file

@ -26,7 +26,7 @@
<div class="box-tools search01">
<form action="{{ route('admin.servers') }}" method="GET">
<div class="input-group input-group-sm">
<input type="text" name="query" class="form-control pull-right" value="{{ request()->input('query') }}" placeholder="Search Servers">
<input type="text" name="filter[name]" class="form-control pull-right" value="{{ request()->input('filter.name') }}" placeholder="Search Servers">
<div class="input-group-btn">
<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
<a href="{{ route('admin.servers.new') }}"><button type="button" class="btn btn-sm btn-primary" style="border-radius: 0 3px 3px 0;margin-left:-1px;">Create New</button></a>