Commit version 24.12.13800

This commit is contained in:
2025-01-06 17:35:06 -05:00
parent b7f6a79c2c
commit 55d9218816
6133 changed files with 4239740 additions and 1374287 deletions

View File

@ -1,77 +1,62 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage webui
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage webui
* @copyright (C) Adam Armstrong
*
*/
$graph_array['to'] = $config['time']['now'];
$graph_array['from'] = $config['time']['day'];
$graph_array['to'] = get_time();
$graph_array['from'] = get_time('day');
//$graph_array_zoom = $graph_array;
//$graph_array_zoom['height'] = "150";
//$graph_array_zoom['width'] = "400";
//$graph_array['legend'] = "no";
$app_devices = array();
foreach (dbFetchRows("SELECT * FROM `applications` WHERE `app_type` = ? ".$GLOBALS['cache']['where']['devices_permitted'], array($vars['app'])) as $app)
{
if (isset($cache['devices']['id'][$app['device_id']]))
{
$app_devices[] = array_merge($app, $cache['devices']['id'][$app['device_id']]);
}
$where_clause = generate_where_clause(['`app_type` = ?', generate_query_permitted_ng(['devices'])]);
// Merge device and app arrays for ease of sorting. This may not scale well to huge numbers of apps.
$devices = [];
foreach (dbFetchRows("SELECT * FROM `applications` " . $where_clause, [$vars['app']]) as $app) {
$devices[$app['app_id']] = array_merge($app, device_by_id_cache($app['device_id']));
}
$app_devices = array_sort_by($app_devices, 'hostname', SORT_ASC, SORT_STRING);
//echo generate_box_open();
// FIXME. Use db query instead
$devices = array_sort_by($devices, 'hostname', SORT_ASC, SORT_STRING);
//echo '<table class="table table-hover table-condensed table-striped ">';
foreach ($devices as $device) {
foreach ($app_devices as $app_device)
{
// Faux $app array for easier code reading
$app = &$device;
echo generate_box_open();
echo generate_box_open();
echo '<table class="table table-hover table-condensed table-striped ">';
echo '<table class="table table-hover table-condensed table-striped ">';
print_device_row($app_device, NULL, array('tab' => 'apps', 'app' => $app['app_type']));
print_device_row($device, NULL, ['tab' => 'apps', 'app' => $app['app_type'], 'instance' => $app['app_id']]);
echo '<tr><td colspan="6">';
echo '<tr><td colspan="6">';
$graph_array['id'] = $app_device['app_id'];
$graph_array['types'] = array();
$graph_array['legend'] = "no";
$graph_array['id'] = $device['app_id'];
$graph_array['types'] = [];
$graph_array['legend'] = "no";
foreach ($config['app'][$vars['app']]['top'] as $graph_type)
{
$graph_array['types'][] = "application_".$vars['app']."_".$graph_type;
}
print_graph_summary_row($graph_array);
foreach ($config['app'][$vars['app']]['top'] as $graph_type) {
$graph_array['types'][] = "application_" . $vars['app'] . "_" . $graph_type;
}
print_graph_summary_row($graph_array);
/*
foreach ($config['app'][$vars['app']]['top'] as $graph_type)
{
$graph_array['type'] = "application_".$vars['app']."_".$graph_type;
$graph_array['id'] = $app_device['app_id'];
$graph_array_zoom['type'] = "application_".$vars['app']."_".$graph_type;
$graph_array_zoom['id'] = $app_device['app_id'];
echo '</td>';
echo '</tr>';
echo '<h3>' . nicecase($graph_type) . '</h3>';
print_graph_row($graph_array);
}
*/
echo '</table>';
echo '</td>';
echo '</tr>';
echo '</table>';
echo generate_box_close();
echo generate_box_close();
}