mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-13 19:11:51 +00:00
136 lines
6.2 KiB
HTML
136 lines
6.2 KiB
HTML
<%+header%>
|
|
|
|
<%
|
|
local uci = require("luci.model.uci").cursor()
|
|
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')%>">
|
|
<div class="cbi-map">
|
|
<h2 name="content"><%:Wizard%></h2>
|
|
<fieldset class="cbi-section" id="server">
|
|
<legend><%:Server settings%></legend>
|
|
<div class="cbi-section-descr"><%:Put the values given by OpenMPTCProuter VPS script.%></div>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:Server IP%></label>
|
|
<div class="cbi-value-field">
|
|
<input type="text" name="server_ip" placeholder="Server IP" class="cbi-input-text" value="<%=uci:get("shadowsocks-libev","sss0","server")%>" 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>
|
|
<%:Server IP will be set for ShadowSocks, Glorytun and MLVPN%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:ShadowSocks key%></label>
|
|
<div class="cbi-value-field">
|
|
<input type="text" name="shadowsocks_key" placeholder="ShadowSocks key" class="cbi-input-text" value="<%=uci:get("shadowsocks-libev","sss0","key")%>" data-type="base64">
|
|
<br />
|
|
<div class="cbi-value-description">
|
|
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="help" /></span>
|
|
<%:ShadowSocks is used for TCP%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:Glorytun key%></label>
|
|
<div class="cbi-value-field">
|
|
<input type="text" name="glorytun_key" placeholder="Glorytun key" class="cbi-input-text" value="<%=uci:get("glorytun","vpn","key")%>">
|
|
<br />
|
|
<div class="cbi-value-description">
|
|
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="help" /></span>
|
|
<%:Glorytun TCP is used by default for UDP and ICMP%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:MLVPN password%></label>
|
|
<div class="cbi-value-field">
|
|
<input type="text" name="mlvpn_password" placeholder="MLVPN password" class="cbi-input-text" value="<%=uci:get("mlvpn","general","password")%>">
|
|
<br />
|
|
<div class="cbi-value-description">
|
|
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="help" /></span>
|
|
<%:MLVPN can replace Glorytun with connections with same latency%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:Default VPN%></label>
|
|
<div class="cbi-value-field">
|
|
<select class="cbi-input-select" name="default_vpn" size="1">
|
|
<option value="glorytun_tcp" <% if uci:get("glorytun","vpn","enable") == "1" and uci:get("glorytun","vpn","proto") == "tcp" then %>selected="selected"<% end %>>Glorytun TCP</option>
|
|
<option value="glorytun_udp" <% if uci:get("glorytun","vpn","enable") == "1" and uci:get("glorytun","vpn","proto") == "udp" then %>selected="selected"<% end %>>Glorytun UDP</option>
|
|
<option value="mlvpn" <% if uci:get("mlvpn","general","enable") == "1" then %>selected="selected"<% end %>>MLVPN</option>
|
|
</select>
|
|
<br />
|
|
<div class="cbi-value-description">
|
|
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="help" /></span>
|
|
<%:Set the default VPN used for UDP and ICMP when ShadowSocks is enabled, for all traffic if ShadowSocks is disabled.%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
<fieldset class="cbi-section" id="interfaces">
|
|
<legend><%:Interfaces settings%></legend>
|
|
<div class="cbi-section-descr"><%:You must disable DHCP on your modems and set IP in different networks.%></div>
|
|
<%
|
|
for _, iface in ipairs(ifaces) do
|
|
--if not (iface == "lo" or iface:match("^tun.*")) then
|
|
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>
|
|
<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 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>
|
|
</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">
|
|
<input type="hidden" name="token" value="<%=token%>" />
|
|
<button class="btn" type="submit">Submit</button>
|
|
</div>
|
|
</form>
|
|
<%+footer%>
|