1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00
openmptcprouter-feeds/luci-app-omr-bypass/luasrc/view/omr-bypass/bypass.htm
2018-05-15 17:20:49 +02:00

56 lines
2.3 KiB
HTML

<%+header%>
<script type="text/javascript" src="<%=resource%>/cbi.js" data-strings="{&#34;path&#34;:{&#34;resource&#34;:&#34;\/luci-static\/resources&#34;,&#34;browser&#34;:&#34;\/cgi-bin\/luci\/admin\/filebrowser&#34;},&#34;label&#34;:{&#34;choose&#34;:&#34;-- Choisir --&#34;,&#34;custom&#34;:&#34;-- autre --&#34;}}"></script>
<%
local uci = require("luci.model.uci").cursor()
local hosts = uci:get_list("dhcp", uci:get_first("dhcp","dnsmasq"), "ipset")
local ips = uci:get_list("omr-bypass", "ips", "ip")
%>
<% 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">
<div class="cbi-section-descr"><%:Set domains name, ips or networks you want to bypass.%></div>
<div class="cbi-value cbi-value-last" id="cbi-omr-tracker-hosts" data-depends="[]" data-index="<%=table.getn(hosts)%>">
<label class="cbi-value-title" for="cbid.omr-tracker.hosts"><%:Domain, IP or network%></label>
<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
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
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%>