mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
more html fixes - yes, Adam, I'm anal like that ;-)
git-svn-id: http://www.observium.org/svn/observer/trunk@627 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+76
-98
@@ -16,16 +16,13 @@ $select[$section] = "selected";
|
|||||||
|
|
||||||
$device_query = mysql_query("SELECT * FROM `devices` WHERE `device_id` = '" . $_GET['id'] . "'");
|
$device_query = mysql_query("SELECT * FROM `devices` WHERE `device_id` = '" . $_GET['id'] . "'");
|
||||||
while($device = mysql_fetch_array($device_query)) {
|
while($device = mysql_fetch_array($device_query)) {
|
||||||
echo("<table cellpadding=15
|
echo('<table cellpadding="15" cellspacing="0" class="devicetable" width="100%">');
|
||||||
cellspacing=0 class=devicetable width=100%>");
|
|
||||||
include("includes/device-header.inc");
|
include("includes/device-header.inc");
|
||||||
echo("</table>");
|
echo("</table>");
|
||||||
|
|
||||||
echo("<div class=mainpane>");
|
echo("<div class=mainpane>");
|
||||||
|
|
||||||
echo("
|
echo('<ul id="maintab" class="shadetabs">');
|
||||||
<ul id='maintab' class='shadetabs'>
|
|
||||||
");
|
|
||||||
|
|
||||||
|
|
||||||
#echo("
|
#echo("
|
||||||
@@ -36,12 +33,11 @@ echo("
|
|||||||
# </a>
|
# </a>
|
||||||
#</li>");
|
#</li>");
|
||||||
|
|
||||||
echo("<li class=" . $select['graphs'] . ">
|
echo('<li class="' . $select['graphs'] . '">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/graphs/'>
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/graphs/">
|
||||||
<img src='images/16/server_chart.png' align=absmiddle border=0> Graphs
|
<img src="images/16/server_chart.png" align="absmiddle" border="0"> Graphs
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>');
|
||||||
");
|
|
||||||
|
|
||||||
$health = mysql_result(mysql_query("select count(*) from storage WHERE host_id = '" . $device['device_id'] . "'"), 0) +
|
$health = mysql_result(mysql_query("select count(*) from storage WHERE host_id = '" . $device['device_id'] . "'"), 0) +
|
||||||
mysql_result(mysql_query("select count(temp_id) from temperature WHERE temp_host = '" . $device['device_id'] . "'"), 0) +
|
mysql_result(mysql_query("select count(temp_id) from temperature WHERE temp_host = '" . $device['device_id'] . "'"), 0) +
|
||||||
@@ -49,108 +45,93 @@ $health = mysql_result(mysql_query("select count(*) from storage WHERE host_id
|
|||||||
mysql_result(mysql_query("select count(*) from cpmCPU WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
mysql_result(mysql_query("select count(*) from cpmCPU WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||||
|
|
||||||
if($health) {
|
if($health) {
|
||||||
echo("
|
echo('<li class="' . $select['health'] . '">
|
||||||
<li class=" . $select['health'] . ">
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/health/">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/health/'>
|
<img src="images/16/chart_curve.png" align="absmiddle" border="0" /> Health
|
||||||
<img src='images/16/chart_curve.png' align=absmiddle border=0> Health
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>');
|
||||||
");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cisco_sensors = mysql_result(mysql_query("SELECT count(*) FROM `entPhysical` WHERE device_id = '".$device['device_id']."' AND entSensorType != '' AND entSensorType NOT LIKE 'No%'"),0);
|
$cisco_sensors = mysql_result(mysql_query("SELECT count(*) FROM `entPhysical` WHERE device_id = '".$device['device_id']."' AND entSensorType != '' AND entSensorType NOT LIKE 'No%'"),0);
|
||||||
|
|
||||||
if($cisco_sensors) {
|
if($cisco_sensors) {
|
||||||
echo("
|
echo('<li class="' . $select['ciscosensors'] . '">
|
||||||
<li class=" . $select['ciscosensors'] . ">
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/ciscosensors/">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ciscosensors/'>
|
<img src="images/16/contrast.png" align="absmiddle" border="0" /> Sensors
|
||||||
<img src='images/16/contrast.png' align=absmiddle border=0> Sensors
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>');
|
||||||
");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_dir($config['collectd_dir'] . "/" . $device['hostname'] ."/")) {
|
if(is_dir($config['collectd_dir'] . "/" . $device['hostname'] ."/")) {
|
||||||
echo("
|
echo('<li class="' . $select['collectd'] . '">
|
||||||
<li class=" . $select['collectd'] . ">
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/collectd/">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/collectd/'>
|
<img src="images/16/chart_line.png" align="absmiddle" border="0" /> CollectD
|
||||||
<img src='images/16/chart_line.png' align=absmiddle border=0> CollectD
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>');
|
||||||
");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(@mysql_result(mysql_query("select count(interface_id) from interfaces WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') {
|
if(@mysql_result(mysql_query("select count(interface_id) from interfaces WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') {
|
||||||
echo("
|
echo('<li class="' . $select['ports'] . '">
|
||||||
<li class=" . $select['ports'] . ">
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/ports/' .$config['ports_page_default']. '">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/".$config['ports_page_default']."'>
|
<img src="images/16/connect.png" align="absmiddle" border="0" /> Ports
|
||||||
<img src='images/16/connect.png' align=absmiddle border=0> Ports
|
|
||||||
</a>
|
</a>
|
||||||
</li>");
|
</li>');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(@mysql_result(mysql_query("select count(vlan_id) from vlans WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') {
|
if(@mysql_result(mysql_query("select count(vlan_id) from vlans WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') {
|
||||||
echo("
|
echo('<li class="' . $select['vlans'] . '">
|
||||||
<li class=" . $select['vlans'] . ">
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/vlans/">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/'>
|
<img src="images/16/vlans.png" align="absmiddle" border="0" /> VLANs
|
||||||
<img src='images/16/vlans.png' align='absmiddle' border='0'> VLANs
|
|
||||||
</a>
|
</a>
|
||||||
</li>");
|
</li>');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(@mysql_result(mysql_query("select count(*) from vrfs WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') {
|
if(@mysql_result(mysql_query("select count(*) from vrfs WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') {
|
||||||
echo("
|
echo('<li class="' . $select['vrfs'] . '">
|
||||||
<li class=" . $select['vrfs'] . ">
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/vrfs/">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vrfs/'>
|
<img src="images/16/layers.png" align="absmiddle" border="0" /> VRFs
|
||||||
<img src='images/16/layers.png' align=absmiddle border=0> VRFs
|
|
||||||
</a>
|
</a>
|
||||||
</li>");
|
</li>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($config['enable_bgp'] && $device['bgpLocalAs']) {
|
if($config['enable_bgp'] && $device['bgpLocalAs']) {
|
||||||
echo("
|
echo('<li class="' . $select['bgp'] . '">
|
||||||
<li class=" . $select['bgp'] . ">
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/bgp/">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/bgp/'>
|
<img src="images/16/link.png" align="absmiddle" border="0" /> BGP
|
||||||
<img src='images/16/link.png' align=absmiddle border=0> BGP
|
|
||||||
</a>
|
</a>
|
||||||
</li>");
|
</li>');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(@mysql_result(mysql_query("SELECT count(*) FROM nagios_hosts WHERE address = '".$device['hostname']."'", $nagios_link), 0) > '0') {
|
if(@mysql_result(mysql_query("SELECT count(*) FROM nagios_hosts WHERE address = '".$device['hostname']."'", $nagios_link), 0) > '0') {
|
||||||
echo("
|
echo('<li class="' . $select['nagios'] . '">
|
||||||
<li class=" . $select['nagios'] . ">
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/nagios/">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/nagios/'>
|
<img src="images/16/transmit_blue.png" align="absmiddle" border="0" /> Nagios
|
||||||
<img src='images/16/transmit_blue.png' align=absmiddle border=0> Nagios
|
|
||||||
</a>
|
</a>
|
||||||
</li>");
|
</li>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($_SESSION[userlevel] >= "5" && mysql_result(mysql_query("SELECT count(*) FROM links AS L, interfaces AS I WHERE I.device_id = '".$device['device_id']."' AND I.interface_id = L.src_if"),0)) {
|
if($_SESSION[userlevel] >= "5" && mysql_result(mysql_query("SELECT count(*) FROM links AS L, interfaces AS I WHERE I.device_id = '".$device['device_id']."' AND I.interface_id = L.src_if"),0)) {
|
||||||
echo("
|
echo('<li class="' . $select['map'] . '">
|
||||||
<li class=" . $select['map'] . ">
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/map/">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/map/'>
|
<img src="images/16/chart_organisation.png" align="absmiddle" border="0" /> Map
|
||||||
<img src='images/16/chart_organisation.png' align=absmiddle border=0> Map
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>');
|
||||||
");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($config['enable_inventory'] && @mysql_result(mysql_query("SELECT * FROM `entPhysical` WHERE device_id = '".$_GET['id']."'"), 0) > '0') {
|
if($config['enable_inventory'] && @mysql_result(mysql_query("SELECT * FROM `entPhysical` WHERE device_id = '".$_GET['id']."'"), 0) > '0') {
|
||||||
echo("<li class=" . $select['entphysical'] . ">
|
echo('<li class="' . $select['entphysical'] . '">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/entphysical/'>
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/entphysical/">
|
||||||
<img src='images/16/bricks.png' align=absmiddle border=0> Inventory
|
<img src="images/16/bricks.png" align="absmiddle" border="0" /> Inventory
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>');
|
||||||
");
|
|
||||||
} elseif ( $config['enable_inventory'] && @mysql_result(mysql_query("SELECT * FROM `hrDevice` WHERE device_id = '".$_GET['id']."'"), 0) > '0') {
|
} elseif ( $config['enable_inventory'] && @mysql_result(mysql_query("SELECT * FROM `hrDevice` WHERE device_id = '".$_GET['id']."'"), 0) > '0') {
|
||||||
echo("<li class=" . $select['hrdevice'] . ">
|
echo('<li class="' . $select['hrdevice'] . '">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/hrdevice/'>
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/hrdevice/">
|
||||||
<img src='images/16/bricks.png' align=absmiddle border=0> Inventory
|
<img src="images/16/bricks.png" align="absmiddle" border="0" /> Inventory
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>');
|
||||||
");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -158,8 +139,8 @@ if($config['enable_inventory'] && @mysql_result(mysql_query("SELECT * FROM `entP
|
|||||||
#if(mysql_result(mysql_query("select count(storage_id) from storage WHERE host_id = '" . $device['device_id'] . "'"), 0) > '0') {
|
#if(mysql_result(mysql_query("select count(storage_id) from storage WHERE host_id = '" . $device['device_id'] . "'"), 0) > '0') {
|
||||||
# echo("
|
# echo("
|
||||||
#<li class=" . $select['storage'] . ">
|
#<li class=" . $select['storage'] . ">
|
||||||
# <a href='".$config['base_url']."/device/" . $device['device_id'] . "/storage/'>
|
# <a href='".$config['base_url']."/device/" . $device['device_id'] . '/storage/">
|
||||||
# <img src='images/16/database.png' align=absmiddle border=0> Storage
|
# <img src="images/16/database.png" align="absmiddle" border="0" /> Storage
|
||||||
# </a>
|
# </a>
|
||||||
#</li>
|
#</li>
|
||||||
#");
|
#");
|
||||||
@@ -167,54 +148,51 @@ if($config['enable_inventory'] && @mysql_result(mysql_query("SELECT * FROM `entP
|
|||||||
|
|
||||||
|
|
||||||
if(mysql_result(mysql_query("select count(service_id) from services WHERE service_host = '" . $device['device_id'] . "'"), 0) > '0') {
|
if(mysql_result(mysql_query("select count(service_id) from services WHERE service_host = '" . $device['device_id'] . "'"), 0) > '0') {
|
||||||
echo("
|
echo('<li class="' . $select['srv'] . '">
|
||||||
<li class=" . $select['srv'] . ">
|
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/srv/">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/srv/'>
|
<img src="images/16/server_cog.png" align="absmiddle" border="0" /> Services
|
||||||
<img src='images/16/server_cog.png' align=absmiddle border=0> Services
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
");
|
');
|
||||||
}
|
}
|
||||||
|
|
||||||
echo("
|
echo('<li class="' . $select['events'] . '">
|
||||||
<li class=" . $select['events'] . ">
|
<a href="'.$config['base_url']. "/device/" . $device['device_id'] . '/events/">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/events/'>
|
<img src="images/16/report_magnify.png" align="absmiddle" border="0" /> Events
|
||||||
<img src='images/16/report_magnify.png' align=absmiddle border=0> Events
|
|
||||||
</a>
|
</a>
|
||||||
</li>");
|
</li>');
|
||||||
|
|
||||||
if($config['enable_syslog']) { echo("
|
if($config['enable_syslog']) {
|
||||||
<li class=" . $select['syslog'] . ">
|
echo("<li class=" . $select['syslog'] . '">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/syslog/'>
|
<a href="'.$config['base_url']."/device/" . $device['device_id'] . '/syslog/">
|
||||||
<img src='images/16/printer.png' align=absmiddle border=0> Syslog
|
<img src="images/16/printer.png" align="absmiddle" border="0" /> Syslog
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
"); }
|
');
|
||||||
|
}
|
||||||
|
|
||||||
if($_SESSION[userlevel] >= "5" && is_file($config['rancid_configs'] . $device['hostname'])) {
|
if($_SESSION[userlevel] >= "5" && is_file($config['rancid_configs'] . $device['hostname'])) {
|
||||||
echo("
|
echo('<li class=' . $select['showconfig'] . '">
|
||||||
<li class=" . $select['showconfig'] . ">
|
<a href="'.$config['base_url']."/device/" . $device['device_id'] . '/showconfig/">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/showconfig/'>
|
<img src="images/16/page_white_text.png" align="absmiddle" border="0" /> Config
|
||||||
<img src='images/16/page_white_text.png' align=absmiddle border=0> Config
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
");
|
');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_SESSION[userlevel] >= "5") {
|
if($_SESSION[userlevel] >= "5") {
|
||||||
echo("
|
echo('<li class="' . $select['edit'] . '">
|
||||||
<li class=" . $select['edit'] . ">
|
<a href="'.$config['base_url']."/device/" . $device['device_id'] . '/edit/">
|
||||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/edit/'>
|
<img src="images/16/server_edit.png" align="absmiddle" border="0" /> Settings
|
||||||
<img src='images/16/server_edit.png' align=absmiddle border=0> Settings
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
");
|
');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
echo("</ul>");
|
echo("</ul>");
|
||||||
echo("
|
echo('
|
||||||
<div class=contentstyle>");
|
<div class="contentstyle">');
|
||||||
|
|
||||||
include("pages/device/".mres($section).".inc.php");
|
include("pages/device/".mres($section).".inc.php");
|
||||||
|
|
||||||
|
|||||||
@@ -340,13 +340,13 @@ global $config;
|
|||||||
$sql = "SELECT * FROM `devices` WHERE `device_id` = '$host'";
|
$sql = "SELECT * FROM `devices` WHERE `device_id` = '$host'";
|
||||||
$data = mysql_fetch_array(mysql_query($sql));
|
$data = mysql_fetch_array(mysql_query($sql));
|
||||||
$type = strtolower($data['os']);
|
$type = strtolower($data['os']);
|
||||||
if(file_exists($config['html_dir'] . "/images/os/$type" . ".png")){ $image = "<img src='".$config['base_url']."/images/os/$type.png'>";
|
if(file_exists($config['html_dir'] . "/images/os/$type" . ".png")){ $image = "<img src='".$config['base_url']."/images/os/$type.png' />";
|
||||||
} elseif(file_exists($config['html_dir'] . "/images/os/$type" . ".gif")){ $image = "<img src='".$config['base_url']."/images/os/$type.gif'>"; }
|
} elseif(file_exists($config['html_dir'] . "/images/os/$type" . ".gif")){ $image = "<img src='".$config['base_url']."/images/os/$type.gif' />"; }
|
||||||
if($type == "linux") {
|
if($type == "linux") {
|
||||||
$features = strtolower(trim($data['features']));
|
$features = strtolower(trim($data['features']));
|
||||||
list($distro) = split(" ", $features);
|
list($distro) = split(" ", $features);
|
||||||
if(file_exists($config['html_dir'] . "/images/os/$distro" . ".png")){ $image = "<img src='".$config['base_url']."/images/os/$distro" . ".png'>";
|
if(file_exists($config['html_dir'] . "/images/os/$distro" . ".png")){ $image = "<img src='".$config['base_url']."/images/os/$distro" . ".png' />";
|
||||||
} elseif(file_exists($config['html_dir'] . "/images/os/$distro" . ".gif")){ $image = "<img src='".$config['base_url']."/images/os/$distro" . ".gif'>"; }
|
} elseif(file_exists($config['html_dir'] . "/images/os/$distro" . ".gif")){ $image = "<img src='".$config['base_url']."/images/os/$distro" . ".gif' />"; }
|
||||||
}
|
}
|
||||||
return $image;
|
return $image;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user