mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add LuCI interface to bypass hosts
This commit is contained in:
parent
1a6ce527be
commit
0a1b3f2f97
7 changed files with 116 additions and 0 deletions
51
luci-app-omr-bypass/luasrc/view/omr-bypass/bypass.htm
Normal file
51
luci-app-omr-bypass/luasrc/view/omr-bypass/bypass.htm
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<%+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")
|
||||
%>
|
||||
|
||||
<% 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">
|
||||
<legend><%:Hostnames%></legend>
|
||||
<div class="cbi-section-descr"><%:Set hostname that 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">Hosts</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
|
||||
%><%=host%><%
|
||||
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
|
||||
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%>
|
||||
Loading…
Add table
Add a link
Reference in a new issue