* * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. Please see LICENSE.txt at the top level of * the source code distribution for details. */ require_once "../includes/component.php"; $component = new component(); $options = array(); $options['filter']['ignore'] = array('=',0); $options['type'] = 'ntp'; $components = $component->getComponents(null,$options); print_optionbar_start(); $view_options = array( 'all' => 'All', 'error' => 'Error', ); if (!$vars['view']) { $vars['view'] = 'all'; } $graph_options = array( 'none' => 'No Graphs', 'stratum' => 'Stratum', 'offset' => 'Offset', 'delay' => 'Delay', 'dispersion' => 'Dispersion', ); if (!$vars['graph']) { $vars['graph'] = 'none'; } echo 'NTP Peers » '; // The menu option - on the left $sep = ''; foreach ($view_options as $option => $text) { if (empty($vars['view'])) { $vars['view'] = $option; } echo $sep; if ($vars['view'] == $option) { echo ""; } echo generate_link($text, $vars, array('view' => $option)); if ($vars['view'] == $option) { echo ''; } $sep = ' | '; } // The status option - on the right echo '
'; $sep = ''; foreach ($graph_options as $option => $text) { if (empty($vars['graph'])) { $vars['graph'] = $option; } echo $sep; if ($vars['graph'] == $option) { echo ""; } echo generate_link($text, $vars, array('graph' => $option)); if ($vars['graph'] == $option) { echo ''; } $sep = ' | '; } unset($sep); echo '
'; print_optionbar_end(); ?> $comp) { $device = device_by_id_cache($devid); // Loop through each component foreach ($comp as $compid => $array) { $display = true; if ($vars['view'] == 'error') { // Only display peers with errors if ($array['status'] != 2) { $display = false; } } if ($array['status'] == 2) { $status = 'class="danger"'; } else { $status = ''; } if ($display === true) { $link = generate_device_link($device,null,array('tab' => 'apps', 'app' => 'ntp')); $count++; ?> > '; echo ''; echo ''; } } // End if display } // End foreach component } // End foreach device // If there are no results, let the user know. if ($count == 0) { ?>
Device Peer Stratum Error
'; require 'includes/print-graphrow.inc.php'; echo '
No Matching NTP Peers