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

Interfaces can be added from wizard

This commit is contained in:
Ycarus 2018-04-20 14:56:19 +02:00
parent 531851d3c2
commit 1e4d24bdaa
2 changed files with 78 additions and 26 deletions

View file

@ -5,6 +5,7 @@
local net = require "luci.model.network".init()
local ifaces = net:get_interfaces()
%>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
<form class="inline" method="post" action="<%=url('admin/system/openmptcprouter/wizard_add')%>">
@ -41,40 +42,49 @@
local ifname = iface:name()
if (ifname:match("^wan.*")) then
%>
<div class="cbi-section-remove right">
<input type="submit" name="delete.<%=ifname%>" value="<%:Delete%>" class="cbi-button" />
</div>
<h3><%=ifname%></h3>
<input type="hidden" name="intf.<%=ifname%>" value="<%=ifname%>" />
<div class="cbi-value">
<label class="cbi-value-title"><%:IPv4 address%></label>
<div class="cbi-value-field">
<input type="text" name="cbid.network.<%=ifname%>.ipaddr" class="cbi-input-text" value="<%=uci:get("network",ifname,"ipaddr")%>" data-type="ip4addr">
<br />
<div class="cbi-value-description">
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="help" /></span>
<%:Set an IP in the same network as the modem%>
<fieldset class="cbi-section-node" id="cbi-openmptcprouter-<%=ifname%>">
<input type="hidden" name="intf.<%=ifname%>" value="<%=ifname%>" />
<div class="cbi-value">
<label class="cbi-value-title"><%:IPv4 address%></label>
<div class="cbi-value-field">
<input type="text" name="cbid.network.<%=ifname%>.ipaddr" class="cbi-input-text" value="<%=uci:get("network",ifname,"ipaddr")%>" data-type="ip4addr">
<br />
<div class="cbi-value-description">
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="help" /></span>
<%:Set an IP in the same network as the modem%>
</div>
</div>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:IPv4 netmask%></label>
<div class="cbi-value-field">
<input type="text" name="cbid.network.<%=ifname%>.netmask" class="cbi-input-text" value="<%=uci:get("network",ifname,"netmask") or "255.255.255.0"%>" data-type="ip4addr">
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:IPv4 gateway%></label>
<div class="cbi-value-field">
<input type="text" name="cbid.network.<%=ifname%>.gateway" class="cbi-input-text" value="<%=uci:get("network",ifname,"gateway")%>" data-type="ip4addr">
<br />
<div class="cbi-value-description">
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="help" /></span>
<%:Set here IP of the modem%>
<div class="cbi-value">
<label class="cbi-value-title"><%:IPv4 netmask%></label>
<div class="cbi-value-field">
<input type="text" name="cbid.network.<%=ifname%>.netmask" class="cbi-input-text" value="<%=uci:get("network",ifname,"netmask") or "255.255.255.0"%>" data-type="ip4addr">
</div>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:IPv4 gateway%></label>
<div class="cbi-value-field">
<input type="text" name="cbid.network.<%=ifname%>.gateway" class="cbi-input-text" value="<%=uci:get("network",ifname,"gateway")%>" data-type="ip4addr">
<br />
<div class="cbi-value-description">
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="help" /></span>
<%:Set here IP of the modem%>
</div>
</div>
</div>
</fieldset>
<%
end
end
%>
<div class="cbi-section-create">
<input class="cbi-button cbi-button-add" type="submit" name="add_interface" value="<%:Add an interface%>" title="<%:Add an interface%>" />
</div>
</fieldset>
</div>
<div class="cbi-page-actions">