mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 18:41:51 +00:00
Add latest version in interface and dynamic master option
This commit is contained in:
parent
8ab281e9df
commit
1dbe57436b
3 changed files with 22 additions and 8 deletions
|
@ -404,31 +404,32 @@ function settings_add()
|
|||
|
||||
ucic:save("shadowsocks-libev")
|
||||
ucic:commit("shadowsocks-libev")
|
||||
|
||||
|
||||
-- Set master to dynamic or static
|
||||
local master_type = luci.http.formvalue("master_type") or "static"
|
||||
ucic:set("openmptcprouter","settings","master",master_type)
|
||||
|
||||
-- Set CPU scaling minimum frequency
|
||||
local scaling_min_freq = luci.http.formvalue("scaling_min_freq") or ""
|
||||
if scaling_min_freq ~= "" then
|
||||
ucic:set("openmptcprouter","settings","scaling_min_freq",scaling_min_freq)
|
||||
ucic:save("openmptcprouter")
|
||||
ucic:commit("openmptcprouter")
|
||||
end
|
||||
|
||||
-- Set CPU scaling maximum frequency
|
||||
local scaling_max_freq = luci.http.formvalue("scaling_max_freq") or ""
|
||||
if scaling_max_freq ~= "" then
|
||||
ucic:set("openmptcprouter","settings","scaling_max_freq",scaling_max_freq)
|
||||
ucic:save("openmptcprouter")
|
||||
ucic:commit("openmptcprouter")
|
||||
end
|
||||
|
||||
-- Set CPU governor
|
||||
local scaling_governor = luci.http.formvalue("scaling_governor") or ""
|
||||
if scaling_governor ~= "" then
|
||||
ucic:set("openmptcprouter","settings","scaling_governor",scaling_governor)
|
||||
ucic:save("openmptcprouter")
|
||||
ucic:commit("openmptcprouter")
|
||||
end
|
||||
|
||||
ucic:save("openmptcprouter")
|
||||
ucic:commit("openmptcprouter")
|
||||
|
||||
luci.sys.call("/etc/init.d/openmptcprouter restart >/dev/null 2>/dev/null")
|
||||
|
||||
-- Done, redirect
|
||||
|
@ -508,6 +509,9 @@ function interfaces_status()
|
|||
mArray.openmptcprouter = {}
|
||||
mArray.openmptcprouter["version"] = ut.trim(sys.exec("cat /etc/os-release | grep VERSION= | sed -e 's:VERSION=::'"))
|
||||
|
||||
mArray.openmptcprouter["latest_version_omr"] = uci:get("openmptcprouter", "latest_versions", "omr") or ""
|
||||
mArray.openmptcprouter["latest_version_vps"] = uci:get("openmptcprouter", "latest_versions", "vps") or ""
|
||||
|
||||
mArray.openmptcprouter["service_addr"] = uci:get("shadowsocks-libev", "sss0", "server") or ""
|
||||
mArray.openmptcprouter["local_addr"] = uci:get("network", "lan", "ipaddr")
|
||||
mArray.openmptcprouter["server_mptcp"] = ""
|
||||
|
|
|
@ -25,6 +25,12 @@
|
|||
<input type="checkbox" name="disable_ipv6" class="cbi-input-checkbox" value="1" <% if tonumber((luci.sys.exec("sysctl net.ipv6.conf.all.disable_ipv6")):match(" %d+")) == 1 then %>checked<% end %>>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:Dynamic master interface%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="checkbox" name="master_type" class="cbi-input-checkbox" value="dynamic" <% if luci.model.uci.cursor():get("openmptcprouter","settings","master") == "dynamic" then %>checked<% end %>>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:Enable ShadowSocks OBFS%></label>
|
||||
<div class="cbi-value-field">
|
||||
|
|
|
@ -73,7 +73,11 @@
|
|||
|
||||
if (mArray.openmptcprouter.version)
|
||||
{
|
||||
content += "Version " + mArray.openmptcprouter.version;
|
||||
content += "Version " + mArray.openmptcprouter.version.replace(/\"/g,'');
|
||||
if (mArray.openmptcprouter.latest_version_omr)
|
||||
{
|
||||
content += "<br><i>(Latest available version " + mArray.openmptcprouter.latest_version_omr + ")</i>";
|
||||
}
|
||||
content += "<br />";
|
||||
}
|
||||
if (mArray.openmptcprouter.loadavg)
|
||||
|
|
Loading…
Reference in a new issue