mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 00:11:49 +02:00
improvements to (mysql) app system
git-svn-id: http://www.observium.org/svn/observer/trunk@3135 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -411,7 +411,7 @@ if ($_SESSION['userlevel'] >= '5' && ($app_count) > "0")
|
|||||||
$image = $config['html_dir']."/images/icons/".$row['app_type'].".png";
|
$image = $config['html_dir']."/images/icons/".$row['app_type'].".png";
|
||||||
$icon = (file_exists($image) ? $row['app_type'] : "apps");
|
$icon = (file_exists($image) ? $row['app_type'] : "apps");
|
||||||
echo('
|
echo('
|
||||||
<li><a href="apps/app='.$app['app_type'].'/"><img src="images/icons/'.$icon.'.png" border="0" align="absmiddle" /> '.$app['app_type'].' </a></li>');
|
<li><a href="apps/app='.$app['app_type'].'/"><img src="images/icons/'.$icon.'.png" border="0" align="absmiddle" /> '.nicecase($app['app_type']).' </a></li>');
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ foreach ($app_list as $app)
|
|||||||
} else {
|
} else {
|
||||||
#echo('<img src="images/icons/greyscale/'.$app['app_type'].'.png" class="optionicon" />');
|
#echo('<img src="images/icons/greyscale/'.$app['app_type'].'.png" class="optionicon" />');
|
||||||
}
|
}
|
||||||
echo(generate_link(ucfirst($app['app_type']),array('page'=>'apps','app'=>$app['app_type'])));
|
echo(generate_link(nicecase($app['app_type']),array('page'=>'apps','app'=>$app['app_type'])));
|
||||||
if ($vars['app'] == $app['app_type']) { echo("</span>"); }
|
if ($vars['app'] == $app['app_type']) { echo("</span>"); }
|
||||||
$sep = " | ";
|
$sep = " | ";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,36 +9,38 @@ $graph_array_zoom['height'] = "150";
|
|||||||
$graph_array_zoom['width'] = "400";
|
$graph_array_zoom['width'] = "400";
|
||||||
$graph_array['legend'] = "no";
|
$graph_array['legend'] = "no";
|
||||||
|
|
||||||
echo('<h2>'.$vars['app'].'</h2>');
|
echo('<h2>'.nicecase($vars['app']).'</h2>');
|
||||||
echo('<table cellpadding=5 cellspacing=0 class=devicetable width=100%>');
|
echo('<table cellpadding=5 cellspacing=0 class=devicetable width=100%>');
|
||||||
$app_devices = dbFetchRows("SELECT * FROM `devices` AS D, `applications` AS A WHERE D.device_id = A.device_id AND A.app_type = ?", array($vars['app']));
|
$app_devices = dbFetchRows("SELECT * FROM `devices` AS D, `applications` AS A WHERE D.device_id = A.device_id AND A.app_type = ?", array($vars['app']));
|
||||||
|
|
||||||
foreach ($app_devices as $app_device)
|
foreach ($app_devices as $app_device)
|
||||||
{
|
{
|
||||||
echo('<tr class="list-device">');
|
echo('<tr class="list-device">');
|
||||||
echo('<td class="device-head" width=300px>'.generate_device_link($app_device, shorthost($app_device['hostname']), array('tab'=>'apps','app'=>$vars['app'])).'</td>');
|
echo('<td class="device-head" width=300px>'.generate_device_link($app_device, shorthost($app_device['hostname']), array('tab'=>'apps','app'=>$vars['app'])).'</td>');
|
||||||
echo('<td class="device-head" width=100px>'.$app_device['app_instance'].'</td>');
|
echo('<td class="device-head" width=100px>'.$app_device['app_instance'].'</td>');
|
||||||
echo('<td class="device-head" width=100px>'.$app_device['app_status'].'</td>');
|
echo('<td class="device-head" width=100px>'.$app_device['app_status'].'</td>');
|
||||||
echo('<td></td>');
|
echo('<td></td>');
|
||||||
echo('</tr>');
|
echo('</tr>');
|
||||||
echo('<tr class="list-device">');
|
echo('<tr class="list-device">');
|
||||||
echo('<td colspan=4>');
|
echo('<td colspan=4>');
|
||||||
|
|
||||||
foreach ($graphs[$vars['app']] as $graph_type)
|
foreach ($graphs[$vars['app']] as $graph_type)
|
||||||
{
|
{
|
||||||
$graph_array['type'] = "application_".$vars['app']."_".$graph_type;
|
$graph_array['type'] = "application_".$vars['app']."_".$graph_type;
|
||||||
$graph_array['id'] = $app_device['app_id'];
|
$graph_array['id'] = $app_device['app_id'];
|
||||||
$graph_array_zoom['type'] = "application_".$vars['app']."_".$graph_type;
|
$graph_array_zoom['type'] = "application_".$vars['app']."_".$graph_type;
|
||||||
$graph_array_zoom['id'] = $app_device['app_id'];
|
$graph_array_zoom['id'] = $app_device['app_id'];
|
||||||
|
|
||||||
$link_array = $graph_array;
|
$link_array = $graph_array;
|
||||||
$link_array['page'] = "graphs";
|
$link_array['page'] = "graphs";
|
||||||
unset($link_array['height'], $link_array['width']);
|
unset($link_array['height'], $link_array['width']);
|
||||||
$link = generate_url($link_array);
|
$link = generate_url($link_array);
|
||||||
|
|
||||||
echo(overlib_link($link, generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL));
|
echo(overlib_link($link, generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL));
|
||||||
}
|
}
|
||||||
echo('</td>');
|
|
||||||
echo('</tr>');
|
echo('</td>');
|
||||||
|
echo('</tr>');
|
||||||
}
|
}
|
||||||
|
|
||||||
echo('</table>');
|
echo('</table>');
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ $graph_array['legend'] = "no";
|
|||||||
foreach ($app_list as $app)
|
foreach ($app_list as $app)
|
||||||
{
|
{
|
||||||
echo('<div style="clear: both;">');
|
echo('<div style="clear: both;">');
|
||||||
echo('<h2>'.generate_link(ucfirst($app['app_type']),array('page'=>'apps','app'=>$app['app_type'])).'</h2>');
|
echo('<h2>'.generate_link(nicecase($app['app_type']),array('page'=>'apps','app'=>$app['app_type'])).'</h2>');
|
||||||
$app_devices = dbFetchRows("SELECT * FROM `devices` AS D, `applications` AS A WHERE D.device_id = A.device_id AND A.app_type = ?", array($app['app_type']));
|
$app_devices = dbFetchRows("SELECT * FROM `devices` AS D, `applications` AS A WHERE D.device_id = A.device_id AND A.app_type = ?", array($app['app_type']));
|
||||||
foreach ($app_devices as $app_device)
|
foreach ($app_devices as $app_device)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ global $config;
|
|||||||
|
|
||||||
print_optionbar_start();
|
print_optionbar_start();
|
||||||
|
|
||||||
echo("<span style='font-weight: bold;'>".$app['app_type']."</span> » ");
|
echo("<span style='font-weight: bold;'>".nicecase($app['app_type'])."</span> » ");
|
||||||
|
|
||||||
$app_sections = array('system' => "System",
|
$app_sections = array('system' => "System",
|
||||||
'queries' => "Quieries",
|
'queries' => "Queries",
|
||||||
'innodb' => "InnoDB");
|
'innodb' => "InnoDB");
|
||||||
|
|
||||||
unset($sep);
|
unset($sep);
|
||||||
@@ -20,7 +20,7 @@ foreach ($app_sections as $app_section => $app_section_text)
|
|||||||
{
|
{
|
||||||
echo("<span class='pagemenu-selected'>");
|
echo("<span class='pagemenu-selected'>");
|
||||||
}
|
}
|
||||||
echo(generate_link(ucfirst($app_section),$vars,array('app_section'=>$app_section)));
|
echo(generate_link(nicecase($app_section),$vars,array('app_section'=>$app_section)));
|
||||||
if ($vars['app_section'] == $app_section) { echo("</span>"); }
|
if ($vars['app_section'] == $app_section) { echo("</span>"); }
|
||||||
$sep = " | ";
|
$sep = " | ";
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-2
@@ -26,8 +26,19 @@ if ($config['alerts']['email']['enable'])
|
|||||||
|
|
||||||
function nicecase($item)
|
function nicecase($item)
|
||||||
{
|
{
|
||||||
if ($item == "dbm") { return "dBm"; }
|
switch ($item)
|
||||||
else return ucfirst($item);
|
{
|
||||||
|
case "dbm":
|
||||||
|
return "dBm";
|
||||||
|
case "mysql":
|
||||||
|
return" MySQL";
|
||||||
|
case "powerdns":
|
||||||
|
return "PowerDNS";
|
||||||
|
case "bind":
|
||||||
|
return "BIND";
|
||||||
|
default:
|
||||||
|
return ucfirst($item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function mac_clean_to_readable($mac)
|
function mac_clean_to_readable($mac)
|
||||||
|
|||||||
Reference in New Issue
Block a user