From 2ee837eb905c97e79b6f1b74b521567369af7dca Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 26 Sep 2023 18:47:45 -0700 Subject: [PATCH] Fix incorrect pages offset on app ntp page (#15349) * Update app_ntp.inc.php Fixes ISSUE 15344 - Corrects start point in table when showing NTP APP - Corrects blank page when showing ALL NTP entries * Update app_ntp.inc.php Use row count for page start not a hard coded 10 --- includes/html/table/app_ntp.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/html/table/app_ntp.inc.php b/includes/html/table/app_ntp.inc.php index 5363a99d70..297b30b85b 100644 --- a/includes/html/table/app_ntp.inc.php +++ b/includes/html/table/app_ntp.inc.php @@ -6,8 +6,9 @@ $options['filter']['ignore'] = ['=', 0]; $options['type'] = 'ntp'; $components = $component->getComponents(null, $options); -$first = $vars['current'] - 1; // Which record do we start on. -$last = $first + $vars['rowCount']; // Which record do we end on. +$first = ($vars['current'] - 1) * $vars['rowCount']; // Which record do we start on. +$last = $first + $vars['rowCount']; // Which record do we end on. +$showAll = $vars['rowCount'] == -1; // Show all devices y/n $count = 0; // Loop through each device in the component array foreach ($components as $devid => $comp) { @@ -48,7 +49,7 @@ foreach ($components as $devid => $comp) { $count++; // If this record is in the range we want. - if (($count > $first) && ($count <= $last)) { + if ($showAll || (($count > $first) && ($count <= $last))) { $device_link = generate_device_link($device, null, ['tab' => 'apps', 'app' => 'ntp']); $graph_array = [];