mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
#11418 change graph in agent view
This commit is contained in:
parent
a1ca1a95fd
commit
54ba66e72a
@ -17,6 +17,8 @@ $save_custom_graph = (bool) get_parameter('save_custom_graph');
|
|||||||
$print_custom_graph = (bool) get_parameter('print_custom_graph', false);
|
$print_custom_graph = (bool) get_parameter('print_custom_graph', false);
|
||||||
$print_sparse_graph = (bool) get_parameter('print_sparse_graph');
|
$print_sparse_graph = (bool) get_parameter('print_sparse_graph');
|
||||||
$get_graphs = (bool) get_parameter('get_graphs_container');
|
$get_graphs = (bool) get_parameter('get_graphs_container');
|
||||||
|
$width = get_parameter('width', 0);
|
||||||
|
$height = get_parameter('height', 0);
|
||||||
|
|
||||||
if ($save_custom_graph) {
|
if ($save_custom_graph) {
|
||||||
$return = [];
|
$return = [];
|
||||||
@ -25,8 +27,6 @@ if ($save_custom_graph) {
|
|||||||
$name = get_parameter('name', '');
|
$name = get_parameter('name', '');
|
||||||
$description = get_parameter('description', '');
|
$description = get_parameter('description', '');
|
||||||
$stacked = get_parameter('stacked', CUSTOM_GRAPH_LINE);
|
$stacked = get_parameter('stacked', CUSTOM_GRAPH_LINE);
|
||||||
$width = get_parameter('width', 0);
|
|
||||||
$height = get_parameter('height', 0);
|
|
||||||
$events = get_parameter('events', 0);
|
$events = get_parameter('events', 0);
|
||||||
$period = get_parameter('period', 0);
|
$period = get_parameter('period', 0);
|
||||||
$fullscale = get_parameter('fullscale', 0);
|
$fullscale = get_parameter('fullscale', 0);
|
||||||
@ -126,6 +126,8 @@ if ($print_sparse_graph) {
|
|||||||
'force_interval' => '',
|
'force_interval' => '',
|
||||||
'time_interval' => 300,
|
'time_interval' => 300,
|
||||||
'array_data_create' => 0,
|
'array_data_create' => 0,
|
||||||
|
'height' => $height,
|
||||||
|
'width' => $width,
|
||||||
];
|
];
|
||||||
|
|
||||||
echo grafico_modulo_sparse($params);
|
echo grafico_modulo_sparse($params);
|
||||||
|
@ -45,7 +45,7 @@ if ((bool) check_acl($config['id_user'], $id_grupo, 'AR') === false && (bool) ch
|
|||||||
require_once $config['homedir'].'/include/functions_graph.php';
|
require_once $config['homedir'].'/include/functions_graph.php';
|
||||||
|
|
||||||
$draw_alerts = get_parameter('draw_alerts', 0);
|
$draw_alerts = get_parameter('draw_alerts', 0);
|
||||||
$period = get_parameter('period', SECONDS_1HOUR);
|
$period = (string) get_parameter('period', SECONDS_2HOUR);
|
||||||
$width = get_parameter('width', 555);
|
$width = get_parameter('width', 555);
|
||||||
$height = get_parameter('height', 245);
|
$height = get_parameter('height', 245);
|
||||||
$label = get_parameter('label', '');
|
$label = get_parameter('label', '');
|
||||||
@ -53,8 +53,8 @@ $start_date = get_parameter('start_date', date('Y-m-d'));
|
|||||||
$draw_events = get_parameter('draw_events', 0);
|
$draw_events = get_parameter('draw_events', 0);
|
||||||
$modules = get_parameter('modules', []);
|
$modules = get_parameter('modules', []);
|
||||||
$filter = get_parameter('filter', 0);
|
$filter = get_parameter('filter', 0);
|
||||||
$combined = get_parameter('combined', 1);
|
$combined = get_parameter('combined', 0);
|
||||||
$option_type = get_parameter('option_type', 0);
|
$option_type = get_parameter('option_type', 2);
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Get modules of agent sorted as:
|
// Get modules of agent sorted as:
|
||||||
@ -176,11 +176,12 @@ foreach ($modules_boolean as $i => $m) {
|
|||||||
|
|
||||||
|
|
||||||
$list_modules = ($modules_networkmap_no_proc + $modules_others + $modules_boolean);
|
$list_modules = ($modules_networkmap_no_proc + $modules_others + $modules_boolean);
|
||||||
|
sort($list_modules);
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
if (empty($modules)) {
|
if (empty($modules)) {
|
||||||
// Selected the first 6 modules.
|
// Selected the first 6 modules.
|
||||||
$module_ids = array_keys($list_modules);
|
$module_ids = array_keys($list_modules);
|
||||||
$module_ids = array_slice($module_ids, 0, 6);
|
$module_ids = array_slice($module_ids, 0, 12);
|
||||||
$modules = $module_ids;
|
$modules = $module_ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,7 +302,7 @@ $htmlForm .= html_print_div(
|
|||||||
|
|
||||||
$htmlForm .= '</form>';
|
$htmlForm .= '</form>';
|
||||||
|
|
||||||
ui_toggle($htmlForm, __('Filter graphs'), __('Toggle filter(s)'), '', false);
|
ui_toggle($htmlForm, __('Filter graphs'), __('Toggle filter(s)'), '', true);
|
||||||
|
|
||||||
$utime = get_system_time();
|
$utime = get_system_time();
|
||||||
$current = date('Y-m-d', $utime);
|
$current = date('Y-m-d', $utime);
|
||||||
@ -316,13 +317,17 @@ if ($combined) {
|
|||||||
// Pass the $modules before the ajax call.
|
// Pass the $modules before the ajax call.
|
||||||
echo '<div class="combined-graph-container center w100p white_box"'.'data-period="'.$period.'"'.'data-stacked="'.CUSTOM_GRAPH_LINE.'"'.'data-date="'.$date.'"'.'data-height="'.$height.'"'.'>'.html_print_image('images/spinner.gif', true).'</div>';
|
echo '<div class="combined-graph-container center w100p white_box"'.'data-period="'.$period.'"'.'data-stacked="'.CUSTOM_GRAPH_LINE.'"'.'data-date="'.$date.'"'.'data-height="'.$height.'"'.'>'.html_print_image('images/spinner.gif', true).'</div>';
|
||||||
} else {
|
} else {
|
||||||
|
echo '<div class="content-graphs flex wrap bg-white">';
|
||||||
foreach ($modules as $id_module) {
|
foreach ($modules as $id_module) {
|
||||||
$title = modules_get_agentmodule_name($id_module);
|
$title = modules_get_agentmodule_name($id_module);
|
||||||
$unit = modules_get_unit($id_module);
|
$unit = modules_get_unit($id_module);
|
||||||
|
echo '<div class="graph" style="width: 100%; max-width: 480px; padding: 10px;">';
|
||||||
echo '<h4>'.$title.'</h4>';
|
echo '<h4>'.$title.'</h4>';
|
||||||
echo '<div class="sparse-graph-container center w100p"'.'data-id_module="'.$id_module.'"'.'data-period="'.$period.'"'.'data-draw_events="'.(int) $draw_events.'"'.'data-title="'.$title.'"'.'data-draw_alerts="'.(int) $draw_alerts.'"'.'data-date="'.$date.'"'.'data-unit="'.$unit.'"'.'data-date="'.$date.'"'.'data-height="'.$height.'"'.'>'.html_print_image('images/spinner.gif', true).'</div>';
|
echo '<div class="sparse-graph-container" data-id_module="'.$id_module.'"'.'data-period="'.$period.'"'.'data-draw_events="'.(int) $draw_events.'"'.'data-title="'.$title.'"'.'data-draw_alerts="'.(int) $draw_alerts.'"'.'data-date="'.$date.'"'.'data-unit="'.$unit.'"'.'data-date="'.$date.'"'.'data-height="'.$height.'"'.'>'.html_print_image('images/spinner.gif', true).'</div>';
|
||||||
|
echo '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<div class='both'></div>";
|
echo "<div class='both'></div>";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user