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

Merge pull request #13 from Ysurac/develop

tongbu
This commit is contained in:
suyuan 2020-10-23 17:04:58 +08:00 committed by GitHub
commit ef05043c30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 17 deletions

View file

@ -58,6 +58,7 @@ function multipath_bandwidth()
uci:foreach("network", "interface", function(s)
local intname = s[".name"]
local label = s["label"]
local dev = get_device(intname)
if dev == "" then
dev = get_device(s["ifname"])
@ -75,9 +76,17 @@ function multipath_bandwidth()
local bwc = luci.sys.exec("luci-bwc -i %q 2>/dev/null" % dev) or ""
if bwc ~= nil then
--result[dev] = "[" .. string.gsub(bwc, '[\r\n]', '') .. "]"
result[intname] = "[" .. string.gsub(bwc, '[\r\n]', '') .. "]"
if label ~= nil then
result[intname .. " (" .. label .. ")" ] = "[" .. string.gsub(bwc, '[\r\n]', '') .. "]"
else
result[intname] = "[" .. string.gsub(bwc, '[\r\n]', '') .. "]"
end
else
result[intname] = "[]"
if label ~= nil then
result[intname .. " (" .. label .. ")" ] = "[]"
else
result[intname] = "[]"
end
end
end
end

View file

@ -59,21 +59,21 @@
function stringToColour(str) {
if(str == "total")
return "OrangeRed";
if(str == "wan")
if(str.substring(0, 4) == "wan")
return "FireBrick";
if(str == "wan1")
if(str.substring(0, 4) == "wan1")
return "DeepSkyBlue";
if(str == "wan2")
if(str.substring(0, 4) == "wan2")
return "SeaGreen";
if(str == "wan3")
if(str.substring(0, 4) == "wan3")
return "PaleGreen";
if(str == "wan4")
if(str.substring(0, 4) == "wan4")
return "PowderBlue";
if(str == "wan5")
if(str.substring(0, 4) == "wan5")
return "Salmon";
if(str == "wan6")
if(str.substring(0, 4) == "wan6")
return "LightGreen";
if(str == "wan7")
if(str.substring(0, 4) == "wan7")
return "PaleTurquoise";
// Generate a color folowing the name
Math.seedrandom(str);
@ -893,9 +893,13 @@ window.setTimeout(function()
<ul class="cbi-tabmenu">
<% for _, dev in ipairs(devices) do
local ifname = get_device(dev)
%>
<li class="cbi-tab<%= ifname == curifname and "" or "-disabled" %>"><a href="?dev=<%=pcdata(get_device(dev))%>"><%=pcdata(dev)%></a></li>
local label = uci:get("network",dev,"label")
if label ~= nil then
%>
<li class="cbi-tab<%= ifname == curifname and "" or "-disabled" %>"><a href="?dev=<%=pcdata(get_device(dev))%>"><%=label%></a></li>
<% else %>
<li class="cbi-tab<%= ifname == curifname and "" or "-disabled" %>"><a href="?dev=<%=pcdata(get_device(dev))%>"><%=pcdata(dev)%></a></li>
<% end %>
<% end %>
</ul>

View file

@ -707,7 +707,7 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
# uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state=$(echo $intfdata | awk -F";" '{print $4}')
#else
if [ "$proto" != "qmi" ] && [ "$proto" != "modemmanager" ]; then
if [ -n "$OMR_TRACKER_DEVICE_GATEWAY" ] && [ -n "$(curl -s -m 1 -X GET http://$OMR_TRACKER_DEVICE_GATEWAY/api/webserver/SesTokInfo)" ]; then
if [ -n "$OMR_TRACKER_DEVICE_GATEWAY" ] && [ -n "$(curl -s -m 2 -X GET http://$OMR_TRACKER_DEVICE_GATEWAY/api/webserver/SesTokInfo)" ]; then
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.manufacturer='huawei'
else
uci -q delete openmptcprouter.$OMR_TRACKER_INTERFACE.manufacturer

View file

@ -2,8 +2,8 @@
if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" != "0" ]; then
uci -q batch <<-EOF >/dev/null
set dhcp.lan.ra_default=0
set dhcp.lan.dhcpv6=disabled
set dhcp.lan.ra_default=1
set dhcp.lan.dhcpv6=server
set dhcp.lan.force=1
commit dhcp
EOF

View file

@ -2088,7 +2088,7 @@ rules_up() {
config_get enabled main enabled "0"
[ "$enabled" = "0" ] && return
OUTBOUND_SERVERS_V4="$(uci -q get v2ray.omrout.s_vless_address)"
TRANSPARENT_PROXY_PORT="$(uci -q get v2ray.omrout.s_vless_port)"
TRANSPARENT_PROXY_PORT="$(uci -q get v2ray.omr.port)"
logger -t "V2Ray" "Rules UP"
add_v2ray_redirect_rules
}