Skip to content

Commit 88300e5

Browse files
committed
Support searching servers in admin area using name; closes pterodactyl#2100
1 parent d8c338d commit 88300e5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/Http/Controllers/Admin/Servers/ServerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(
4545
public function index(Request $request)
4646
{
4747
$servers = QueryBuilder::for(Server::query()->with('node', 'user', 'allocation'))
48-
->allowedIncludes(['uuid', 'name', 'image'])
48+
->allowedFilters(['uuid', 'name', 'image'])
4949
->allowedSorts(['id', 'uuid'])
5050
->paginate(config()->get('pterodactyl.paginate.admin.servers'));
5151

app/Http/Controllers/Admin/UserController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function __construct(
8585
public function index(Request $request)
8686
{
8787
$users = QueryBuilder::for(User::query()->withCount('servers'))
88-
->allowedIncludes(['username', 'email', 'uuid'])
88+
->allowedFilters(['username', 'email', 'uuid'])
8989
->allowedSorts(['id', 'uuid'])
9090
->paginate(50);
9191

resources/views/admin/servers/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<div class="box-tools search01">
2727
<form action="{{ route('admin.servers') }}" method="GET">
2828
<div class="input-group input-group-sm">
29-
<input type="text" name="query" class="form-control pull-right" value="{{ request()->input('query') }}" placeholder="Search Servers">
29+
<input type="text" name="filter[name]" class="form-control pull-right" value="{{ request()->input('filter.name') }}" placeholder="Search Servers">
3030
<div class="input-group-btn">
3131
<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
3232
<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>

0 commit comments

Comments
 (0)