mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix device/services. rename from svc, add new menubar
git-svn-id: http://www.observium.org/svn/observer/trunk@2055 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -160,7 +160,7 @@ if (device_permitted($_GET['id']) || $check_device == $_GET['id'])
|
||||
if (mysql_result(mysql_query("select count(service_id) from services WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0')
|
||||
{
|
||||
echo('<li class="' . $select['srv'] . '">
|
||||
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/srv/">
|
||||
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/services/">
|
||||
<img src="images/icons/services.png" align="absmiddle" border="0" /> Services
|
||||
</a>
|
||||
</li>');
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php print_optionbar_start();
|
||||
|
||||
$menu_options = array('basic' => 'Basic',
|
||||
'details' => 'Details');
|
||||
|
||||
if (!$_GET['opta']) { $_GET['opta'] = "basic"; }
|
||||
|
||||
$sep = "";
|
||||
foreach ($menu_options as $option => $text)
|
||||
{
|
||||
echo($sep);
|
||||
if ($_GET['opta'] == $option)
|
||||
{
|
||||
echo("<span class='pagemenu-selected'>");
|
||||
}
|
||||
echo('<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/services/' . $option . ($_GET['optb'] ? '/' . $_GET['optb'] : ''). '/">' . $text . '</a>');
|
||||
if ($_GET['opta'] == $option)
|
||||
{
|
||||
echo("</span>");
|
||||
}
|
||||
$sep = " | ";
|
||||
}
|
||||
|
||||
unset($sep);
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
if (mysql_result(mysql_query("select count(service_id) from services WHERE device_id = '".$device['device_id']."'"), 0) > '0')
|
||||
{
|
||||
echo("<div style='margin: 5px;'><table cellpadding=7 border=0 cellspacing=0 width=100%>");
|
||||
$i = "1";
|
||||
$service_query = mysql_query("select * from services WHERE device_id = '".$device['device_id']."' ORDER BY service_type");
|
||||
while ($service = mysql_fetch_assoc($service_query))
|
||||
{
|
||||
include("includes/print-service.inc.php");
|
||||
|
||||
if ($_GET['opta'] == "details")
|
||||
{
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "210";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['id'] = $service['service_id'];
|
||||
$graph_array['type'] = "service_availability";
|
||||
|
||||
$periods = array('day', 'week', 'month', 'year');
|
||||
|
||||
echo('<tr style="background-color: '.$bg.'; padding: 7px;"><td colspan=4>');
|
||||
foreach ($periods as $period)
|
||||
{
|
||||
$graph_array['from'] = $$period;
|
||||
$graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400";
|
||||
echo(overlib_link($_SERVER['REQUEST_URI'], generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL));
|
||||
}
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo("</table></div>");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo("No Services");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (mysql_result(mysql_query("select count(service_id) from services WHERE device_id = '".$device['device_id']."'"), 0) > '0')
|
||||
{
|
||||
echo("<div style='margin: 5px;'><table cellpadding=7 border=0 cellspacing=0 width=100%>");
|
||||
$i = "1";
|
||||
$service_query = mysql_query("select * from services WHERE device_id = '".$device['device_id']."' ORDER BY service_type");
|
||||
while ($service = mysql_fetch_assoc($service_query))
|
||||
{
|
||||
include("includes/print-service.inc.php");
|
||||
}
|
||||
|
||||
echo("</table></div>");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo("No Services");
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user