mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-22 09:02:28 +01:00
Fix SQl queries being executed unnecessarily when listing servers
This commit is contained in:
parent
eaf54a8c63
commit
a31334c0c5
@ -7,6 +7,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||
### Fixed
|
||||
* Fixes application API keys being created as a client API key.
|
||||
* Search term is now passed through when using paginated result sets.
|
||||
* Reduces the number of SQL queries executed when rendering the server listing to increase performance.
|
||||
|
||||
### Changed
|
||||
* Databases are now properly paginated when viewing a database host.
|
||||
|
@ -216,7 +216,7 @@ class ServerRepository extends EloquentRepository implements ServerRepositoryInt
|
||||
*/
|
||||
public function filterUserAccessServers(User $user, int $level, bool $paginate = true)
|
||||
{
|
||||
$instance = $this->getBuilder()->select($this->getColumns())->with(['user']);
|
||||
$instance = $this->getBuilder()->select($this->getColumns())->with(['user', 'node', 'allocation']);
|
||||
|
||||
// If access level is set to owner, only display servers
|
||||
// that the user owns.
|
||||
|
@ -51,8 +51,8 @@
|
||||
<tr class="dynamic-update" data-server="{{ $server->uuidShort }}">
|
||||
<td @if(! empty($server->description)) rowspan="2" @endif><code>{{ $server->uuidShort }}</code></td>
|
||||
<td><a href="{{ route('server.index', $server->uuidShort) }}">{{ $server->name }}</a></td>
|
||||
<td>{{ $server->node->name }}</td>
|
||||
<td><code>{{ $server->allocation->alias }}:{{ $server->allocation->port }}</code></td>
|
||||
<td>{{ $server->getRelation('node')->name }}</td>
|
||||
<td><code>{{ $server->getRelation('allocation')->alias }}:{{ $server->getRelation('allocation')->port }}</code></td>
|
||||
<td class="text-center hidden-sm hidden-xs"><span data-action="memory">--</span> / {{ $server->memory === 0 ? '∞' : $server->memory }} MB</td>
|
||||
<td class="text-center hidden-sm hidden-xs"><span data-action="cpu" data-cpumax="{{ $server->cpu }}">--</span> %</td>
|
||||
<td class="text-center">
|
||||
|
Loading…
Reference in New Issue
Block a user