mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
PSR2 Cleanup: /html edition
Travis tests for code conformance. Ignore warnings for now. Fixed all errors, left most warnings.
This commit is contained in:
@@ -31,7 +31,7 @@ foreach ($app_devices as $app_device) {
|
||||
$link = generate_url(array('page' => 'device', 'device' => $app_device['device_id'], 'tab' => 'apps', 'app' => $vars['app']));
|
||||
|
||||
echo '<div class="pull-left">';
|
||||
echo overlib_link($link, generate_lazy_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
|
||||
echo overlib_link($link, generate_lazy_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), null);
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@ $component = new component();
|
||||
$options = array();
|
||||
$options['filter']['ignore'] = array('=',0);
|
||||
$options['type'] = 'ntp';
|
||||
$components = $component->getComponents(null,$options);
|
||||
$components = $component->getComponents(null, $options);
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
@@ -93,75 +93,74 @@ print_optionbar_end();
|
||||
<?php
|
||||
$count = 0;
|
||||
// Loop through each device in the componenet array
|
||||
foreach ($components as $devid => $comp) {
|
||||
$device = device_by_id_cache($devid);
|
||||
foreach ($components as $devid => $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 = '';
|
||||
// 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++;
|
||||
if ($display === true) {
|
||||
$link = generate_device_link($device, null, array('tab' => 'apps', 'app' => 'ntp'));
|
||||
$count++;
|
||||
?>
|
||||
<tr <?php echo $status; ?>>
|
||||
<td><?php echo $link; ?></td>
|
||||
<td><?php echo $array['peer']; ?></td>
|
||||
<td><?php echo $array['stratum']; ?></td>
|
||||
<td><?php echo $array['error']; ?></td>
|
||||
</tr>
|
||||
<tr <?php echo $status; ?>>
|
||||
<td><?php echo $link; ?></td>
|
||||
<td><?php echo $array['peer']; ?></td>
|
||||
<td><?php echo $array['stratum']; ?></td>
|
||||
<td><?php echo $array['error']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$graph_array = array();
|
||||
$graph_array['device'] = $device['device_id'];
|
||||
$graph_array['height'] = '100';
|
||||
$graph_array['width'] = '215';
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
$graph_array = array();
|
||||
$graph_array['device'] = $device['device_id'];
|
||||
$graph_array['height'] = '100';
|
||||
$graph_array['width'] = '215';
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
|
||||
// Which graph type do we want?
|
||||
if ($vars['graph'] == "stratum") {
|
||||
$graph_array['type'] = 'device_ntp_stratum';
|
||||
} elseif ($vars['graph'] == "offset") {
|
||||
$graph_array['type'] = 'device_ntp_offset';
|
||||
} elseif ($vars['graph'] == "delay") {
|
||||
$graph_array['type'] = 'device_ntp_delay';
|
||||
} elseif ($vars['graph'] == "dispersion") {
|
||||
$graph_array['type'] = 'device_ntp_dispersion';
|
||||
} else {
|
||||
// No Graph
|
||||
unset($graph_array);
|
||||
}
|
||||
// Which graph type do we want?
|
||||
if ($vars['graph'] == "stratum") {
|
||||
$graph_array['type'] = 'device_ntp_stratum';
|
||||
} elseif ($vars['graph'] == "offset") {
|
||||
$graph_array['type'] = 'device_ntp_offset';
|
||||
} elseif ($vars['graph'] == "delay") {
|
||||
$graph_array['type'] = 'device_ntp_delay';
|
||||
} elseif ($vars['graph'] == "dispersion") {
|
||||
$graph_array['type'] = 'device_ntp_dispersion';
|
||||
} else {
|
||||
// No Graph
|
||||
unset($graph_array);
|
||||
}
|
||||
|
||||
// Do we want a graph.
|
||||
if (is_array($graph_array)) {
|
||||
echo '<tr>';
|
||||
echo '<td colspan="4">';
|
||||
require 'includes/print-graphrow.inc.php';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
} // End if display
|
||||
} // End foreach component
|
||||
} // End foreach device
|
||||
// Do we want a graph.
|
||||
if (is_array($graph_array)) {
|
||||
echo '<tr>';
|
||||
echo '<td colspan="4">';
|
||||
require 'includes/print-graphrow.inc.php';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
} // End if display
|
||||
} // End foreach component
|
||||
} // End foreach device
|
||||
|
||||
// If there are no results, let the user know.
|
||||
if ($count == 0) {
|
||||
if ($count == 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="4" align="center">No Matching NTP Peers</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" align="center">No Matching NTP Peers</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
@@ -15,7 +15,7 @@ foreach ($app_list as $app) {
|
||||
$app_devices = dbFetchRows('SELECT * FROM `devices` AS D, `applications` AS A WHERE D.device_id = A.device_id AND A.app_type = ?', array($app['app_type']));
|
||||
|
||||
foreach ($app_devices as $app_device) {
|
||||
$graph_type = $graphs[$app['app_type']][0];
|
||||
$graph_type = $graphs[$app['app_type']][0];
|
||||
|
||||
$graph_array['type'] = 'application_'.$app['app_type'].'_'.$graph_type;
|
||||
$graph_array['id'] = $app_device['app_id'];
|
||||
|
@@ -39,16 +39,14 @@ $pagetitle[] = $instance;
|
||||
|
||||
if (!isset($vars['instance'])) {
|
||||
$instance = $pmxcl[0]['app_instance'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$instance = var_get('instance');
|
||||
}
|
||||
|
||||
if (isset($vars['vmid'])) {
|
||||
include("pages/apps/proxmox/vm.inc.php");
|
||||
$pagetitle[] = $vars['vmid'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
echo '
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
@@ -65,4 +63,3 @@ else {
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user