mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Fix block flow button in host flows page
This commit is contained in:
parent
c78fe49697
commit
3802913084
5 changed files with 48 additions and 31 deletions
|
|
@ -1887,3 +1887,39 @@ function printFlowSNMPInfo(snmpdevice, input_idx, output_idx)
|
|||
end
|
||||
|
||||
-- #######################
|
||||
|
||||
function printBlockFlowJs()
|
||||
print[[
|
||||
var block_flow_csrf = "]] print(ntop.getRandomCSRFValue()) print[[";
|
||||
|
||||
function block_flow(flow_key) {
|
||||
var url = "]] print(ntop.getHttpPrefix()) print[[/lua/pro/nedge/block_flow.lua";
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: url,
|
||||
cache: false,
|
||||
data: {
|
||||
csrf: block_flow_csrf,
|
||||
flow_key: flow_key
|
||||
},
|
||||
success: function(content) {
|
||||
var data = jQuery.parseJSON(content);
|
||||
block_flow_csrf = data.csrf;
|
||||
if (data.status == "BLOCKED") {
|
||||
$('#'+flow_key+'_info').find('.block-badge')
|
||||
.removeClass('label-default')
|
||||
.addClass('label-danger')
|
||||
.attr('title', ']] print(i18n("flow_details.flow_traffic_is_dropped")) print[[');
|
||||
$('#'+flow_key+'_application, #'+flow_key+'_l4, #'+flow_key+'_client, #'+flow_key+'_server')
|
||||
.css("text-decoration", "line-through");
|
||||
}
|
||||
},
|
||||
error: function(content) {
|
||||
console.log("error");
|
||||
}
|
||||
});
|
||||
}
|
||||
]]
|
||||
end
|
||||
|
||||
-- #######################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue