Move status and logon pages to same page,

remove kernel version from status page
This commit is contained in:
bohdan-s
2014-06-21 20:24:44 -04:00
parent 4130d6bdc1
commit c9ea8fb69a
3 changed files with 76 additions and 4 deletions

View File

@@ -0,0 +1,50 @@
<?php
if ($bg == $list_colour_b) { $bg = $list_colour_a; } else { $bg = $list_colour_b; }
if ($device['status'] == '0')
{
$class = "bg-danger";
} else {
$class = "bg-primary";
}
if ($device['ignore'] == '1')
{
$class = "bg-warning";
if ($device['status'] == '1')
{
$class = "bg-success";
}
}
if ($device['disabled'] == '1')
{
$class = "bg-info";
}
$type = strtolower($device['os']);
if ($device['os'] == "ios") { formatCiscoHardware($device, true); }
$device['os_text'] = $config['os'][$device['os']]['text'];
echo(' <!--<tr onclick="location.href=\'device/'.$device['device_id'].'/\'" style="cursor: pointer;"> -->
<tr>
<td class="'. $class .' "></td>
<td>' . $image . '</td>
<td><span style="font-size: 15px;">' . generate_device_link($device) . '</span></td>'
);
echo('<td>');
if ($port_count) { echo(' <img src="images/icons/port.png" align=absmiddle /> '.$port_count); }
echo('<br />');
if ($sensor_count) { echo(' <img src="images/icons/sensors.png" align=absmiddle /> '.$sensor_count); }
echo('</td>');
echo(' <td>' . $device['hardware'] . ' ' . $device['features'] . '</td>');
//echo(' <td>' . $device['os_text'] . ' ' . $device['version'] . '</td>');
echo(' <td>' . formatUptime($device['uptime'], 'short') . ' <br />');
if (get_dev_attrib($device,'override_sysLocation_bool')) { $device['location'] = get_dev_attrib($device,'override_sysLocation_string'); }
echo(' ' . truncate($device['location'],32, '') . '</td>');
echo(' </tr>');
?>

View File

@@ -212,7 +212,13 @@ if ($_SESSION['authenticated'])
{
include("pages/logon.inc.php");
} else {
echo '<div id="public-status">';
include("pages/public.inc.php");
echo '</div>';
echo '<div id="public-logon" style="display:none;">';
echo '<div class="well"><h3>Logon<button class="btn btn-default" type="submit" style="float:right;" onclick="ToggleLogon()">Status</button></h3></div>';
include ("pages/logon.inc.php");
echo '</div>';
}
}
else

View File

@@ -1,3 +1,20 @@
<script class="code" type="text/javascript">
function ToggleLogon($) {
if ( document.getElementById('public-logon').style.display=="block" )
{
document.getElementById('public-logon').style.display="none";
document.getElementById('public-status').style.display="block";
//document.getElementById($id+"-div").innerHTML="click to expand";
}
else
{
document.getElementById('public-logon').style.display="block";
document.getElementById('public-status').style.display="none";
//document.getElementById($id+"-div").innerHTML="hide";
}
};
</script>
<?php
// Set Defaults here
@@ -34,7 +51,7 @@ $pagetitle[] = "Public Devices";
//print_optionbar_end();
echo '<div class="well"><h3>System Status</h3></div>';
echo '<div class="well"><h3>System Status<button class="btn btn-default" type="submit" style="float:right;" onclick="ToggleLogon()">Logon</button></h3></div>';
$query = "SELECT * FROM `devices` WHERE 1 ".$where." ORDER BY hostname";
@@ -81,7 +98,7 @@ if($format == "graph")
<th>Device</th>
<th></th>
<th>Platform</th>
<th>Operating System</th>
<!-- <th>Operating System</th> -->
<th>Uptime/Location</th>
</tr>');
}
@@ -90,7 +107,7 @@ if($format == "graph")
{
if (!device_permitted($device['device_id']))
{
include("includes/hostbox-basic.inc.php");
include("includes/hostbox-public.inc.php");
}
}
echo("</table>");
@@ -105,7 +122,6 @@ if($format == "graph")
<div class="col-md-12 text-center">
<?php
echo(' <br /> <br /> ' . (isset($config['footer']) ? $config['footer'] : ''));
echo(' <br /><a href="' . $config['site_url'] . 'login/" target="_self">Admins Logon Here</a>. ');
echo(' <br />Powered by <a href="' . $config['project_url'] . '" target="_blank">' . $config['project_name_version'].'</a>. ');
echo( $config['project_name'].' is <a href="http://www.gnu.org/philosophy/free-sw.html">Free Software</a>, released under the <a href="http://www.gnu.org/copyleft/gpl.html">GNU GPLv3</a>.<br/>');
echo(' Copyright &copy; 2006-2012 by Adam Armstrong. Copyright &copy; 2013-'.date("Y").' by the '.$config['project_name'].' Contributors.');