mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Check recording window when download a pcap from alerts
This commit is contained in:
parent
b9287db3aa
commit
1fbb119b16
2 changed files with 27 additions and 2 deletions
|
|
@ -151,7 +151,7 @@ function ui_utils.draw_pcap_download_dialog(ifid)
|
|||
return true;
|
||||
}
|
||||
|
||||
function pcapDownload(epoch_begin, epoch_end, bpf_filter) {
|
||||
function pcapShowModal(epoch_begin, epoch_end, bpf_filter) {
|
||||
var modalID = "]] print(modalID) print [[";
|
||||
var date_begin = new Date(epoch_begin * 1000);
|
||||
var date_end = new Date(epoch_end * 1000);
|
||||
|
|
@ -176,6 +176,31 @@ function ui_utils.draw_pcap_download_dialog(ifid)
|
|||
});
|
||||
}
|
||||
|
||||
function pcapDownload(epoch_begin, epoch_end, bpf_filter) {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ']] print(ntop.getHttpPrefix().."/lua/check_recording_data.lua") print [[',
|
||||
data: {
|
||||
epoch_begin: epoch_begin,
|
||||
epoch_end: epoch_end
|
||||
}, error: function(err) {
|
||||
console.error(err);
|
||||
}, success: function(data) {
|
||||
if(!data.available) {
|
||||
if(data.extraction_checks_msg) {
|
||||
$("#no-recording-data-message").html(data.extraction_checks_msg);
|
||||
} else {
|
||||
$("#no-recording-data-message").html(']] print(i18n("traffic_recording.no_recorded_data")) print[[');
|
||||
}
|
||||
$("#no-recording-data").modal("show");
|
||||
return;
|
||||
}
|
||||
|
||||
pcapShowModal(epoch_begin, epoch_end, bpf_filter);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitPcapDownload(form) {
|
||||
var frm = $('#'+form.id);
|
||||
window.open(']] print(ntop.getHttpPrefix()) print [[/lua/rest/v2/get/pcap/live_extraction.lua?' + frm.serialize(), '_self', false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue