mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Refreshed visually the Device overview page
This commit is contained in:
@@ -1,40 +1,42 @@
|
||||
<?php
|
||||
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo('<div class="container-fluid">');
|
||||
echo("<div class='row'>
|
||||
<div class='col-md-12'>
|
||||
<div class='panel panel-default panel-condensed'>
|
||||
<div class='panel-heading'>");
|
||||
|
||||
if ($config['overview_show_sysDescr'])
|
||||
{
|
||||
echo("<p style='padding: 0px;' class=sectionhead>");
|
||||
echo('<div style="font-family: courier, serif; margin: 3px"><strong>' . $device['sysDescr'] . "</strong></div>");
|
||||
echo("</p>");
|
||||
echo('<strong>' . $device['sysDescr'] . "</strong>");
|
||||
}
|
||||
|
||||
echo('</div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
|
||||
$uptime = $device['uptime'];
|
||||
|
||||
if ($device['os'] == "ios") { formatCiscoHardware($device); }
|
||||
if ($device['features']) { $device['features'] = "(".$device['features'].")"; }
|
||||
$device['os_text'] = $config['os'][$device['os']]['text'];
|
||||
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
echo('<tr class="device-overview"><td width="100%"><table width="100%">');
|
||||
|
||||
if ($device['hardware'])
|
||||
{
|
||||
echo('<tr>
|
||||
<td class="list-bold">Hardware</td>
|
||||
<td>Hardware</td>
|
||||
<td>' . $device['hardware']. '</td>
|
||||
</tr>');
|
||||
}
|
||||
|
||||
echo('<tr>
|
||||
<td class="list-bold">Operating System</td>
|
||||
<td>Operating System</td>
|
||||
<td>' . $device['os_text'] . ' ' . $device['version'] . ' ' . $device['features'] . ' </td>
|
||||
</tr>');
|
||||
|
||||
if ($device['serial'])
|
||||
{
|
||||
echo('<tr>
|
||||
<td class="list-bold">Serial</td>
|
||||
<td>Serial</td>
|
||||
<td>' . $device['serial']. '</td>
|
||||
</tr>');
|
||||
}
|
||||
@@ -42,14 +44,14 @@ if ($device['serial'])
|
||||
if ($device['sysContact'])
|
||||
{
|
||||
echo('<tr>
|
||||
<td class="list-bold">Contact</td>');
|
||||
<td>Contact</td>');
|
||||
if (get_dev_attrib($device,'override_sysContact_bool'))
|
||||
{
|
||||
echo('
|
||||
<td>' . htmlspecialchars(get_dev_attrib($device,'override_sysContact_string')) . '</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="list-bold">SNMP Contact</td>');
|
||||
<td>SNMP Contact</td>');
|
||||
}
|
||||
echo('
|
||||
<td>' . htmlspecialchars($device['sysContact']). '</td>
|
||||
@@ -59,13 +61,13 @@ if ($device['sysContact'])
|
||||
if ($device['location'])
|
||||
{
|
||||
echo('<tr>
|
||||
<td class="list-bold">Location</td>
|
||||
<td>Location</td>
|
||||
<td>' . $device['location']. '</td>
|
||||
</tr>');
|
||||
if (get_dev_attrib($device,'override_sysLocation_bool') && !empty($device['real_location']))
|
||||
{
|
||||
echo('<tr>
|
||||
<td class="list-bold">SNMP Location</td>
|
||||
<td>SNMP Location</td>
|
||||
<td>' . $device['real_location']. '</td>
|
||||
</tr>');
|
||||
}
|
||||
@@ -74,12 +76,14 @@ if ($device['location'])
|
||||
if ($uptime)
|
||||
{
|
||||
echo('<tr>
|
||||
<td class="list-bold">Uptime</td>
|
||||
<td>Uptime</td>
|
||||
<td>' . formatUptime($uptime) . '</td>
|
||||
</tr>');
|
||||
}
|
||||
|
||||
echo("</table></tr></td></table>");
|
||||
echo("</div>");
|
||||
|
||||
echo('</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>');
|
||||
?>
|
||||
|
@@ -58,7 +58,7 @@ foreach ($graphs as $entry)
|
||||
{
|
||||
$graph_array['type'] = $entry['graph'];
|
||||
|
||||
echo("<div style='float: right; text-align: center; padding: 1px 5px; margin: 0 1px; background: #f5f5f5;' class='rounded-5px'>");
|
||||
echo("<div style='float: right; text-align: center; padding: 1px 5px; margin: 0 1px; ' class='rounded-5px'>");
|
||||
print_graph_popup($graph_array);
|
||||
echo("<div style='font-weight: bold; font-size: 7pt; margin: -3px;'>".$entry['text']."</div>");
|
||||
echo("</div>");
|
||||
|
@@ -7,12 +7,12 @@ unset($icon);
|
||||
$icon = geteventicon($entry['message']);
|
||||
if ($icon) { $icon = "<img src='images/16/$icon'>"; }
|
||||
|
||||
echo("<tr style=\"background-color: $bg\">
|
||||
<td width=0></td>
|
||||
<td class=syslog width=140>
|
||||
echo("<tr\">
|
||||
<td></td>
|
||||
<td>
|
||||
".$entry['humandate']."
|
||||
</td>
|
||||
<td class=syslog>");
|
||||
<td>");
|
||||
|
||||
if ($entry['type'] == "interface") {
|
||||
$entry['link'] = "<b>".generate_port_link(getifbyid($entry['reference']))."</b>";
|
||||
@@ -23,4 +23,4 @@ echo("<tr style=\"background-color: $bg\">
|
||||
<td></td>
|
||||
</tr>");
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
if (device_permitted($entry['device_id']))
|
||||
{
|
||||
echo("<tr class=\"syslog\">");
|
||||
echo("<tr>");
|
||||
|
||||
// Stop shortening hostname. Issue #61
|
||||
//$entry['hostname'] = shorthost($entry['hostname'], 20);
|
||||
|
||||
if ($vars['page'] != "device")
|
||||
{
|
||||
echo("<td class=syslog width=140>" . $entry['date'] . "</td>");
|
||||
echo("<td width=160><strong>".generate_device_link($entry)."</strong></td>");
|
||||
echo("<td class=syslog><strong>" . $entry['program'] . " : </strong> " . htmlspecialchars($entry['msg']) . "</td>");
|
||||
echo("<td>" . $entry['date'] . "</td>");
|
||||
echo("<td><strong>".generate_device_link($entry)."</strong></td>");
|
||||
echo("<td><strong>" . $entry['program'] . " : </strong> " . htmlspecialchars($entry['msg']) . "</td>");
|
||||
} else {
|
||||
echo("<td class=syslog><i>" . $entry['date'] . "</i> <strong>" . $entry['program'] . "</strong> " . htmlspecialchars($entry['msg']) . "</td>");
|
||||
echo("<td><i>" . $entry['date'] . "</i> <strong>" . $entry['program'] . "</strong> " . htmlspecialchars($entry['msg']) . "</td>");
|
||||
}
|
||||
|
||||
echo("</tr>");
|
||||
|
@@ -18,7 +18,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
$tab = "overview";
|
||||
}
|
||||
|
||||
$select[$tab] = "selected";
|
||||
$select[$tab] = "active";
|
||||
|
||||
$device = device_by_id_cache($vars['device']);
|
||||
$attribs = get_dev_attribs($device['device_id']);
|
||||
@@ -37,11 +37,10 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
|
||||
echo('</table>');
|
||||
|
||||
echo('<div class="tabBox">');
|
||||
|
||||
if (device_permitted($device['device_id']))
|
||||
{
|
||||
echo('<ul class="tabs">');
|
||||
echo('<ul class="nav nav-tabs">');
|
||||
|
||||
if ($config['show_overview_tab'])
|
||||
{
|
||||
|
@@ -15,67 +15,22 @@ $services['disabled'] = dbFetchCell("SELECT COUNT(service_id) FROM `services` WH
|
||||
if ($services['down']) { $services_colour = $warn_colour_a; } else { $services_colour = $list_colour_a; }
|
||||
if ($ports['down']) { $ports_colour = $warn_colour_a; } else { $ports_colour = $list_colour_a; }
|
||||
|
||||
echo("<table width=100% cellspacing=0 cellpadding=0><tr><td style='width: 50%; vertical-align: top;>");
|
||||
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
|
||||
echo('
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
');
|
||||
include("includes/dev-overview-data.inc.php");
|
||||
|
||||
echo("</div>");
|
||||
|
||||
include("overview/ports.inc.php");
|
||||
|
||||
#include("overview/current.inc.php");
|
||||
|
||||
if ($services['total'])
|
||||
{
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead><img align='absmiddle' src='images/16/cog.png'> Services</p><div style='height: 5px;'></div>");
|
||||
|
||||
echo("
|
||||
<table class=tablehead cellpadding=2 cellspacing=0 width=100%>
|
||||
<tr bgcolor=$services_colour align=center><td></td>
|
||||
<td width=25%><img src='images/16/cog.png' align=absmiddle> $services[total]</td>
|
||||
<td width=25% class=green><img src='images/16/cog_go.png' align=absmiddle> $services[up]</td>
|
||||
<td width=25% class=red><img src='images/16/cog_error.png' align=absmiddle> $services[down]</td>
|
||||
<td width=25% class=grey><img src='images/16/cog_disable.png' align=absmiddle> $services[disabled]</td></tr>
|
||||
</table>");
|
||||
|
||||
echo("<div style='padding: 8px; font-size: 11px; font-weight: bold;'>");
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM services WHERE device_id = ? ORDER BY service_type", array($device['device_id'])) as $data)
|
||||
{
|
||||
if ($data['service_status'] == "0" && $data['service_ignore'] == "1") { $status = "grey"; }
|
||||
if ($data['service_status'] == "1" && $data['service_ignore'] == "1") { $status = "green"; }
|
||||
if ($data['service_status'] == "0" && $data['service_ignore'] == "0") { $status = "red"; }
|
||||
if ($data['service_status'] == "1" && $data['service_ignore'] == "0") { $status = "blue"; }
|
||||
echo("$break<a class=$status>" . strtolower($data['service_type']) . "</a>");
|
||||
$break = ", ";
|
||||
}
|
||||
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
// FIXME - split this into overview/syslog.inc.php?
|
||||
if ($config['enable_syslog'])
|
||||
{
|
||||
$syslog = dbFetchRows("SELECT *, DATE_FORMAT(timestamp, '%Y-%m-%d %T') AS date from syslog WHERE device_id = ? ORDER BY timestamp DESC LIMIT 20", array($device['device_id']));
|
||||
if (count($syslog))
|
||||
{
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo('<p style="padding: 0px 5px 5px;" class="sectionhead"><a class="sectionhead" href="device/device=' . $device['device_id'] . '/tab=logs/section=syslog/"><img align="absmiddle" src="images/16/printer.png" /> Recent Syslog</a></p>');
|
||||
echo("<table cellspacing=0 cellpadding=2 width=100%>");
|
||||
foreach ($syslog as $entry) { include("includes/print-syslog.inc.php"); }
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
}
|
||||
}
|
||||
|
||||
echo("</td>");
|
||||
|
||||
echo("<td style='width: 50%; vertical-align: top;'>");
|
||||
|
||||
echo('
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
');
|
||||
// Right Pane
|
||||
include("overview/processors.inc.php");
|
||||
include("overview/mempools.inc.php");
|
||||
@@ -92,23 +47,12 @@ include("overview/sensors/voltages.inc.php");
|
||||
include("overview/sensors/current.inc.php");
|
||||
include("overview/sensors/power.inc.php");
|
||||
include("overview/sensors/frequencies.inc.php");
|
||||
include("overview/eventlog.inc.php");
|
||||
include("overview/services.inc.php");
|
||||
include("overview/syslog.inc.php");
|
||||
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead>");
|
||||
echo('<a class="sectionhead" href="device/device='.$device['device_id'].'/tab=logs/section=eventlog/">');
|
||||
echo("<img align='absmiddle' src='images/16/report.png'> Recent Events</a></p>");
|
||||
echo('</div></div></div>');
|
||||
|
||||
echo("<table cellspacing=0 cellpadding=2 width=100%>");
|
||||
|
||||
$eventlog = dbFetchRows("SELECT *,DATE_FORMAT(datetime, '%d/%b/%y %T') as humandate FROM `eventlog` WHERE `host` = ? ORDER BY `datetime` DESC LIMIT 0,10", array($device['device_id']));
|
||||
foreach ($eventlog as $entry)
|
||||
{
|
||||
include("includes/print-event-short.inc.php");
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
|
||||
echo("</td></tr></table>");
|
||||
#include("overview/current.inc.php");
|
||||
|
||||
?>
|
||||
|
@@ -1,19 +1,23 @@
|
||||
<?php
|
||||
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead>");
|
||||
echo('<a class="sectionhead" href="device/device='.$device['device_id'].'/tab=health/metric=mempool/">');
|
||||
echo("<img align='absmiddle' src='images/16/arrow_switch.png'> Catalyst 6k Crossbar</a></p>");
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
echo('<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">');
|
||||
echo('<a href="device/device='.$device['device_id'].'/tab=health/metric=mempool/">');
|
||||
echo("<img src='images/16/arrow_switch.png'> Catalyst 6k Crossbar</a>");
|
||||
echo(' </div>
|
||||
<table class="table table-hover table-condensed table-striped">
|
||||
|
||||
foreach ($entity_state['group']['c6kxbar'] as $index => $entry)
|
||||
{
|
||||
// FIXME i'm not sure if this is the correct way to decide what entphysical index it is. slotnum+1? :>
|
||||
$entity = dbFetchRow("SELECT * FROM entPhysical WHERE device_id = ? AND entPhysicalIndex = ?", array($device['device_id'], $index+1));
|
||||
|
||||
echo("<tr bgcolor=$row_colour>
|
||||
<td colspan=5 width=200><strong>".$entity['entPhysicalName']."</strong></td>
|
||||
<td colspan=2>");
|
||||
echo("<tr>
|
||||
<td colspan='5'><strong>".$entity['entPhysicalName']."</strong></td>
|
||||
<td colspan='2'>");
|
||||
|
||||
switch ($entry['']['cc6kxbarModuleModeSwitchingMode'])
|
||||
{
|
||||
@@ -74,9 +78,9 @@ foreach ($entity_state['group']['c6kxbar'] as $index => $entry)
|
||||
|
||||
$minigraph = generate_graph_tag($graph_array);
|
||||
|
||||
echo("<tr class=device-overview>
|
||||
<td width=10></td>
|
||||
<td width=200><strong>Fabric ".$subindex."</strong></td>
|
||||
echo("<tr>
|
||||
<td></td>
|
||||
<td><strong>Fabric ".$subindex."</strong></td>
|
||||
<td><span style='font-weight: bold;' class=".$fabric['mode_class'].">".
|
||||
|
||||
$fabric['cc6kxbarModuleChannelFabStatus']."</span></td>
|
||||
@@ -91,5 +95,8 @@ foreach ($entity_state['group']['c6kxbar'] as $index => $entry)
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
|
||||
?>
|
||||
|
25
html/pages/device/overview/eventlog.inc.php
Normal file
25
html/pages/device/overview/eventlog.inc.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
echo('<div class="container-fluid">');
|
||||
echo('<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">');
|
||||
echo('<a href="device/device='.$device['device_id'].'/tab=logs/section=eventlog/">');
|
||||
echo("<img src='images/16/report.png'> Recent Events</a>");
|
||||
echo(' </div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
|
||||
$eventlog = dbFetchRows("SELECT *,DATE_FORMAT(datetime, '%d/%b/%y %T') as humandate FROM `eventlog` WHERE `host` = ? ORDER BY `datetime` DESC LIMIT 0,10", array($device['device_id']));
|
||||
foreach ($eventlog as $entry)
|
||||
{
|
||||
include("includes/print-event-short.inc.php");
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo('</div>');
|
||||
echo('</div>');
|
||||
echo('</div>');
|
||||
echo('</div>');
|
||||
|
||||
?>
|
@@ -4,9 +4,13 @@ $sensors = dbFetchRows("SELECT * FROM `sensors` WHERE `sensor_class` = ? AND dev
|
||||
|
||||
if (count($sensors))
|
||||
{
|
||||
echo('<div style="background-color: #eeeeee; margin: 5px; padding: 5px;">');
|
||||
echo('<p style="padding: 0px 5px 5px;" class="sectionhead"><a class="sectionhead" href="device/device='.$device['device_id'].'/tab=health/metric=' . strtolower($sensor_type) . '/"><img align="absmiddle" src="images/icons/' . strtolower($sensor_type) . '.png"> ' . $sensor_type . '</a></p>');
|
||||
echo('<table width="100%" valign="top">');
|
||||
echo('<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">');
|
||||
echo('<a class="sectionhead" href="device/device='.$device['device_id'].'/tab=health/metric=' . strtolower($sensor_type) . '/"><img src="images/icons/' . strtolower($sensor_type) . '.png"> ' . $sensor_type . '</a><');
|
||||
echo(' </div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
foreach ($sensors as $sensor)
|
||||
{
|
||||
if ($config['memcached']['enable'])
|
||||
@@ -53,15 +57,18 @@ if (count($sensors))
|
||||
|
||||
$sensor['sensor_descr'] = truncate($sensor['sensor_descr'], 48, '');
|
||||
|
||||
echo("<tr class=device-overview>
|
||||
<td class=tablehead style='padding-left:5px;'><strong>".overlib_link($link, $sensor['sensor_descr'], $overlib_content)."</strong></td>
|
||||
<td width=80 align=right class=tablehead>".overlib_link($link, $sensor_minigraph, $overlib_content)."</td>
|
||||
<td width=80 align=right class=tablehead>".overlib_link($link, "<span " . ($sensor['sensor_current'] < $sensor['sensor_limit_low'] || $sensor['sensor_current'] > $sensor['sensor_limit'] ? "style='color: red'" : '') . '>' . $sensor['sensor_current'] . $sensor_unit . "</span>", $overlib_content)."</td>
|
||||
echo("<tr>
|
||||
<td><strong>".overlib_link($link, $sensor['sensor_descr'], $overlib_content)."</strong></td>
|
||||
<td>".overlib_link($link, $sensor_minigraph, $overlib_content)."</td>
|
||||
<td>".overlib_link($link, "<span " . ($sensor['sensor_current'] < $sensor['sensor_limit_low'] || $sensor['sensor_current'] > $sensor['sensor_limit'] ? "style='color: red'" : '') . '>' . $sensor['sensor_current'] . $sensor_unit . "</span>", $overlib_content)."</td>
|
||||
</tr>");
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -6,11 +6,18 @@ $mempools = dbFetchRows("SELECT * FROM `mempools` WHERE device_id = ?", array($d
|
||||
|
||||
if (count($mempools))
|
||||
{
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead>");
|
||||
echo('<a class="sectionhead" href="device/device='.$device['device_id'].'/tab=health/metric=mempool/">');
|
||||
echo("<img align='absmiddle' src='images/icons/memory.png'> Memory Pools</a></p>");
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
echo('<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">
|
||||
');
|
||||
echo('<a href="device/device='.$device['device_id'].'/tab=health/metric=mempool/">');
|
||||
echo("<img src='images/icons/memory.png'> Memory Pools</a>");
|
||||
echo('
|
||||
</div>
|
||||
<table class="table table-hover table-condensed table-striped">
|
||||
');
|
||||
|
||||
foreach ($mempools as $mempool)
|
||||
{
|
||||
@@ -50,16 +57,20 @@ if (count($mempools))
|
||||
|
||||
$minigraph = generate_graph_tag($graph_array);
|
||||
|
||||
echo("<tr class=device-overview>
|
||||
<td class=tablehead>".overlib_link($link, $text_descr, $overlib_content)."</td>
|
||||
<td width=90>".overlib_link($link, $minigraph, $overlib_content)."</td>
|
||||
<td width=200>".overlib_link($link, print_percentage_bar (200, 20, $percent, NULL, "ffffff", $background['left'], $percent . "%", "ffffff", $background['right']), $overlib_content)."
|
||||
echo("<tr>
|
||||
<td>".overlib_link($link, $text_descr, $overlib_content)."</td>
|
||||
<td>".overlib_link($link, $minigraph, $overlib_content)."</td>
|
||||
<td>".overlib_link($link, print_percentage_bar (200, 20, $percent, NULL, "ffffff", $background['left'], $percent . "%", "ffffff", $background['right']), $overlib_content)."
|
||||
</a></td>
|
||||
</tr>");
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
echo('</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>');
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -2,7 +2,14 @@
|
||||
|
||||
if ($ports['total'])
|
||||
{
|
||||
echo('<div style="background-color: #eeeeee; margin: 5px; padding: 5px;">');
|
||||
echo('<div class="container-fluid">');
|
||||
echo('<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">
|
||||
<strong>Overall Traffic</strong>
|
||||
</div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "485";
|
||||
@@ -21,20 +28,22 @@ if ($ports['total'])
|
||||
$graph_array['width'] = "210";
|
||||
$overlib_content = generate_overlib_content($graph_array, $device['hostname'] . " - Device Traffic");
|
||||
|
||||
echo('<tr>
|
||||
<td colspan="4">');
|
||||
echo(overlib_link($link, $graph, $overlib_content, NULL));
|
||||
echo(' </td>
|
||||
</tr>');
|
||||
|
||||
echo(' <div style="height: 5px;"></div>');
|
||||
echo('
|
||||
<tr>
|
||||
<td><img src="images/16/connect.png" align="absmiddle"> ' . $ports['total'] . '</td>
|
||||
<td><img src="images/16/if-connect.png" align="absmiddle"> ' . $ports['up'] . '</td>
|
||||
<td><img src="images/16/if-disconnect.png" align="absmiddle"> ' . $ports['down'] . '</td>
|
||||
<td><img src="images/16/if-disable.png" align="absmiddle"> ' . $ports['disabled'] . '</td>
|
||||
</tr>');
|
||||
|
||||
echo(' <table class="tablehead" cellpadding="2" cellspacing="0" width="100%">
|
||||
<tr bgcolor="' . $ports_colour . '" align="center"><td></td>
|
||||
<td width="25%"><img src="images/16/connect.png" align="absmiddle"> ' . $ports['total'] . '</td>
|
||||
<td width="25%" class="green"><img src="images/16/if-connect.png" align="absmiddle"> ' . $ports['up'] . '</td>
|
||||
<td width="25%" class="red"><img src="images/16/if-disconnect.png" align="absmiddle"> ' . $ports['down'] . '</td>
|
||||
<td width="25%" class="grey"><img src="images/16/if-disable.png" align="absmiddle"> ' . $ports['disabled'] . '</td>
|
||||
</tr>
|
||||
</table>');
|
||||
|
||||
echo(' <div style="margin: 8px; font-size: 11px; font-weight: bold;">');
|
||||
echo('<tr>
|
||||
<td colspan="4">');
|
||||
|
||||
$ifsep = "";
|
||||
|
||||
@@ -47,7 +56,12 @@ if ($ports['total'])
|
||||
}
|
||||
|
||||
unset($ifsep);
|
||||
echo(" </div>");
|
||||
echo(" </td>");
|
||||
echo("</tr>");
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
|
@@ -6,11 +6,16 @@ $processors = dbFetchRows("SELECT * FROM `processors` WHERE device_id = ?", arra
|
||||
|
||||
if (count($processors))
|
||||
{
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead>");
|
||||
echo('<a class="sectionhead" href="device/device='.$device['device_id'].'/tab=health/metric=processor/">');
|
||||
echo("<img align='absmiddle' src='images/icons/processor.png'> Processors</a></p>");
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
echo('<div class="container-fluid ">
|
||||
<div class="row">
|
||||
<div class="col-md-12 ">
|
||||
<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">
|
||||
');
|
||||
echo('<a href="device/device='.$device['device_id'].'/tab=health/metric=processor/">');
|
||||
echo("<img src='images/icons/processor.png'> <strong>Processors</strong></a>");
|
||||
echo('</div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
|
||||
foreach ($processors as $proc)
|
||||
{
|
||||
@@ -42,16 +47,20 @@ if (count($processors))
|
||||
|
||||
$minigraph = generate_graph_tag($graph_array);
|
||||
|
||||
echo("<tr class=device-overview>
|
||||
<td class=tablehead>".overlib_link($link, $text_descr, $overlib_content)."</td>
|
||||
<td width=90>".overlib_link($link, $minigraph, $overlib_content)."</td>
|
||||
<td width=200>".overlib_link($link, print_percentage_bar (200, 20, $percent, NULL, "ffffff", $background['left'], $percent . "%", "ffffff", $background['right']), $overlib_content)."
|
||||
echo("<tr>
|
||||
<td>".overlib_link($link, $text_descr, $overlib_content)."</td>
|
||||
<td>".overlib_link($link, $minigraph, $overlib_content)."</td>
|
||||
<td>".overlib_link($link, print_percentage_bar (200, 20, $percent, NULL, "ffffff", $background['left'], $percent . "%", "ffffff", $background['right']), $overlib_content)."
|
||||
</a></td>
|
||||
</tr>");
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
echo('</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>');
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
40
html/pages/device/overview/services.inc.php
Normal file
40
html/pages/device/overview/services.inc.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
if ($services['total'])
|
||||
{
|
||||
echo('<div class="container-fluid">');
|
||||
echo('<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">');
|
||||
echo("<img src='images/16/cog.png'><strong> Services</strong>");
|
||||
echo(' </div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
|
||||
echo("
|
||||
<tr>
|
||||
<td><img src='images/16/cog.png'> $services[total]</td>
|
||||
<td><img src='images/16/cog_go.png'> $services[up]</td>
|
||||
<td><img src='images/16/cog_error.png'> $services[down]</td>
|
||||
<td><img src='images/16/cog_disable.png'> $services[disabled]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='4'>");
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM services WHERE device_id = ? ORDER BY service_type", array($device['device_id'])) as $data)
|
||||
{
|
||||
if ($data['service_status'] == "0" && $data['service_ignore'] == "1") { $status = "grey"; }
|
||||
if ($data['service_status'] == "1" && $data['service_ignore'] == "1") { $status = "green"; }
|
||||
if ($data['service_status'] == "0" && $data['service_ignore'] == "0") { $status = "red"; }
|
||||
if ($data['service_status'] == "1" && $data['service_ignore'] == "0") { $status = "blue"; }
|
||||
echo("$break<a class=$status>" . strtolower($data['service_type']) . "</a>");
|
||||
$break = ", ";
|
||||
}
|
||||
echo('</td></tr></table>');
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
?>
|
@@ -6,11 +6,15 @@ $drives = dbFetchRows("SELECT * FROM `storage` WHERE device_id = ? ORDER BY `sto
|
||||
|
||||
if (count($drives))
|
||||
{
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead>");
|
||||
echo('<a class="sectionhead" href="device/device='.$device['device_id'].'/tab=health/metric=storage/">');
|
||||
echo("<img align='absmiddle' src='images/icons/storage.png'> Storage</a></p>");
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
echo('<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">');
|
||||
echo('<a href="device/device='.$device['device_id'].'/tab=health/metric=storage/">');
|
||||
echo("<img src='images/icons/storage.png'> Storage</a>");
|
||||
echo(' </div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
|
||||
foreach ($drives as $drive)
|
||||
{
|
||||
@@ -66,16 +70,20 @@ if (count($drives))
|
||||
|
||||
$minigraph = generate_graph_tag($graph_array);
|
||||
|
||||
echo("<tr class=device-overview>
|
||||
<td class=tablehead>".overlib_link($link, $drive['storage_descr'], $overlib_content)."</td>
|
||||
<td width=90>".overlib_link($link, $minigraph, $overlib_content)."</td>
|
||||
<td width=200>".overlib_link($link, print_percentage_bar (200, 20, $percent, NULL, "ffffff", $background['left'], $percent . "%", "ffffff", $background['right']), $overlib_content)."
|
||||
echo("<tr>
|
||||
<td>".overlib_link($link, $drive['storage_descr'], $overlib_content)."</td>
|
||||
<td>".overlib_link($link, $minigraph, $overlib_content)."</td>
|
||||
<td>".overlib_link($link, print_percentage_bar (200, 20, $percent, NULL, "ffffff", $background['left'], $percent . "%", "ffffff", $background['right']), $overlib_content)."
|
||||
</a></td>
|
||||
</tr>");
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
echo('</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>');
|
||||
|
||||
}
|
||||
|
||||
unset ($drive_rows);
|
||||
|
25
html/pages/device/overview/syslog.inc.php
Normal file
25
html/pages/device/overview/syslog.inc.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
if ($config['enable_syslog'])
|
||||
{
|
||||
$syslog = dbFetchRows("SELECT *, DATE_FORMAT(timestamp, '%Y-%m-%d %T') AS date from syslog WHERE device_id = ? ORDER BY timestamp DESC LIMIT 20", array($device['device_id']));
|
||||
if (count($syslog))
|
||||
{
|
||||
echo('<div class="container-fluid">');
|
||||
echo('<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">');
|
||||
echo('<a href="device/device=' . $device['device_id'] . '/tab=logs/section=syslog/"><img src="images/16/printer.png" /> Recent Syslog</a>');
|
||||
echo(' </div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
foreach ($syslog as $entry) { include("includes/print-syslog.inc.php"); }
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -6,11 +6,14 @@ $toners = dbFetchRows("SELECT * FROM `toner` WHERE device_id = ?", array($device
|
||||
|
||||
if (count($toners))
|
||||
{
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead>");
|
||||
echo('<a class="sectionhead" href="device/device='.$device['device_id'].'/tab=toner/">');
|
||||
echo("<img align='absmiddle' src='images/icons/toner.png'> Toner</a></p>");
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
echo('<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">');
|
||||
echo('<a href="device/device='.$device['device_id'].'/tab=toner/">');
|
||||
echo("<img src='images/icons/toner.png'> Toner</a>");
|
||||
echo('</div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
|
||||
foreach ($toners as $toner)
|
||||
{
|
||||
@@ -41,16 +44,19 @@ if (count($toners))
|
||||
|
||||
$minigraph = generate_graph_tag($graph_array);
|
||||
|
||||
echo("<tr class=device-overview>
|
||||
<td class=tablehead>".overlib_link($link, $toner['toner_descr'], $overlib_content)."</td>
|
||||
<td width=90>".overlib_link($link, $minigraph, $overlib_content)."</td>
|
||||
<td width=200>".overlib_link($link, print_percentage_bar (200, 20, $percent, NULL, "ffffff", $background['left'], $percent . "%", "ffffff", $background['right']), $overlib_content)."
|
||||
echo("<tr>
|
||||
<td>".overlib_link($link, $toner['toner_descr'], $overlib_content)."</td>
|
||||
<td>".overlib_link($link, $minigraph, $overlib_content)."</td>
|
||||
<td>".overlib_link($link, print_percentage_bar (200, 20, $percent, NULL, "ffffff", $background['left'], $percent . "%", "ffffff", $background['right']), $overlib_content)."
|
||||
</a></td>
|
||||
</tr>");
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
unset ($toner_rows);
|
||||
|
Reference in New Issue
Block a user