1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 19:11:51 +00:00
openmptcprouter-feeds/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm

184 lines
8 KiB
HTML
Raw Normal View History

<%+header%>
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
<%
local latest_omr_version=luci.model.uci.cursor():get("openmptcprouter","latest_versions","vps")
omr_test = false
uci:foreach("openmptcprouter","server", function(s)
servername = s[".name"]
local omr_version=luci.model.uci.cursor():get("openmptcprouter",servername,"omr_version")
if omr_version ~= "" and latest_omr_version ~= "" and omr_version ~= latest_omr_version then
omr_test = true
end
end)
if omr_test == true then
%>
<form class="inline" method="post" action="<%=url('admin/system/openmptcprouter/update_vps')%>">
<div class="cbi-map">
2018-12-13 15:46:40 +00:00
<h2 name="content"><%:Update VPS%></h2>
<fieldset class="cbi-section" id="update">
<div class="cbi-section-descr"><%:Update remotly OpenMPTCProuter server to latest version when needed.%> <b><%:Beta%></b></div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Update OpenMPTCProuter server%></label>
<div class="cbi-value-field">
<input type="hidden" name="token" value="<%=token%>" />
<input type="hidden" name="server" value="<%=servername%>" />
<input type="hidden" name="flash" value="1" />
<input type="submit" name="update_vps" class="cbi-button cbi-button-apply" value="<%:Update%>">
</div>
</div>
</div>
</form>
<%
end
%>
<form class="inline" method="post" action="<%=url('admin/system/openmptcprouter/settings_add')%>">
<div class="cbi-map">
<h2 name="content"><%:Advanced Settings%></h2>
<fieldset class="cbi-section" id="networks">
<legend><%:VPS settings%></legend>
<%
uci:foreach("openmptcprouter","server", function(s)
servername = s[".name"]
%>
<h3><%=servername%></h3>
<div class="cbi-section-node">
<div class="cbi-section-descr"></div>
<div class="cbi-value">
2019-01-07 06:54:18 +00:00
<label class="cbi-value-title"><%:Redirects all ports from server to OpenMPTCProuter%></label>
<div class="cbi-value-field">
<input type="hidden" name="server.<%=servername%>" value="<%=servername%>" />
<input type="checkbox" name="redirect_ports.<%=servername%>" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("openmptcprouter",servername,"redirect_ports") == "1" then %>checked<% end %>>
</div>
</div>
</div>
<%
end)
%>
<%
local obfs_installed = nixio.fs.access("/usr/bin/obfs-local")
local v2ray_installed = nixio.fs.access("/usr/bin/obfs-local")
if obfs_installed or v2ray_installed then
%>
<div class="cbi-value">
2019-01-26 12:51:53 +00:00
<label class="cbi-value-title"><%:Enable ShadowSocks Obfuscating%></label>
<div class="cbi-value-field">
<input type="checkbox" name="obfs" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("shadowsocks-libev","tracker","obfs") == "1" then %>checked<% end %>>
<br />
<div class="cbi-value-description">
2019-01-26 12:51:53 +00:00
<%:Obfuscating will be enabled on both side%>
</div>
2019-01-26 12:51:53 +00:00
</div>
2019-01-28 17:28:56 +00:00
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Obfuscating plugin%></label>
2019-01-26 12:51:53 +00:00
<div class="cbi-value-field">
<select class="cbi-input-select" name="obfs_plugin">
<%
if v2ray_installed then
%>
2019-01-26 12:51:53 +00:00
<option value="v2ray" <% if luci.model.uci.cursor():get("shadowsocks-libev","tracker","obfs_plugin") == "v2ray" then %>selected="selected"<% end %>>v2ray</option>
<%
end
if obfs_installed then
%>
2019-01-26 12:51:53 +00:00
<option value="obfs" <% if luci.model.uci.cursor():get("shadowsocks-libev","tracker","obfs_plugin") == "obfs" then %>selected="selected"<% end %>>simple-obfs</option>
<%
end
%>
2019-01-26 12:51:53 +00:00
</select>
</div>
</div>
<%
end
%>
2019-01-07 06:54:18 +00:00
</div>
</fieldset>
<fieldset class="cbi-section" id="networks">
<legend><%:Networks settings%></legend>
<div class="cbi-section-descr"></div>
<div class="cbi-value">
<label class="cbi-value-title"><%:IPv4 TCP Keepalive time%></label>
<div class="cbi-value-field">
<input type="text" name="tcp_keepalive_time" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("sysctl net.ipv4.tcp_keepalive_time")):match(" %d+"))%>">
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:IPv4 TCP FIN timeout%></label>
<div class="cbi-value-field">
<input type="text" name="tcp_fin_timeout" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("sysctl net.ipv4.tcp_fin_timeout")):match(" %d+"))%>">
</div>
</div>
2018-12-23 13:14:28 +00:00
<div class="cbi-value">
<label class="cbi-value-title"><%:IPv4 TCP SYN retries%></label>
<div class="cbi-value-field">
<input type="text" name="tcp_syn_retries" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("sysctl net.ipv4.tcp_syn_retries")):match(" %d+"))%>">
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:IPv4 TCP Fast Open%></label>
<div class="cbi-value-field">
<input type="text" name="tcp_fastopen" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("sysctl net.ipv4.tcp_fastopen")):match(" %d+"))%>">
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Disable IPv6%></label>
<div class="cbi-value-field">
<input type="checkbox" name="disable_ipv6" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("openmptcprouter","settings","disable_ipv6") == 1 then %>checked<% end %>>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Master interface selection%></label>
<div class="cbi-value-field">
<select class="cbi-input-select" name="master_type">
<option value="change" <% if luci.model.uci.cursor():get("openmptcprouter","settings","master") == "change" then %>selected="selected"<% end %>><%:On wizard change%></option>
<option value="dynamic" <% if luci.model.uci.cursor():get("openmptcprouter","settings","master") == "dynamic" then %>selected="selected"<% end %>><%:Dynamic change%></option>
<option value="static" <% if luci.model.uci.cursor():get("openmptcprouter","settings","master") == "static" then %>selected="selected"<% end %>><%:No change%></option>
</select>
2018-07-09 12:55:42 +00:00
</div>
</div>
</fieldset>
2018-04-17 07:27:15 +00:00
<% if nixio.fs.access("/sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq") then %>
<fieldset class="cbi-section" id="system">
<legend><%:Systems settings%></legend>
<div class="cbi-section-descr"></div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Minimum scaling CPU frequency%></label>
<div class="cbi-value-field">
2018-04-17 12:48:55 +00:00
<input type="text" name="scaling_min_freq" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("cat /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq")):match("%d+"))%>">
2018-04-17 07:27:15 +00:00
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Maximum scaling CPU frequency%></label>
<div class="cbi-value-field">
2018-04-17 12:48:55 +00:00
<input type="text" name="scaling_max_freq" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq")):match("%d+"))%>">
2018-04-17 07:27:15 +00:00
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Scaling governor%></label>
<div class="cbi-value-field">
<select class="cbi-input-select" name="scaling_governor">
<%
2018-04-17 12:48:55 +00:00
governor=luci.util.trim(luci.sys.exec("cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor"))
2018-04-17 07:27:15 +00:00
available_governors=luci.sys.exec("cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors")
for gov in string.gmatch(available_governors, "[^%s]+") do
%>
2018-04-17 12:48:55 +00:00
<option value="<%=gov%>" <% if governor == gov then %>selected="selected"<% end %>><%=gov%></option>
2018-04-17 07:27:15 +00:00
<%
end
%>
</select>
</div>
</div>
</fieldset>
<% end %>
</div>
<div class="cbi-page-actions">
<input type="hidden" name="token" value="<%=token%>" />
<input class="cbi-button cbi-button-apply" type="submit" value="<%:Save & Apply%>" /> <input class="cbi-button cbi-button-reset" type="button" value="Reset" onclick="location.href='<%=url('admin/system/openmptcprouter/settings')%>'" />
</div>
</form>
<%+footer%>