mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user