2018-04-07 20:13:33 +00:00
< %+header%>
< script type = "text/javascript" src = "<%=resource%>/cbi.js" data-strings = "{"path":{"resource":"\/luci-static\/resources","browser":"\/cgi-bin\/luci\/admin\/filebrowser"},"label":{"choose":"-- Choisir --","custom":"-- autre --"}}" > < / script >
< %
local uci = require("luci.model.uci").cursor()
local hosts = uci:get_list("dhcp", uci:get_first("dhcp","dnsmasq"), "ipset")
2018-05-15 15:20:49 +00:00
local ips = uci:get_list("omr-bypass", "ips", "ip")
2018-04-07 20:13:33 +00:00
%>
< % 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" >
< h2 name = "content" > < %:Bypass%>< / h2 >
< fieldset class = "cbi-section" id = "hosts" >
2018-06-14 13:38:31 +00:00
< div class = "cbi-section-descr" > < %:Set domains name, ips or networks you want to bypass.%>< / div >
2018-04-07 20:13:33 +00:00
< div class = "cbi-value cbi-value-last" id = "cbi-omr-tracker-hosts" data-depends = "[]" data-index = "<%=table.getn(hosts)%>" >
2018-05-15 15:20:49 +00:00
< label class = "cbi-value-title" for = "cbid.omr-tracker.hosts" > < %:Domain, IP or network%>< / label >
2018-04-07 20:13:33 +00:00
< div class = "cbi-value-field" >
< div data-prefix = "cbid.omr-bypass.hosts" data-browser-path = "" data-dynlist = "[[],[],null,false]" data-placeholder = "google.com" >
< %
local j = 1
for _ , host in pairs(hosts) do
j = j+1
for hst in string.gmatch(host,"([^/]*)/") do
if hst ~= "" then
%>
< input class = "cbi-input-text" value = "<%=hst%>" data-update = "change" type = "text" id = "cbid.omr-bypass.hosts.<%=j%>" name = "cbid.omr-bypass.hosts" placeholder = "google.com" / > < br / >
< %
end
end
end
2018-05-15 15:20:49 +00:00
for _ , ip in pairs(ips) do
j = j+1
%>
< input class = "cbi-input-text" value = "<%=ip%>" data-update = "change" type = "text" id = "cbid.omr-bypass.hosts.<%=j%>" name = "cbid.omr-bypass.hosts" placeholder = "google.com" / > < br / >
< %
end
2018-04-07 20:13:33 +00:00
if j == 1 then
%>
< input class = "cbi-input-text" value = "" data-update = "change" type = "text" id = "cbid.omr-bypass.hosts.1" name = "cbid.omr-bypass.hosts" placeholder = "google.com" / > < br / >
< %
end
%>
< / div >
< / div >
< / div >
< / fieldset >
< / div >
< div class = "cbi-page-actions" >
< input type = "hidden" name = "token" value = "<%=token%>" / >
< button class = "btn" type = "submit" > Submit< / button >
< / div >
< / form >
< script type = "text/javascript" > cbi _init ( ) ; < / script >
< %+footer%>