mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Change port pagination default to 32 (#16131)
* Change port pagination default to 32 that way this includes all ports for most switches. Most port counts are base 2, so change pagination options to match * ignore upstream missing closure type * Fix style again * more
This commit is contained in:
@@ -41,7 +41,7 @@ use LibreNMS\Interfaces\UI\DeviceTab;
|
||||
class PortsController implements DeviceTab
|
||||
{
|
||||
private bool $detail = false;
|
||||
private int|string $perPage = 15;
|
||||
private int|string $perPage = 32;
|
||||
private string $sortOrder = 'asc';
|
||||
private string $sortColumn = 'default';
|
||||
|
||||
@@ -116,7 +116,7 @@ class PortsController implements DeviceTab
|
||||
|
||||
/** @var Collection<Port>|LengthAwarePaginator<Port> $ports */
|
||||
$ports = $this->getFilteredPortsQuery($device, $request, $relationships)
|
||||
->paginate(fn ($total) => $this->perPage == 'all' ? $total : (int) $this->perPage)
|
||||
->paginate(fn ($total) => $this->perPage == 'all' ? $total : (int) $this->perPage) // @phpstan-ignore-line missing closure type
|
||||
->appends('perPage', $this->perPage);
|
||||
|
||||
$data = [
|
||||
@@ -332,7 +332,7 @@ class PortsController implements DeviceTab
|
||||
|
||||
private function getFilteredPortsQuery(Device $device, Request $request, array $relationships = []): Builder
|
||||
{
|
||||
$this->perPage = $request->input('perPage', 15);
|
||||
$this->perPage = $request->input('perPage', 32);
|
||||
$this->sortOrder = $request->input('order', 'asc');
|
||||
$this->sortColumn = $request->input('sort', 'default');
|
||||
|
||||
|
Reference in New Issue
Block a user