mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge remote-tracking branch 'upstream/master' into rrd-create-remote
This commit is contained in:
@@ -19,7 +19,7 @@ global $config;
|
||||
// Loop over each component, pulling out the Overlays.
|
||||
foreach ($components as $oid => $overlay) {
|
||||
if ($overlay['otvtype'] == 'overlay') {
|
||||
if ($overlay['status'] == 1) {
|
||||
if ($overlay['status'] == 0) {
|
||||
$overlay_status = "<span class='green pull-right'>Normal</span>";
|
||||
$gli = "";
|
||||
}
|
||||
@@ -33,7 +33,7 @@ foreach ($components as $oid => $overlay) {
|
||||
<?php
|
||||
foreach ($components as $aid => $adjacency) {
|
||||
if (($adjacency['otvtype'] == 'adjacency') && ($adjacency['index'] == $overlay['index'])) {
|
||||
if ($adjacency['status'] == 1) {
|
||||
if ($adjacency['status'] == 0) {
|
||||
$adj_status = "<span class='green pull-right'>Normal</span>";
|
||||
$gli = "";
|
||||
}
|
||||
|
@@ -1,17 +1,19 @@
|
||||
<?php
|
||||
|
||||
$link_array = array(
|
||||
'page' => 'device',
|
||||
'device' => $device['device_id'],
|
||||
'tab' => 'routing',
|
||||
'proto' => 'ipsec_tunnels',
|
||||
);
|
||||
'page' => 'device',
|
||||
'device' => $device['device_id'],
|
||||
'tab' => 'routing',
|
||||
'proto' => 'ipsec_tunnels'
|
||||
);
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
echo "<span style='font-weight: bold;'>IPSEC Tunnels</span> » ";
|
||||
|
||||
$menu_options = array('basic' => 'Basic');
|
||||
$menu_options = array(
|
||||
'basic' => 'Basic'
|
||||
);
|
||||
|
||||
if (!isset($vars['view'])) {
|
||||
$vars['view'] = 'basic';
|
||||
@@ -19,8 +21,8 @@ if (!isset($vars['view'])) {
|
||||
|
||||
echo "<span style='font-weight: bold;'>VRFs</span> » ";
|
||||
|
||||
$menu_options = array('basic' => 'Basic',
|
||||
// 'detail' => 'Detail',
|
||||
$menu_options = array(
|
||||
'basic' => 'Basic'
|
||||
);
|
||||
|
||||
if (!$_GET['opta']) {
|
||||
@@ -32,83 +34,98 @@ foreach ($menu_options as $option => $text) {
|
||||
if ($vars['view'] == $option) {
|
||||
echo "<span class='pagemenu-selected'>";
|
||||
}
|
||||
|
||||
echo generate_link($text, $link_array, array('view' => $option));
|
||||
|
||||
echo generate_link($text, $link_array, array(
|
||||
'view' => $option
|
||||
));
|
||||
if ($vars['view'] == $option) {
|
||||
echo '</span>';
|
||||
}
|
||||
|
||||
|
||||
echo ' | ';
|
||||
}
|
||||
|
||||
echo ' Graphs: ';
|
||||
|
||||
$graph_types = array(
|
||||
'bits' => 'Bits',
|
||||
'pkts' => 'Packets',
|
||||
);
|
||||
'bits' => 'Bits',
|
||||
'pkts' => 'Packets'
|
||||
);
|
||||
|
||||
foreach ($graph_types as $type => $descr) {
|
||||
echo "$type_sep";
|
||||
if ($vars['graph'] == $type) {
|
||||
echo "<span class='pagemenu-selected'>";
|
||||
}
|
||||
|
||||
echo generate_link($descr, $link_array, array('view' => 'graphs', 'graph' => $type));
|
||||
|
||||
echo generate_link($descr, $link_array, array(
|
||||
'view' => 'graphs',
|
||||
'graph' => $type
|
||||
));
|
||||
if ($vars['graph'] == $type) {
|
||||
echo '</span>';
|
||||
}
|
||||
|
||||
|
||||
$type_sep = ' | ';
|
||||
}
|
||||
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
echo "<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=0 width=100%>";
|
||||
$i = '0';
|
||||
foreach (dbFetchRows('SELECT * FROM `ipsec_tunnels` WHERE `device_id` = ? ORDER BY `peer_addr`', array($device['device_id'])) as $tunnel) {
|
||||
if (is_integer($i / 2)) {
|
||||
$bg_colour = $list_colour_a;
|
||||
}
|
||||
else {
|
||||
$bg_colour = $list_colour_b;
|
||||
}
|
||||
$tunnel = dbFetchRows('SELECT * FROM `ipsec_tunnels` WHERE `device_id` = ? ORDER BY `peer_addr`', array(
|
||||
$device['device_id']
|
||||
));
|
||||
|
||||
if ($tunnel['tunnel_status'] == 'active') {
|
||||
$tunnel_class = 'green';
|
||||
if (is_null($vars['graph'])) {
|
||||
$tunnel_label = 'warning';
|
||||
echo '<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Local Identity</th>
|
||||
<th>Remote Identity</th>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
|
||||
foreach ($tunnel as $entry) {
|
||||
$local_addr = preg_replace('/\b0+(?=\d)/', '', htmlentities($entry['local_addr']));
|
||||
$remote_addr = preg_replace('/\b0+(?=\d)/', '', htmlentities($entry['peer_addr']));
|
||||
|
||||
if ($tunnel['tunnel_status'] = 'active') {
|
||||
$tunnel_label = 'success';
|
||||
}
|
||||
echo '<tr>
|
||||
<td>' . $local_addr . '</td>
|
||||
<td>' . $remote_addr . '</td>
|
||||
<td>' . htmlentities($entry['tunnel_name']) . '</td>
|
||||
<td><span class="label label-' . $tunnel_label . '">' . htmlentities($entry['tunnel_status']) . '</span></td>
|
||||
</tr>';
|
||||
}
|
||||
else {
|
||||
$tunnel_class = 'red';
|
||||
}
|
||||
|
||||
echo "<tr bgcolor='$bg_colour'>";
|
||||
echo '<td width=320 class=list-large>'.$tunnel['local_addr'].' » '.$tunnel['peer_addr'].'</a></td>';
|
||||
echo '<td width=150 class=box-desc>'.$tunnel['tunnel_name'].'</td>';
|
||||
echo "<td width=100 class=list-large><span class='".$tunnel_class."'>".$tunnel['tunnel_status'].'</span></td>';
|
||||
echo '</tr>';
|
||||
if (isset($vars['graph'])) {
|
||||
echo '<tr class="list-bold">';
|
||||
echo '<td colspan = 3>';
|
||||
$graph_type = 'ipsectunnel_'.$vars['graph'];
|
||||
|
||||
|
||||
echo '</tbody>
|
||||
</table>';
|
||||
} else {
|
||||
foreach ($tunnel as $entry) {
|
||||
$local_addr = preg_replace('/\b0+(?=\d)/', '', htmlentities($entry['local_addr']));
|
||||
$remote_addr = preg_replace('/\b0+(?=\d)/', '', htmlentities($entry['peer_addr']));
|
||||
|
||||
$graph_type = 'ipsectunnel_' . $vars['graph'];
|
||||
$graph_array['height'] = '100';
|
||||
$graph_array['width'] = '215';
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
$graph_array['id'] = $tunnel['tunnel_id'];
|
||||
$graph_array['id'] = $entry['tunnel_id'];
|
||||
$graph_array['type'] = $graph_type;
|
||||
|
||||
echo '<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">' . $local_addr . ' » ' . $remote_addr . '</h3>
|
||||
</div>
|
||||
<div class="panel-body">';
|
||||
echo "<div class='row'>";
|
||||
include 'includes/print-graphrow.inc.php';
|
||||
|
||||
echo '
|
||||
</td>
|
||||
</tr>';
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
$i++;
|
||||
}//end foreach
|
||||
|
||||
echo '</table></div>';
|
||||
}
|
||||
|
Reference in New Issue
Block a user