Start at fixing up front page and moving top 10 into plugins

This commit is contained in:
Paul Gear
2014-06-14 07:55:17 +10:00
parent 1c8be6e9c0
commit 2b047f62b6
5 changed files with 49 additions and 122 deletions

View File

@ -1,5 +1,7 @@
<?php <?php
include_once("includes/object-cache.inc.php");
if ($device['status'] == '0') { $class = "alert-danger"; } else { $class = ""; } if ($device['status'] == '0') { $class = "alert-danger"; } else { $class = ""; }
if ($device['ignore'] == '1') if ($device['ignore'] == '1')
{ {

View File

@ -0,0 +1,45 @@
<?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>&nbsp;</th>
<th>Total</th>
<th>Up</th>
<th>Down</th>
<th>Ignored</th>
<th>Disabled</th>
</tr>
</thead>
<tbody>
<tr class="active">
<td><a href="devices/">Devices</a></td>
<td><a href="devices/"><span><?php echo($devices['count']) ?></span></a></td>
<td><a href="devices/state=up/format=list_detail/"><span class="green"> <?php echo($devices['up']) ?> up</span></a></td>
<td><a href="devices/state=down/format=list_detail/"><span class="red"> <?php echo($devices['down']) ?> down</span></a></td>
<td><a href="devices/ignore=1/format=list_detail/"><span class="grey"> <?php echo($devices['ignored']) ?> ignored </span></a></td>
<td><a href="devices/disabled=1/format=list_detail/"><span class="black"> <?php echo($devices['disabled']) ?> disabled</span></a></td>
</tr>
<tr class="active">
<td><a href="ports/">Ports</a></td>
<td><a href="ports/"><span><?php echo($ports['count']) ?></span></a></td>
<td><a href="ports/format=list_detail/state=up/"><span class="green"> <?php echo($ports['up']) ?> up </span></a></td>
<td><a href="ports/format=list_detail/state=down/"><span class="red"> <?php echo($ports['down']) ?> down </span></a></td>
<td><a href="ports/format=list_detail/ignore=1/"><span class="grey"> <?php echo($ports['ignored']) ?> ignored </span></a></td>
<td><a href="ports/format=list_detail/state=admindown/"><span class="black"> <?php echo($ports['shutdown']) ?> shutdown</span></a></td>
</tr>
<?php if ($config['show_services']) { ?>
<tr class="active">
<td><a href="services/">Services</a></td>
<td><a href="services/"><span><?php echo($services['count']) ?></span></a></td>
<td><a href="services/state=up/view=details/"><span class="green"><?php echo($services['up']) ?> up</span></a></td>
<td><a href="services/state=down/view=details/"><span class="red"> <?php echo($services['down']) ?> down</span></a></td>
<td><a href="services/ignore=1/view=details/"><span class="grey"> <?php echo($services['ignored']) ?> ignored</span></a></td>
<td><a href="services/disabled=1/view=details/"><span class="black"> <?php echo($services['disabled']) ?> disabled</span></a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>

View File

@ -1,69 +0,0 @@
<div id="gumax-header">
<div id="gumax-p-logo">
<div id="p-logo">
<?php
if ($config['title_image'])
{
echo('<a style="background-image: ' . $config['title_image'] . '" accesskey="z" href=""></a>');
}
else
{
echo('<a href=""><h2>'.$config['project_name'].'</h2></a>');
}
?>
</div>
<script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
</div>
<!-- end of gumax-p-logo -->
<!-- Login Tools -->
<div id="gumax-p-login">
<?php
echo('<a target="_blank" href="'.$config['project_issues'].'">Report Bug</a> | ');
$toggle_url = preg_replace('/(\?|\&)widescreen=(yes|no)/', '', $_SERVER['REQUEST_URI']);
if (strstr($toggle_url,'?')) { $toggle_url .= '&amp;'; } else { $toggle_url .= '?'; }
if($_SESSION['widescreen'] === 1)
{
echo('<a href="' . $toggle_url . 'widescreen=no" title="Switch to normal screen width layout">Normal width</a> | ');
} else {
echo('<a href="' . $toggle_url . 'widescreen=yes" title="Switch to wide screen layout">Widescreen</a> | ');
}
if ($_SESSION['authenticated'])
{
echo("Logged in as <b>".$_SESSION['username']."</b>");
} else {
echo("Not logged in!");
}
if (Net_IPv6::checkIPv6($_SERVER['REMOTE_ADDR']))
{
echo(' via <b>IPv6</b>');
} else {
echo(' via <b>IPv4</b>');
}
if ($_SESSION['authenticated'])
{
echo(" (<a href='logout/'>Logout</a>)");
}
?>
</div>
<div style="float: right;">
<?php
if (isset($_SESSION['authenticated']) && $_SESSION['authenticated'])
{
include("includes/topnav.inc.php");
}
?>
</div>
</div>
<!-- //// end of gumax-header //// -->

View File

@ -69,54 +69,3 @@ if ($ports['down']) { $ports['bgcolour'] = "#ffcccc"; } else { $ports['bgcolo
if ($services['down']) { $services['bgcolour'] = "#ffcccc"; } else { $services['bgcolour'] = "transparent"; } if ($services['down']) { $services['bgcolour'] = "#ffcccc"; } else { $services['bgcolour'] = "transparent"; }
?> ?>
<div class="container-fluid">
<div class="row">
<div class="col-md-6">
<div class="panel panel-default panel-condensed">
<table class="table table-hover table-condensed table-striped">
<thead>
<tr class="info">
<th>&nbsp;</th>
<th>Total</th>
<th>Up</th>
<th>Down</th>
<th>Ignored</th>
<th>Disabled</th>
</tr>
</thead>
<tbody>
<tr class="active">
<td><a href="devices/">Devices</a></td>
<td><a href="devices/"><span><?php echo($devices['count']) ?></span></a></td>
<td><a href="devices/state=up/format=list_detail/"><span class="green"> <?php echo($devices['up']) ?> up</span></a></td>
<td><a href="devices/state=down/format=list_detail/"><span class="red"> <?php echo($devices['down']) ?> down</span></a></td>
<td><a href="devices/ignore=1/format=list_detail/"><span class="grey"> <?php echo($devices['ignored']) ?> ignored </span></a></td>
<td><a href="devices/disabled=1/format=list_detail/"><span class="black"> <?php echo($devices['disabled']) ?> disabled</span></a></td>
</tr>
<tr class="active">
<td><a href="ports/">Ports</a></td>
<td><a href="ports/"><span><?php echo($ports['count']) ?></span></a></td>
<td><a href="ports/format=list_detail/state=up/"><span class="green"> <?php echo($ports['up']) ?> up </span></a></td>
<td><a href="ports/format=list_detail/state=down/"><span class="red"> <?php echo($ports['down']) ?> down </span></a></td>
<td><a href="ports/format=list_detail/ignore=1/"><span class="grey"> <?php echo($ports['ignored']) ?> ignored </span></a></td>
<td><a href="ports/format=list_detail/state=admindown/"><span class="black"> <?php echo($ports['shutdown']) ?> shutdown</span></a></td>
</tr>
<?php if ($config['show_services']) { ?>
<tr class="active">
<td><a href="services/">Services</a></td>
<td><a href="services/"><span><?php echo($services['count']) ?></span></a></td>
<td><a href="services/state=up/view=details/"><span class="green"><?php echo($services['up']) ?> up</span></a></td>
<td><a href="services/state=down/view=details/"><span class="red"> <?php echo($services['down']) ?> down</span></a></td>
<td><a href="services/ignore=1/view=details/"><span class="grey"> <?php echo($services['ignored']) ?> ignored</span></a></td>
<td><a href="services/disabled=1/view=details/"><span class="black"> <?php echo($services['disabled']) ?> disabled</span></a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<div class="col-md-6">
&nbsp;
</div>
</div>
</div>

View File

@ -1,6 +1,6 @@
<?php <?php
include("includes/topnav.inc.php"); include_once("includes/object-cache.inc.php");
function generate_front_box ($frontbox_class, $content) function generate_front_box ($frontbox_class, $content)
{ {
@ -124,7 +124,7 @@ echo('
<div class="col-md-4"> <div class="col-md-4">
'); ');
include_once("includes/front/boxes.inc.php"); include_once("includes/device-summary-horiz.inc.php");
echo(' echo('
</div> </div>