// Show the modal window of an event function show_event_dialog(event_id, group_rep, dialog_page, result) { var ajax_file = $('#hidden-ajax_file').val(); if (dialog_page == undefined) { dialog_page = 'general'; } var similar_ids = $('#hidden-similar_ids_'+event_id).val(); var timestamp_first = $('#hidden-timestamp_first_'+event_id).val(); var timestamp_last = $('#hidden-timestamp_last_'+event_id).val(); var user_comment = $('#hidden-user_comment_'+event_id).val(); var event_rep = $('#hidden-event_rep_'+event_id).val(); var server_id = $('#hidden-server_id_'+event_id).val(); // Metaconsole mode flag var meta = $('#hidden-meta').val(); // History mode flag var history = $('#hidden-history').val(); jQuery.post (ajax_file, {"page": "include/ajax/events", "get_extended_event": 1, "group_rep": group_rep, "event_rep": event_rep, "dialog_page": dialog_page, "similar_ids": similar_ids, "timestamp_first": timestamp_first, "timestamp_last": timestamp_last, "user_comment": user_comment, "event_id": event_id, "server_id": server_id, "meta": meta, "history": history}, function (data, status) { $("#event_details_window").hide () .empty () .append (data) .dialog ({ title: get_event_name(event_id, meta, history), resizable: true, draggable: true, modal: true, overlay: { opacity: 0.5, background: "black" }, width: 725, height: 510 }) .show (); switch (result) { case 'comment_ok': $('#notification_comment_success').show(); break; case 'comment_error': $('#notification_comment_error').show(); break; case 'status_ok': $('#notification_status_success').show(); break; case 'status_error': $('#notification_status_error').show(); break; case 'owner_ok': $('#notification_owner_success').show(); break; case 'owner_error': $('#notification_owner_error').show(); break; } forced_title_callback(); }, "html" ); return false; } function show_save_filter_dialog() { $('input:radio[name="filter_mode"]').filter('[value="new"]').trigger('click'); $("#save_filter_layer").dialog ({ title: $('#save_filter_text').html(), resizable: true, draggable: true, modal: true, overlay: { opacity: 0.5, background: "black" }, width: 420, height: 200 }) .show (); return false; } function show_load_filter_dialog() { $("#load_filter_layer").dialog ({ title: $('#load_filter_text').html(), resizable: true, draggable: true, modal: true, overlay: { opacity: 0.5, background: "black" }, width: 420, height: 200 }) .show (); return false; } // Check the response type and open it in a modal dialog or new window function execute_response(event_id, server_id) { var response_id = $('#select_custom_response option:selected').val(); var response = get_response(response_id); // If cannot get response abort it if (response == null) { return; } response['target'] = get_response_target(event_id, response_id, server_id); switch(response['type']) { case 'command': show_response_dialog(event_id, response_id, response); break; case 'url': if (response['new_window'] == 1) { window.open(response['target'],'_blank'); } else { show_response_dialog(event_id, response_id, response); } break; } } //Show the modal window of an event response function show_response_dialog(event_id, response_id, response) { var ajax_file = $('#hidden-ajax_file').val(); var params = []; params.push("page=include/ajax/events"); params.push("dialogue_event_response=1"); params.push("event_id="+event_id); params.push("target="+response['target']); params.push("response_id="+response_id); jQuery.ajax ({ data: params.join ("&"), type: 'POST', url: action=ajax_file, async: false, timeout: 10000, dataType: 'html', success: function (data) { $("#event_response_window").hide () .empty () .append (data) .dialog ({ title: $('#select_custom_response option:selected').html(), resizable: true, draggable: true, modal: false, open: function(event, ui) { perform_response(response['target']); }, width: response['modal_width'], height: response['modal_height'] }) .show (); } }); } // Get an event response from db function get_response(response_id) { var ajax_file = $('#hidden-ajax_file').val(); var response = ''; var params = []; params.push("page=include/ajax/events"); params.push("get_response=1"); params.push("response_id="+response_id); jQuery.ajax ({ data: params.join ("&"), type: 'POST', url: action=ajax_file, async: false, timeout: 10000, dataType: 'json', success: function (data) { response = data; } }); return response; } // Get an event response params from db function get_response_params(response_id) { var ajax_file = $('#hidden-ajax_file').val(); var response_params; var params = []; params.push("page=include/ajax/events"); params.push("get_response_params=1"); params.push("response_id="+response_id); jQuery.ajax ({ data: params.join ("&"), type: 'POST', url: action=ajax_file, async: false, timeout: 10000, dataType: 'json', success: function (data) { response_params = data; } }); return response_params; } // Get an event response description from db function get_response_description(response_id) { var ajax_file = $('#hidden-ajax_file').val(); var response_description = ''; var params = []; params.push("page=include/ajax/events"); params.push("get_response_description=1"); params.push("response_id="+response_id); jQuery.ajax ({ data: params.join ("&"), type: 'POST', url: action=ajax_file, async: false, timeout: 10000, dataType: 'html', success: function (data) { response_description = data; } }); return response_description; } // Get an event response description from db function get_event_name(event_id, meta, history) { var ajax_file = $('#hidden-ajax_file').val(); var name = ''; var params = []; params.push("page=include/ajax/events"); params.push("get_event_name=1"); params.push("event_id="+event_id); params.push("meta="+meta); params.push("history="+history); jQuery.ajax ({ data: params.join ("&"), type: 'POST', url: action=ajax_file, async: false, timeout: 10000, dataType: 'html', success: function (data) { name = data; } }); return name; } function add_row_param(id_table, param) { $('#'+id_table).append('