1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Fix list of available protocols

This commit is contained in:
Ycarus 2018-06-22 12:31:35 +02:00
parent d90d5ea374
commit d8f97eaaf7

View file

@ -10,7 +10,6 @@
local tmpfile = os.tmpname()
local dpi_available_proto = luci.util.execi("cat /proc/net/xt_ndpi/proto | awk '{print $3}' | sort -u | head -n -1")
%>
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
<form class="inline" method="post" action="<%=url('admin/services/omr-bypass/add')%>">
<div class="cbi-map">
@ -64,12 +63,21 @@
<div class="cbi-value cbi-value-last" id="cbi-omr-tracker-dpi" data-depends="[]" data-index="<%=table.getn(dpi)%>">
<label class="cbi-value-title" for="cbid.omr-tracker.dpi"><%:Protocol%></label>
<div class="cbi-value-field">
<%
<%
local allprt="&#34;&#34;"
for prt in dpi_available_proto do
allprt=allprt .. ",&#34;" .. prt .. "&#34;"
local protos = {}
for l in io.lines("/proc/net/xt_ndpi/proto") do
local a,b,c,d = l:match('(%w+) (%w+)')
if b ~= "2" and not string.match(b,"custom") then
table.insert(protos,b)
end
end
%>
table.sort(protos)
for _,b in ipairs(protos) do
allprt=allprt .. ",&#34;" .. b .. "&#34;"
end
%>
<div data-prefix="cbid.omr-bypass.dpi" data-browser-path="" data-dynlist="[[<%=allprt%>],[<%=allprt%>],null,false]">
<%