Changed an ajax call from synchronous to asynchronous
This commit is contained in:
parent
968c179c0c
commit
90d5d3cae3
|
@ -159,7 +159,6 @@ function show_response_dialog(event_id, response_id, response) {
|
||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action=ajax_file,
|
url: action=ajax_file,
|
||||||
async: false,
|
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
dataType: 'html',
|
dataType: 'html',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
|
|
@ -17,15 +17,14 @@
|
||||||
// Load global vars
|
// Load global vars
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
require_once ($config['homedir']. "/include/functions_events.php"); //Event processing functions
|
require_once ($config['homedir'] . "/include/functions.php");
|
||||||
require_once ($config['homedir']. "/include/functions_alerts.php"); //Alerts processing functions
|
require_once ($config['homedir'] . "/include/functions_events.php"); //Event processing functions
|
||||||
require_once ($config['homedir']. "/include/functions.php");
|
require_once ($config['homedir'] . "/include/functions_alerts.php"); //Alerts processing functions
|
||||||
require_once($config['homedir'] . "/include/functions_agents.php"); //Agents funtions
|
require_once ($config['homedir'] . "/include/functions_agents.php"); //Agents funtions
|
||||||
require_once($config['homedir'] . "/include/functions_users.php"); //Users functions
|
require_once ($config['homedir'] . "/include/functions_users.php"); //Users functions
|
||||||
require_once ($config['homedir'] . '/include/functions_groups.php');
|
require_once ($config['homedir'] . "/include/functions_groups.php");
|
||||||
|
require_once ($config["homedir"] . "/include/functions_graph.php");
|
||||||
require_once ($config["homedir"] . '/include/functions_graph.php');
|
require_once ($config["homedir"] . "/include/functions_tags.php");
|
||||||
require_once ($config["homedir"] . '/include/functions_tags.php');
|
|
||||||
|
|
||||||
check_login ();
|
check_login ();
|
||||||
|
|
||||||
|
@ -36,8 +35,6 @@ if (! check_acl ($config["id_user"], 0, "ER")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
|
|
||||||
|
|
||||||
if(defined('METACONSOLE')){
|
if(defined('METACONSOLE')){
|
||||||
$jump = ' ';
|
$jump = ' ';
|
||||||
}
|
}
|
||||||
|
@ -162,7 +159,7 @@ require('events.build_query.php');
|
||||||
|
|
||||||
$id_name = get_parameter('id_name', '');
|
$id_name = get_parameter('id_name', '');
|
||||||
|
|
||||||
if(!defined("METACONSOLE"))
|
if (!defined("METACONSOLE"))
|
||||||
echo "<br>";
|
echo "<br>";
|
||||||
|
|
||||||
|
|
||||||
|
@ -174,7 +171,7 @@ $update_pressed = (int) !empty($update_pressed);
|
||||||
if ($update_pressed || $open_filter) {
|
if ($update_pressed || $open_filter) {
|
||||||
$open_filter = true;
|
$open_filter = true;
|
||||||
}
|
}
|
||||||
if(!defined("METACONSOLE")){
|
if (!defined("METACONSOLE")) {
|
||||||
$table = html_get_predefined_table('transparent', 2);
|
$table = html_get_predefined_table('transparent', 2);
|
||||||
$table->styleTable = 'width: 23px; float: right; background: #ECECEC;';
|
$table->styleTable = 'width: 23px; float: right; background: #ECECEC;';
|
||||||
$table->width = '98%';
|
$table->width = '98%';
|
||||||
|
@ -275,7 +272,7 @@ $table->width = '98%';
|
||||||
$table->cellspacing = 4;
|
$table->cellspacing = 4;
|
||||||
$table->cellpadding = 4;
|
$table->cellpadding = 4;
|
||||||
$table->class = 'databox';
|
$table->class = 'databox';
|
||||||
if(defined('METACONSOLE')){
|
if (defined('METACONSOLE')) {
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->cellspacing = 0;
|
$table->cellspacing = 0;
|
||||||
$table->cellpadding = 0;
|
$table->cellpadding = 0;
|
||||||
|
@ -283,7 +280,7 @@ if(defined('METACONSOLE')){
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
|
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
|
||||||
if(!defined("METACONSOLE"))
|
if (!defined("METACONSOLE"))
|
||||||
$table->style[0] = 'width: 50%; width:50%;';
|
$table->style[0] = 'width: 50%; width:50%;';
|
||||||
$data = array();
|
$data = array();
|
||||||
$table->rowid[3] = 'update_filter_row1';
|
$table->rowid[3] = 'update_filter_row1';
|
||||||
|
@ -330,7 +327,7 @@ $tabletags_with->cellspacing = 4;
|
||||||
$tabletags_with->cellpadding = 4;
|
$tabletags_with->cellpadding = 4;
|
||||||
$tabletags_with->class = 'noshadow';
|
$tabletags_with->class = 'noshadow';
|
||||||
$tabletags_with->styleTable = 'border: 0px;';
|
$tabletags_with->styleTable = 'border: 0px;';
|
||||||
if(defined('METACONSOLE')){
|
if (defined('METACONSOLE')) {
|
||||||
$tabletags_with->width = '100%';
|
$tabletags_with->width = '100%';
|
||||||
$tabletags_with->class = 'nobady';
|
$tabletags_with->class = 'nobady';
|
||||||
$tabletags_with->cellspacing = 0;
|
$tabletags_with->cellspacing = 0;
|
||||||
|
@ -340,7 +337,7 @@ if(defined('METACONSOLE')){
|
||||||
|
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
if(!defined("METACONSOLE"))
|
if (!defined("METACONSOLE"))
|
||||||
$data[0] = html_print_select ($tags_select_with, 'select_with', '', '', '', 0,
|
$data[0] = html_print_select ($tags_select_with, 'select_with', '', '', '', 0,
|
||||||
true, true, true, '', false, 'width: 120px; height: 70px;') . '<br>';
|
true, true, true, '', false, 'width: 120px; height: 70px;') . '<br>';
|
||||||
else
|
else
|
||||||
|
@ -365,7 +362,7 @@ $tabletags_without->width = '100%';
|
||||||
$tabletags_without->cellspacing = 4;
|
$tabletags_without->cellspacing = 4;
|
||||||
$tabletags_without->cellpadding = 4;
|
$tabletags_without->cellpadding = 4;
|
||||||
$tabletags_without->class = 'noshadow';
|
$tabletags_without->class = 'noshadow';
|
||||||
if(defined('METACONSOLE')){
|
if (defined('METACONSOLE')) {
|
||||||
$tabletags_without->width = '100%';
|
$tabletags_without->width = '100%';
|
||||||
$tabletags_without->class = 'nobady';
|
$tabletags_without->class = 'nobady';
|
||||||
$tabletags_without->cellspacing = 0;
|
$tabletags_without->cellspacing = 0;
|
||||||
|
@ -374,7 +371,7 @@ if(defined('METACONSOLE')){
|
||||||
$tabletags_without->styleTable = 'border: 0px;';
|
$tabletags_without->styleTable = 'border: 0px;';
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
if(!defined("METACONSOLE"))
|
if (!defined("METACONSOLE"))
|
||||||
$data[0] = html_print_select ($tags_select_without, 'select_without', '', '', '', 0,
|
$data[0] = html_print_select ($tags_select_without, 'select_without', '', '', '', 0,
|
||||||
true, true, true, '', false, 'width: 120px; height: 70px;') . '<br>';
|
true, true, true, '', false, 'width: 120px; height: 70px;') . '<br>';
|
||||||
else
|
else
|
||||||
|
@ -385,7 +382,7 @@ $data[1] = html_print_image('images/darrowright.png', true, array('id' => 'butto
|
||||||
$data[1] .= html_print_input_hidden('tag_without', $tag_without_base64, true);
|
$data[1] .= html_print_input_hidden('tag_without', $tag_without_base64, true);
|
||||||
$data[1] .= '<br><br>' . html_print_image('images/darrowleft.png', true, array('id' => 'button-remove_without', 'style' => 'cursor: pointer;', 'title' => __('Remove')));
|
$data[1] .= '<br><br>' . html_print_image('images/darrowleft.png', true, array('id' => 'button-remove_without', 'style' => 'cursor: pointer;', 'title' => __('Remove')));
|
||||||
|
|
||||||
if(!defined("METACONSOLE"))
|
if (!defined("METACONSOLE"))
|
||||||
$data[2] = html_print_select ($tag_without_temp, 'tag_without_temp', array(), '', '',
|
$data[2] = html_print_select ($tag_without_temp, 'tag_without_temp', array(), '', '',
|
||||||
0, true, true, true, '', false, "width: 120px; height: 70px;");
|
0, true, true, true, '', false, "width: 120px; height: 70px;");
|
||||||
else
|
else
|
||||||
|
@ -399,11 +396,11 @@ $tabletags_without->rowclass[] = '';
|
||||||
|
|
||||||
// EVENTS FILTER
|
// EVENTS FILTER
|
||||||
// Table for filter controls
|
// Table for filter controls
|
||||||
if(defined('METACONSOLE')){
|
if (defined('METACONSOLE')) {
|
||||||
$events_filter = '<form id="form_filter" class="filters_form" method="post" action="index.php?sec=eventos&sec2=operation/events/events&refr='.
|
$events_filter = '<form id="form_filter" class="filters_form" method="post" action="index.php?sec=eventos&sec2=operation/events/events&refr='.
|
||||||
(int)get_parameter("refr", 0) .'&pure='.$config["pure"].'&section=' . $section . '&history='.(int)$history.'">';
|
(int)get_parameter("refr", 0) .'&pure='.$config["pure"].'&section=' . $section . '&history='.(int)$history.'">';
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
$events_filter = '<form id="form_filter" method="post" action="index.php?sec=eventos&sec2=operation/events/events&refr='.
|
$events_filter = '<form id="form_filter" method="post" action="index.php?sec=eventos&sec2=operation/events/events&refr='.
|
||||||
(int)get_parameter("refr", 0) .'&pure='.$config["pure"].'&section=' . $section . '&history='.(int)$history.'">';
|
(int)get_parameter("refr", 0) .'&pure='.$config["pure"].'&section=' . $section . '&history='.(int)$history.'">';
|
||||||
}
|
}
|
||||||
|
@ -511,7 +508,7 @@ $table_advanced->data[] = $data;
|
||||||
$table_advanced->rowclass[] = '';
|
$table_advanced->rowclass[] = '';
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
if(defined('METACONSOLE'))
|
if (defined('METACONSOLE'))
|
||||||
{
|
{
|
||||||
$data[0] = '<fieldset class="" style="width: 310px;">' .
|
$data[0] = '<fieldset class="" style="width: 310px;">' .
|
||||||
'<legend>' .
|
'<legend>' .
|
||||||
|
@ -526,7 +523,7 @@ if(defined('METACONSOLE'))
|
||||||
html_print_table($tabletags_without, true) .
|
html_print_table($tabletags_without, true) .
|
||||||
'</fieldset>';
|
'</fieldset>';
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
$data[0] = '<fieldset class="databox" style="width: 310px;">' .
|
$data[0] = '<fieldset class="databox" style="width: 310px;">' .
|
||||||
'<legend>' .
|
'<legend>' .
|
||||||
__('Events with following tags') .
|
__('Events with following tags') .
|
||||||
|
@ -550,7 +547,7 @@ $table->width = '100%';
|
||||||
$table->cellspacing = 4;
|
$table->cellspacing = 4;
|
||||||
$table->cellpadding = 4;
|
$table->cellpadding = 4;
|
||||||
$table->class = 'databox';
|
$table->class = 'databox';
|
||||||
if (defined('METACONSOLE')){
|
if (defined('METACONSOLE')) {
|
||||||
$table->width = '96%';
|
$table->width = '96%';
|
||||||
$table->class = 'databox_filters';
|
$table->class = 'databox_filters';
|
||||||
}
|
}
|
||||||
|
@ -617,7 +614,7 @@ if (check_acl ($config["id_user"], 0, "EW")) {
|
||||||
$data[0] .= '<a href="javascript:" onclick="show_save_filter_dialog();">' .
|
$data[0] .= '<a href="javascript:" onclick="show_save_filter_dialog();">' .
|
||||||
html_print_image("images/disk.png", true, array("border" => '0', "title" => __('Save filter'), "alt" => __('Save filter'))) . '</a> ';
|
html_print_image("images/disk.png", true, array("border" => '0', "title" => __('Save filter'), "alt" => __('Save filter'))) . '</a> ';
|
||||||
}
|
}
|
||||||
if(defined("METACONSOLE")){
|
if (defined("METACONSOLE")) {
|
||||||
$data[0] .= '<a href="javascript:" onclick="show_load_filter_dialog();">' .
|
$data[0] .= '<a href="javascript:" onclick="show_load_filter_dialog();">' .
|
||||||
html_print_image("images/load.png", true, array("border" => '0', "title" => __('Load filter'), "alt" => __('Load filter'))) . '</a> ';
|
html_print_image("images/load.png", true, array("border" => '0', "title" => __('Load filter'), "alt" => __('Load filter'))) . '</a> ';
|
||||||
$data[0] .= '<a id="events_graph_link" href="javascript: show_events_graph_dialog()">' .
|
$data[0] .= '<a id="events_graph_link" href="javascript: show_events_graph_dialog()">' .
|
||||||
|
@ -626,7 +623,7 @@ if(defined("METACONSOLE")){
|
||||||
else
|
else
|
||||||
$data[0] .= '<a href="javascript:" onclick="show_load_filter_dialog();">' .
|
$data[0] .= '<a href="javascript:" onclick="show_load_filter_dialog();">' .
|
||||||
html_print_image("images/load.png", true, array("border" => '0', "title" => __('Load filter'), "alt" => __('Load filter'))) . '</a> <br />';
|
html_print_image("images/load.png", true, array("border" => '0', "title" => __('Load filter'), "alt" => __('Load filter'))) . '</a> <br />';
|
||||||
if(defined("METACONSOLE")){
|
if (defined("METACONSOLE")) {
|
||||||
if (empty($id_name)) {
|
if (empty($id_name)) {
|
||||||
$data[0] .= '<div id="filter_loaded_span" style="font-weight: normal">[' .
|
$data[0] .= '<div id="filter_loaded_span" style="font-weight: normal">[' .
|
||||||
__('No filter loaded') .
|
__('No filter loaded') .
|
||||||
|
@ -638,7 +635,7 @@ if(defined("METACONSOLE")){
|
||||||
']</div>';
|
']</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
if (empty($id_name)) {
|
if (empty($id_name)) {
|
||||||
$data[0] .= '<span id="filter_loaded_span" style="font-weight: normal">[' .
|
$data[0] .= '<span id="filter_loaded_span" style="font-weight: normal">[' .
|
||||||
__('No filter loaded') .
|
__('No filter loaded') .
|
||||||
|
|
Loading…
Reference in New Issue