#9125 Fixed chart type

This commit is contained in:
Daniel Maya 2022-06-08 10:59:46 +02:00
parent 8a5847a225
commit 6a8140b36c

View File

@ -53,7 +53,7 @@ $modules_networkmap_no_proc = agents_get_modules(
false, false,
[ [
'id_modulo' => 2, 'id_modulo' => 2,
// networkmap type // Networkmap type.
'id_tipo_modulo' => [ 'id_tipo_modulo' => [
'<>2', '<>2',
// != generic_proc // != generic_proc
@ -133,7 +133,7 @@ if (empty($modules_boolean)) {
$modules_boolean = []; $modules_boolean = [];
} }
// Cleaned the duplicate $modules and other things // Cleaned the duplicate $modules and other things.
$modules_others = array_diff_key( $modules_others = array_diff_key(
$modules_others, $modules_others,
$modules_networkmap_no_proc $modules_networkmap_no_proc
@ -278,7 +278,7 @@ if ($start_date != $current) {
} }
if ($combined) { if ($combined) {
// Pass the $modules before the ajax call // Pass the $modules before the ajax call.
echo '<div class="combined-graph-container center w100p"'.'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"'.'data-period="'.$period.'"'.'data-stacked="'.CUSTOM_GRAPH_LINE.'"'.'data-date="'.$date.'"'.'data-height="'.$height.'"'.'>'.html_print_image('images/spinner.gif', true).'</div>';
} else { } else {
foreach ($modules as $id_module) { foreach ($modules as $id_module) {
@ -296,7 +296,7 @@ echo '<div id="graph-error-message" class="invisible">';
ui_print_error_message(__('There was an error loading the graph')); ui_print_error_message(__('There was an error loading the graph'));
echo '</div>'; echo '</div>';
// Dialog to save the custom graph // Dialog to save the custom graph.
echo "<div id='dialog_save_custom_graph' class='invisible'>"; echo "<div id='dialog_save_custom_graph' class='invisible'>";
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
@ -373,7 +373,7 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
params["id_modules"] = <?php echo json_encode($modules); ?>; params["id_modules"] = <?php echo json_encode($modules); ?>;
params["name"] = $("input[name='name_custom_graph']").val(); params["name"] = $("input[name='name_custom_graph']").val();
params["description"] = "<?php echo __('Custom graph create from the tab graphs in the agent.'); ?>"; params["description"] = "<?php echo __('Custom graph create from the tab graphs in the agent.'); ?>";
params["stacked"] = <?php echo CUSTOM_GRAPH_LINE; ?>; params["stacked"] = parseInt($("#option_type").val());
params["width"] = <?php echo $width; ?>; params["width"] = <?php echo $width; ?>;
params["height"] = <?php echo $height; ?>; params["height"] = <?php echo $height; ?>;
params["events"] = <?php echo $draw_events; ?>; params["events"] = <?php echo $draw_events; ?>;
@ -390,8 +390,7 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
$(".loading_save").hide(); $(".loading_save").hide();
if (data.correct) { if (data.correct) {
$(".ok_save").show(); $(".ok_save").show();
} } else {
else {
$(".error_save").show(); $(".error_save").show();
$(".button_save").enable(); $(".button_save").enable();
} }
@ -420,8 +419,7 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
value: 3, value: 3,
text: "<?php echo __('Line stack'); ?>" text: "<?php echo __('Line stack'); ?>"
})); }));
} } else {
else {
$('#option_type').empty(); $('#option_type').empty();
$('#option_type').append($('<option>', { $('#option_type').append($('<option>', {
value: 0, value: 0,