Dark mode fix routing tabs & pages (#15485)

* Dark mode fix routing tabs

* Fix styling

* Fix styling

* move tbody

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
Wheel
2023-11-02 04:34:09 +01:00
committed by GitHub
parent 47c6842b01
commit 9ca95a9ba5
5 changed files with 49 additions and 43 deletions

View File

@@ -110,28 +110,17 @@ if ($vars['view'] == 'macaccounting_pkts') {
print_optionbar_end();
echo '<table border="0" cellspacing="0" cellpadding="5" width="100%">';
echo '<table border="0" cellspacing="0" cellpadding="5" width="100%" class="table sortable">';
echo '<tr style="height: 30px"><th>Peer address</th><th>Type</th><th>Family</th><th>Remote AS</th><th>Peer description</th><th>State</th><th>Last error</th><th>Uptime</th></tr>';
$i = '1';
foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? $extra_sql ORDER BY `bgpPeerRemoteAs`, `bgpPeerIdentifier`", [$device['device_id']]) as $peer) {
$has_macaccounting = dbFetchCell('SELECT COUNT(*) FROM `ipv4_mac` AS I, mac_accounting AS M WHERE I.ipv4_address = ? AND M.mac = I.mac_address', [$peer['bgpPeerIdentifier']]);
if (! is_integer($i / 2)) {
$bg_colour = \LibreNMS\Config::get('list_colour.even');
} else {
$bg_colour = \LibreNMS\Config::get('list_colour.odd');
}
unset($alert);
unset($peerhost, $peername);
if (! is_integer($i / 2)) {
$bg_colour = \LibreNMS\Config::get('list_colour.odd');
} else {
$bg_colour = \LibreNMS\Config::get('list_colour.even');
}
if ($peer['bgpPeerState'] == 'established') {
$col = 'green';
} else {
@@ -241,7 +230,7 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? $extra_sql
$last_error = describe_bgp_error_code($peer['bgpPeerLastErrorCode'], $peer['bgpPeerLastErrorSubCode']) . '<br/>' . $peer['bgpPeerLastErrorText'];
}
echo '<tr bgcolor="' . $bg_colour . '"' . (empty($peer['alert']) ? '' : ' bordercolor="#cc0000"') . (empty($peer['disabled']) ? '' : ' bordercolor="#cccccc"') . '>
echo '<tr class="bgp"' . (empty($peer['alert']) ? '' : ' bordercolor="#cc0000"') . (empty($peer['disabled']) ? '' : ' bordercolor="#cccccc"') . '>
';
echo '
@@ -255,8 +244,7 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? $extra_sql
<td>' . \LibreNMS\Util\Time::formatInterval($peer['bgpPeerFsmEstablishedTime']) . "<br />
Updates <i class='fa fa-arrow-down icon-theme' aria-hidden='true'></i> " . $peer['bgpPeerInUpdates'] . "
<i class='fa fa-arrow-up icon-theme' aria-hidden='true'></i> " . $peer['bgpPeerOutUpdates'] . '</td>
</tr>
<tr height=5></tr>';
</tr>';
unset($invalid);
@@ -297,7 +285,7 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? $extra_sql
$graph_array['height'] = '100';
$graph_array['width'] = '216';
$graph_array['to'] = \LibreNMS\Config::get('time.now');
echo '<tr bgcolor="' . $bg_colour . '"><td colspan="7">';
echo '<tr class="bgp"><td colspan="7">';
include 'includes/html/print-graphrow.inc.php';

View File

@@ -37,16 +37,17 @@ if ($vars['view'] == 'graphs') {
print_optionbar_end();
echo '<div id="content">
<table border="0" cellspacing="0" cellpadding="5" width="100%">';
echo '<tr><th><a title="Physical hardware entity">Entity</a></th>
echo '<div class="panel panel-default">
<div class="panel-body">
<table class="table table-condensed table-hover" style="border-collapse:collapse;">
<thead><tr>
<th><a title="Physical hardware entity">Entity</a></th>
<th><a title="Address Family">AFI</a></th>
<th><a title="CEF Switching Path">Path</a></th>
<th><a title="Number of packets dropped.">Drop</a></th>
<th><a title="Number of packets that could not be switched in the normal path and were punted to the next-fastest switching vector.">Punt</a></th>
<th><a title="Number of packets that could not be switched in the normal path and were punted to the host.<br />For switch paths other than a centralized turbo switch path, punt and punt2host function the same way. With punt2host from a centralized turbo switch path (PAS and RSP), punt will punt the packet to LES, but punt2host will bypass LES and punt directly to process switching.">Punt2Host</a></th>
</tr>';
</tr></thead>';
$i = 0;
@@ -68,7 +69,7 @@ foreach (dbFetchRows('SELECT * FROM `cef_switching` WHERE `device_id` = ? ORDER
$entity_descr = $entity['entPhysicalName'] . ' (' . $entity['entPhysicalModelName'] . ')';
}
echo "<tr bgcolor=$bg_colour><td>" . $entity_descr . '</td>
echo '<tbody><tr><td>' . $entity_descr . '</td>
<td>' . $cef['afi'] . '</td>
<td>';
@@ -109,7 +110,7 @@ foreach (dbFetchRows('SELECT * FROM `cef_switching` WHERE `device_id` = ? ORDER
echo '</td>';
echo '</tr>
echo '</tr></tbody>
';
if ($vars['view'] == 'graphs') {
@@ -129,4 +130,4 @@ foreach (dbFetchRows('SELECT * FROM `cef_switching` WHERE `device_id` = ? ORDER
$i++;
}
echo '</table></div>';
echo '</table></div></div>';

View File

@@ -66,7 +66,21 @@ foreach ($graph_types as $type => $descr) {
print_optionbar_end();
echo "<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>";
echo '
<div>
<div class="panel panel-default">
<div class="panel-body">
<table class="table table-condensed table-hover" style="border-collapse:collapse;">
<thead>
<tr>
<th>&nbsp;</th>
<th>VRF</th>
<th>Description</th>
<th>RD</th>
<th>Interfaces</th>
</tr>
</thead>';
$i = '0';
foreach (dbFetchRows('SELECT * FROM `vrfs` WHERE `device_id` = ? ORDER BY `vrf_name`', [$device['device_id']]) as $vrf) {
include 'includes/html/print-vrf.inc.php';

View File

@@ -64,6 +64,20 @@ if (! Auth::user()->hasGlobalRead()) {
print_optionbar_end();
echo '
<div>
<div class="panel panel-default">
<div class="panel-body">
<table class="table table-condensed table-hover" style="border-collapse:collapse;">
<thead>
<tr>
<th>&nbsp;</th>
<th>VRF</th>
<th>RD</th>
<th>Interfaces</th>
</tr>
</thead>';
if ($vars['view'] == 'basic' || $vars['view'] == 'graphs') {
// Pre-Cache in arrays
// That's heavier on RAM, but much faster on CPU (1:40)
@@ -89,16 +103,10 @@ if (! Auth::user()->hasGlobalRead()) {
}
}
echo "<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>";
$i = '1';
echo '<tbody>';
foreach (dbFetchRows('SELECT `vrf_name`, `mplsVpnVrfRouteDistinguisher`, `mplsVpnVrfDescription` FROM `vrfs` GROUP BY `mplsVpnVrfRouteDistinguisher`, `mplsVpnVrfDescription`,`vrf_name`') as $vrf) {
if ($i % 2) {
$bg_colour = Config::get('list_colour.even');
} else {
$bg_colour = Config::get('list_colour.odd');
}
echo "<tr valign=top bgcolor='$bg_colour'>";
echo '<td></td>';
echo '<td width=240>';
echo '<a class=list-large href=' . \LibreNMS\Util\Url::generate($vars, ['view' => 'detail', 'vrf' => $vrf['vrf_name']]) . '>';
echo $vrf['vrf_name'] . '</a><br />';
@@ -121,7 +129,7 @@ if (! Auth::user()->hasGlobalRead()) {
}
}
echo "<tr bgcolor='$dev_colour'><td width=150><a href='";
echo "<tr bgcolor='$dev_colour'><td width=200><a href='";
echo \LibreNMS\Util\Url::generate(['page' => 'device'], ['device' => $device['device_id'], 'tab' => 'routing', 'view' => 'basic', 'proto' => 'vrf']);
echo "'>" . DeviceCache::get($device['device_id'])->displayName() . '</a> ';
@@ -162,11 +170,11 @@ if (! Auth::user()->hasGlobalRead()) {
}//end switch
}//end foreach
echo '</td></tr>';
echo '</td>';
$x++;
} //end foreach
echo '</table></td>';
echo '</tbody></table></td>';
$i++;
}//end foreach
echo '</table></div>';

View File

@@ -1,13 +1,8 @@
<?php
// fixme new url format
if (is_integer($i / 2)) {
$bg_colour = \LibreNMS\Config::get('list_colour.even');
} else {
$bg_colour = \LibreNMS\Config::get('list_colour.odd');
}
echo "<tr bgcolor='$bg_colour'>";
echo '<tbody><tr><td></td>';
echo "<td width=200 class=list-large><a href='routing/vrf/" . $vrf['mplsVpnVrfRouteDistinguisher'] . "/'>" . $vrf['vrf_name'] . '</a></td>';
echo '<td width=150 class=box-desc>' . $vrf['mplsVpnVrfDescription'] . '</td>';
@@ -35,4 +30,4 @@ foreach (dbFetchRows('SELECT * FROM ports WHERE `device_id` = ? AND `ifVrf` = ?'
}
echo '</td>';
echo '</tr>';
echo '</tr></tbody>';