Adds contextual 'download flows' and 'extract pcap' buttons

Download flows and extract pcap buttons are now available in
the Pro edition. These buttons are shown at the bottom of the
historical pages (e.g., flows, talkers, and protocols) and
make requests that keep into account filters specified by the user
This commit is contained in:
Simone Mainardi 2016-03-02 00:06:44 +01:00
parent f97ee78d42
commit c3f96646c5
2 changed files with 99 additions and 55 deletions

View file

@ -1017,12 +1017,23 @@ if(host ~= nil) then
end
end
-- prepare some attributes that will be attached to divs
local div_data = ""
if epoch_begin ~= "" and epoch_begin ~= nil then
div_data = div_data..' epoch_begin="'..tostring(epoch_begin)..'" '
end
if epoch_end ~= "" and epoch_end ~= nil then
div_data = div_data..' epoch_end="'..tostring(epoch_end)..'" '
end
if host ~= "" and host ~= nil then
div_data = div_data..' host="'..tostring(host)..'" '
end
if (not((limitv4 == nil) or (limitv4 == "") or (limitv4 == "0"))) then
print [[
<div class="tab-pane fade" id="ipv4">
<div class="tab-pane fade" id="ipv4" ]] print(div_data) print[[">
<div id="table-flows4"></div>
<i class="fa fa-download fa-lg"></i> <A HREF="]] print(url_update.."&version=4&format=txt") print [[">Download Flows</A>
]] historicalDownloadButtonsBar('flows_v4', 'ipv4') print[[
</div>
]]
else
@ -1035,9 +1046,9 @@ end
if(not((limitv6 == nil) or (limitv6 == "") or (limitv6 == "0"))) then
print[[
<div class="tab-pane fade" id="ipv6">
<div class="tab-pane fade" id="ipv6" ]] print(div_data) print[[">
<div id="table-flows6"></div>
<i class="fa fa-download fa-lg"></i> <A HREF="]] print(url_update.."&version=6&format=txt") print [[">Download Flows</A>
]] historicalDownloadButtonsBar('flows_v6', 'ipv6') print[[
</div>
]]
else