mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Added the ability to upload a pcap file for analysis
This commit is contained in:
parent
932254f3f3
commit
fa51a2b4e8
10 changed files with 295 additions and 93 deletions
35
scripts/lua/upload_pcap.lua
Normal file
35
scripts/lua/upload_pcap.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
--
|
||||
-- (C) 2013-21 - ntop.org
|
||||
--
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
require "lua_utils"
|
||||
local ts_utils = require("ts_utils")
|
||||
local info = ntop.getInfo()
|
||||
local page_utils = require("page_utils")
|
||||
|
||||
sendHTTPContentTypeHeader('text/html')
|
||||
|
||||
local info = ntop.getInfo()
|
||||
page_utils.set_active_menu_entry(page_utils.menu_entries.about, { product=info.product })
|
||||
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
|
||||
|
||||
-- accept=".pcap"
|
||||
|
||||
if isAdministrator() then
|
||||
print("<H3>"..i18n("analyze_pcap").."</H3>")
|
||||
|
||||
print [[
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr><td>
|
||||
<form action="]] print(ntop.getHttpPrefix()) print [[/lua/analyze_pcap.lua" method=POST enctype="multipart/form-data">
|
||||
<input type="file" id="pcap" name="pcap">
|
||||
<input type="submit" value="]] print(i18n("upload_pcap")) print [[">
|
||||
</form>
|
||||
</td></tr>
|
||||
</table>
|
||||
]]
|
||||
end
|
||||
|
||||
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")
|
||||
Loading…
Add table
Add a link
Reference in a new issue