2012-04-20 17:37:58 +00:00
< ? php
2015-07-13 20:10:26 +02:00
$graph_array [ 'height' ] = '100' ;
$graph_array [ 'width' ] = '220' ;
2019-06-23 00:29:12 -05:00
$graph_array [ 'to' ] = \LibreNMS\Config :: get ( 'time.now' );
$graph_array [ 'from' ] = \LibreNMS\Config :: get ( 'time.day' );
2012-05-06 18:38:11 +00:00
$graph_array_zoom = $graph_array ;
2015-07-13 20:10:26 +02:00
$graph_array_zoom [ 'height' ] = '150' ;
$graph_array_zoom [ 'width' ] = '400' ;
$graph_array [ 'legend' ] = 'no' ;
2017-02-18 00:09:32 +01:00
$app_devices = dbFetchRows ( 'SELECT * FROM `devices` AS D, `applications` AS A WHERE D.device_id = A.device_id AND A.app_type = ? ORDER BY hostname' , array ( $vars [ 'app' ]));
2015-07-13 20:10:26 +02:00
foreach ( $app_devices as $app_device ) {
2016-08-04 14:19:02 +02:00
echo ' < div class = " panel panel-default " >
< div class = " panel-heading " >
< h3 class = " panel-title " >
'.generate_device_link($app_device, shorthost($app_device[' hostname ']), array(' tab ' => ' apps ', ' app ' => $vars[' app '])).'
< div class = " pull-right " >< small class = " muted " > '.$app_device[' app_instance '].' '.$app_device[' app_status '].' </ small ></ div >
</ h3 >
</ div >
< div class = " panel-body " >
< div class = " row " > ' ;
2015-07-13 20:10:26 +02:00
foreach ( $graphs [ $vars [ 'app' ]] as $graph_type ) {
2016-08-04 16:40:13 +02:00
$graph_array [ 'type' ] = empty ( $graph_type ) ? 'application_' . $vars [ 'app' ] : 'application_' . $vars [ 'app' ] . '_' . $graph_type ;
2015-07-13 20:10:26 +02:00
$graph_array [ 'id' ] = $app_device [ 'app_id' ];
$graph_array_zoom [ 'type' ] = 'application_' . $vars [ 'app' ] . '_' . $graph_type ;
$graph_array_zoom [ 'id' ] = $app_device [ 'app_id' ];
$link = generate_url ( array ( 'page' => 'device' , 'device' => $app_device [ 'device_id' ], 'tab' => 'apps' , 'app' => $vars [ 'app' ]));
2016-08-04 14:19:02 +02:00
echo '<div class="pull-left">' ;
2016-08-18 20:28:22 -05:00
echo overlib_link ( $link , generate_lazy_graph_tag ( $graph_array ), generate_graph_tag ( $graph_array_zoom ), null );
2016-08-04 14:19:02 +02:00
echo '</div>' ;
2015-07-13 20:10:26 +02:00
}
2016-08-04 14:19:02 +02:00
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
2015-07-13 20:10:26 +02:00
} //end foreach
echo '</table>' ;