Add vertical option for summary

This commit is contained in:
Paul Gear
2014-06-14 09:31:22 +10:00
parent 20ca66919b
commit 968a6ee9c4
3 changed files with 70 additions and 3 deletions

View File

@@ -0,0 +1,59 @@
<?php
include_once("includes/object-cache.inc.php");
?>
<div class="panel panel-default panel-condensed">
<table class="table table-hover table-condensed table-striped">
<thead>
<tr class="info">
<th>Summary</th>
<th><a href="devices/">Devices</a></th>
<th><a href="ports/">Ports</a></th>
<?php if ($config['show_services']) { ?>
<th><a href="services/">Services</a></th>
<?php } ?>
</tr>
</thead>
<tbody>
<tr class="active">
<th><span class="green">Up</span></th>
<td><a href="devices/format=list_detail/state=up/"><span class="green"><?php echo($devices['up']) ?></span></a></td>
<td><a href="ports/format=list_detail/state=up/"><span class="green"><?php echo($ports['up']) ?></span></a></td>
<?php if ($config['show_services']) { ?>
<td><a href="services/view=details/state=up/"><span class="green"><?php echo($services['up']) ?></span></a></td>
<?php } ?>
</tr>
<tr class="active">
<th><span class="red">Down</span></th>
<td><a href="devices/format=list_detail/state=down/"><span class="red"><?php echo($devices['down']) ?></span></a></td>
<td><a href="ports/format=list_detail/state=down/"><span class="red"><?php echo($ports['down']) ?></span></a></td>
<?php if ($config['show_services']) { ?>
<td><a href="services/view=details/state=down/"><span class="red"><?php echo($services['down']) ?></span></a></td>
<?php } ?>
</tr>
<tr class="active">
<th><span class="grey">Ignored</span></th>
<td><a href="devices/format=list_detail/ignore=1/"><span class="grey"><?php echo($devices['ignored']) ?></span></a></td>
<td><a href="ports/format=list_detail/ignore=1/"><span class="grey"><?php echo($ports['ignored']) ?></span></a></td>
<?php if ($config['show_services']) { ?>
<td><a href="services/view=details/ignore=1/"><span class="grey"><?php echo($services['ignored']) ?></span></a></td>
<?php } ?>
</tr>
<tr class="active">
<th><span class="black">Disabled/Shutdown</span></th>
<td><a href="devices/format=list_detail/disabled=1/"><span class="black"><?php echo($devices['disabled']) ?></span></a></td>
<td><a href="ports/format=list_detail/state=admindown/"><span class="black"><?php echo($ports['shutdown']) ?></span></a></td>
<?php if ($config['show_services']) { ?>
<td><a href="services/view=details/disabled=1/"><span class="black"><?php echo($services['disabled']) ?></span></a></td>
<?php } ?>
</tr>
<tr class="active">
<th>Total</th>
<td><a href="devices/"><span><?php echo($devices['count']) ?></span></a></td>
<td><a href="ports/"><span><?php echo($ports['count']) ?></span></a></td>
<?php if ($config['show_services']) { ?>
<td><a href="services/"><span><?php echo($services['count']) ?></span></a></td>
<?php } ?>
</tr>
</tbody>
</table>
</div>

View File

@@ -11,7 +11,7 @@ echo("<div class=\"front-box $frontbox_class\">
echo('
<div class="row">
<div class="col-md-8">
<div class="col-md-9">
');
echo('<div class=front-page>');
@@ -121,10 +121,17 @@ echo('</div>');
echo('</div>');
echo('</div>');
echo('
<div class="col-md-4">
<div class="col-md-3">
');
include_once("includes/device-summary-horiz.inc.php");
if ($config['vertical_summary'])
{
include_once("includes/device-summary-vert.inc.php");
}
else
{
include_once("includes/device-summary-horiz.inc.php");
}
echo('
</div>

View File

@@ -110,6 +110,7 @@ $config['page_refresh'] = "300"; // Refresh the page every xx seconds, 0 to
$config['front_page'] = "pages/front/default.php";
$config['front_page_settings']['top']['ports'] = 10;
$config['front_page_settings']['top']['devices'] = 10;
$config['vertical_summary'] = 0; // Enable to use vertical summary on front page instead of horizontal
$config['top_ports'] = 1; // This enables the top X ports box
$config['top_devices'] = 1; // This enables the top X devices box
$config['page_title_prefix'] = "";