diff options
Diffstat (limited to 'applications/luci-app-mwan3')
32 files changed, 4614 insertions, 0 deletions
diff --git a/applications/luci-app-mwan3/Makefile b/applications/luci-app-mwan3/Makefile new file mode 100644 index 0000000000..d65cd3af16 --- /dev/null +++ b/applications/luci-app-mwan3/Makefile @@ -0,0 +1,19 @@ +# +# Copyright (C) 2017 Dan Luedtke <mail@danrl.com> +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=LuCI support for the MWAN3 multiwan hotplug script +LUCI_DEPENDS:=+mwan3 +luci-mod-admin-full +luci-app-firewall +luci-lib-nixio +LUCI_PKGARCH:=all +PKG_LICENSE:=GPLv2 + +PKG_MAINTAINER:=Aedan Renner <chipdankly@gmail.com> \ + Florian Eckert <fe@dev.tdt.de> + +include ../../luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua new file mode 100644 index 0000000000..c24beda281 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua @@ -0,0 +1,333 @@ +module("luci.controller.mwan3", package.seeall) + +sys = require "luci.sys" +ut = require "luci.util" + +ip = "ip -4 " + +function index() + if not nixio.fs.access("/etc/config/mwan3") then + return + end + + entry({"admin", "network", "mwan"}, + alias("admin", "network", "mwan", "overview"), + _("Load Balancing"), 600) + + entry({"admin", "network", "mwan", "overview"}, + alias("admin", "network", "mwan", "overview", "overview_interface"), + _("Overview"), 10) + entry({"admin", "network", "mwan", "overview", "overview_interface"}, + template("mwan/overview_interface")) + entry({"admin", "network", "mwan", "overview", "interface_status"}, + call("interfaceStatus")) + entry({"admin", "network", "mwan", "overview", "overview_detailed"}, + template("mwan/overview_detailed")) + entry({"admin", "network", "mwan", "overview", "detailed_status"}, + call("detailedStatus")) + + entry({"admin", "network", "mwan", "configuration"}, + alias("admin", "network", "mwan", "configuration", "interface"), + _("Configuration"), 20) + entry({"admin", "network", "mwan", "configuration", "globals"}, + cbi("mwan/globalsconfig"),_("Globals"), 5).leaf = true + entry({"admin", "network", "mwan", "configuration", "interface"}, + arcombine(cbi("mwan/interface"), cbi("mwan/interfaceconfig")), + _("Interfaces"), 10).leaf = true + entry({"admin", "network", "mwan", "configuration", "member"}, + arcombine(cbi("mwan/member"), cbi("mwan/memberconfig")), + _("Members"), 20).leaf = true + entry({"admin", "network", "mwan", "configuration", "policy"}, + arcombine(cbi("mwan/policy"), cbi("mwan/policyconfig")), + _("Policies"), 30).leaf = true + entry({"admin", "network", "mwan", "configuration", "rule"}, + arcombine(cbi("mwan/rule"), cbi("mwan/ruleconfig")), + _("Rules"), 40).leaf = true + + entry({"admin", "network", "mwan", "advanced"}, + alias("admin", "network", "mwan", "advanced", "hotplugscript"), + _("Advanced"), 100) + entry({"admin", "network", "mwan", "advanced", "hotplugscript"}, + form("mwan/advanced_hotplugscript")) + entry({"admin", "network", "mwan", "advanced", "mwanconfig"}, + form("mwan/advanced_mwanconfig")) + entry({"admin", "network", "mwan", "advanced", "networkconfig"}, + form("mwan/advanced_networkconfig")) + entry({"admin", "network", "mwan", "advanced", "wirelessconfig"}, + form("mwan/advanced_wirelessconfig")) + entry({"admin", "network", "mwan", "advanced", "diagnostics"}, + template("mwan/advanced_diagnostics")) + entry({"admin", "network", "mwan", "advanced", "diagnostics_display"}, + call("diagnosticsData"), nil).leaf = true + entry({"admin", "network", "mwan", "advanced", "troubleshooting"}, + template("mwan/advanced_troubleshooting")) + entry({"admin", "network", "mwan", "advanced", "troubleshooting_display"}, + call("troubleshootingData")) +end + +function getInterfaceStatus(ruleNumber, interfaceName) + if ut.trim(sys.exec("uci -q -p /var/state get mwan3." .. interfaceName .. ".enabled")) == "1" then + if ut.trim(sys.exec(ip .. "route list table " .. ruleNumber)) ~= "" then + if ut.trim(sys.exec("uci -q -p /var/state get mwan3." .. interfaceName .. ".track_ip")) ~= "" then + return "online" + else + return "notMonitored" + end + else + return "offline" + end + else + return "notEnabled" + end +end + +function getInterfaceName() + local ruleNumber, status = 0, "" + uci.cursor():foreach("mwan3", "interface", + function (section) + ruleNumber = ruleNumber+1 + status = status .. section[".name"] .. "[" .. getInterfaceStatus(ruleNumber, section[".name"]) .. "]" + end + ) + return status +end + +function interfaceStatus() + local ntm = require "luci.model.network".init() + + local mArray = {} + + -- overview status + local statusString = getInterfaceName() + if statusString ~= "" then + mArray.wans = {} + wansid = {} + + for wanName, interfaceState in string.gfind(statusString, "([^%[]+)%[([^%]]+)%]") do + local wanInterfaceName = ut.trim(sys.exec("uci -q -p /var/state get network." .. wanName .. ".ifname")) + if wanInterfaceName == "" then + wanInterfaceName = "X" + end + local wanDeviceLink = ntm:get_interface(wanInterfaceName) + wanDeviceLink = wanDeviceLink and wanDeviceLink:get_network() + wanDeviceLink = wanDeviceLink and wanDeviceLink:adminlink() or "#" + wansid[wanName] = #mArray.wans + 1 + mArray.wans[wansid[wanName]] = { name = wanName, link = wanDeviceLink, ifname = wanInterfaceName, status = interfaceState } + end + end + + -- overview status log + local mwanLog = ut.trim(sys.exec("logread | grep mwan3 | tail -n 50 | sed 'x;1!H;$!d;x' 2>/dev/null")) + if mwanLog ~= "" then + mArray.mwanlog = { mwanLog } + end + + luci.http.prepare_content("application/json") + luci.http.write_json(mArray) +end + +function detailedStatus() + local mArray = {} + + -- detailed mwan status + local detailStatusInfo = ut.trim(sys.exec("/usr/sbin/mwan3 status")) + if detailStatusInfo ~= "" then + mArray.mwandetail = { detailStatusInfo } + end + + luci.http.prepare_content("application/json") + luci.http.write_json(mArray) +end + +function diagnosticsData(interface, tool, task) + function getInterfaceNumber() + local number = 0 + uci.cursor():foreach("mwan3", "interface", + function (section) + number = number+1 + if section[".name"] == interface then + interfaceNumber = number + end + end + ) + end + + local mArray = {} + + local results = "" + if tool == "service" then + os.execute("/usr/sbin/mwan3 " .. task) + if task == "restart" then + results = "MWAN3 restarted" + elseif task == "stop" then + results = "MWAN3 stopped" + else + results = "MWAN3 started" + end + else + local interfaceDevice = ut.trim(sys.exec("uci -q -p /var/state get network." .. interface .. ".ifname")) + if interfaceDevice ~= "" then + if tool == "ping" then + local gateway = ut.trim(sys.exec("route -n | awk '{if ($8 == \"" .. interfaceDevice .. "\" && $1 == \"0.0.0.0\" && $3 == \"0.0.0.0\") print $2}'")) + if gateway ~= "" then + if task == "gateway" then + local pingCommand = "ping -c 3 -W 2 -I " .. interfaceDevice .. " " .. gateway + results = pingCommand .. "\n\n" .. sys.exec(pingCommand) + else + local tracked = ut.trim(sys.exec("uci -q -p /var/state get mwan3." .. interface .. ".track_ip")) + if tracked ~= "" then + for z in tracked:gmatch("[^ ]+") do + local pingCommand = "ping -c 3 -W 2 -I " .. interfaceDevice .. " " .. z + results = results .. pingCommand .. "\n\n" .. sys.exec(pingCommand) .. "\n\n" + end + else + results = "No tracking IP addresses configured on " .. interface + end + end + else + results = "No default gateway for " .. interface .. " found. Default route does not exist or is configured incorrectly" + end + elseif tool == "rulechk" then + getInterfaceNumber() + local rule1 = sys.exec(ip .. "rule | grep $(echo $((" .. interfaceNumber .. " + 1000)))") + local rule2 = sys.exec(ip .. "rule | grep $(echo $((" .. interfaceNumber .. " + 2000)))") + if rule1 ~= "" and rule2 ~= "" then + results = "All required interface IP rules found:\n\n" .. rule1 .. rule2 + elseif rule1 ~= "" or rule2 ~= "" then + results = "Missing 1 of the 2 required interface IP rules\n\n\nRules found:\n\n" .. rule1 .. rule2 + else + results = "Missing both of the required interface IP rules" + end + elseif tool == "routechk" then + getInterfaceNumber() + local routeTable = sys.exec(ip .. "route list table " .. interfaceNumber) + if routeTable ~= "" then + results = "Interface routing table " .. interfaceNumber .. " was found:\n\n" .. routeTable + else + results = "Missing required interface routing table " .. interfaceNumber + end + elseif tool == "hotplug" then + if task == "ifup" then + os.execute("/usr/sbin/mwan3 ifup " .. interface) + results = "Hotplug ifup sent to interface " .. interface .. "..." + else + os.execute("/usr/sbin/mwan3 ifdown " .. interface) + results = "Hotplug ifdown sent to interface " .. interface .. "..." + end + end + else + results = "Unable to perform diagnostic tests on " .. interface .. ". There is no physical or virtual device associated with this interface" + end + end + if results ~= "" then + results = ut.trim(results) + mArray.diagnostics = { results } + end + + luci.http.prepare_content("application/json") + luci.http.write_json(mArray) +end + +function troubleshootingData() + local ver = require "luci.version" + + local mArray = {} + + -- software versions + local wrtRelease = ut.trim(ver.distversion) + if wrtRelease ~= "" then + wrtRelease = "OpenWrt - " .. wrtRelease + else + wrtRelease = "OpenWrt - unknown" + end + local luciRelease = ut.trim(ver.luciversion) + if luciRelease ~= "" then + luciRelease = "\nLuCI - " .. luciRelease + else + luciRelease = "\nLuCI - unknown" + end + local mwanVersion = ut.trim(sys.exec("opkg info mwan3 | grep Version | awk '{print $2}'")) + if mwanVersion ~= "" then + mwanVersion = "\n\nmwan3 - " .. mwanVersion + else + mwanVersion = "\n\nmwan3 - unknown" + end + local mwanLuciVersion = ut.trim(sys.exec("opkg info luci-app-mwan3 | grep Version | awk '{print $2}'")) + if mwanLuciVersion ~= "" then + mwanLuciVersion = "\nmwan3-luci - " .. mwanLuciVersion + else + mwanLuciVersion = "\nmwan3-luci - unknown" + end + mArray.versions = { wrtRelease .. luciRelease .. mwanVersion .. mwanLuciVersion } + + -- mwan config + local mwanConfig = ut.trim(sys.exec("cat /etc/config/mwan3")) + if mwanConfig == "" then + mwanConfig = "No data found" + end + mArray.mwanconfig = { mwanConfig } + + -- network config + local networkConfig = ut.trim(sys.exec("cat /etc/config/network | sed -e 's/.*username.*/ USERNAME HIDDEN/' -e 's/.*password.*/ PASSWORD HIDDEN/'")) + if networkConfig == "" then + networkConfig = "No data found" + end + mArray.netconfig = { networkConfig } + + -- wireless config + local wirelessConfig = ut.trim(sys.exec("cat /etc/config/wireless | sed -e 's/.*username.*/ USERNAME HIDDEN/' -e 's/.*password.*/ PASSWORD HIDDEN/' -e 's/.*key.*/ KEY HIDDEN/'")) + if wirelessConfig == "" then + wirelessConfig = "No data found" + end + mArray.wificonfig = { wirelessConfig } + + -- ifconfig + local ifconfig = ut.trim(sys.exec("ifconfig")) + if ifconfig == "" then + ifconfig = "No data found" + end + mArray.ifconfig = { ifconfig } + + -- route -n + local routeShow = ut.trim(sys.exec("route -n")) + if routeShow == "" then + routeShow = "No data found" + end + mArray.routeshow = { routeShow } + + -- ip rule show + local ipRuleShow = ut.trim(sys.exec(ip .. "rule show")) + if ipRuleShow == "" then + ipRuleShow = "No data found" + end + mArray.iprule = { ipRuleShow } + + -- ip route list table 1-250 + local routeList, routeString = ut.trim(sys.exec(ip .. "rule | sed 's/://g' 2>/dev/null | awk '$1>=2001 && $1<=2250' | awk '{print $NF}'")), "" + if routeList ~= "" then + for line in routeList:gmatch("[^\r\n]+") do + routeString = routeString .. line .. "\n" .. sys.exec(ip .. "route list table " .. line) + end + routeString = ut.trim(routeString) + else + routeString = "No data found" + end + mArray.routelist = { routeString } + + -- default firewall output policy + local firewallOut = ut.trim(sys.exec("uci -q -p /var/state get firewall.@defaults[0].output")) + if firewallOut == "" then + firewallOut = "No data found" + end + mArray.firewallout = { firewallOut } + + -- iptables + local iptables = ut.trim(sys.exec("iptables -L -t mangle -v -n")) + if iptables == "" then + iptables = "No data found" + end + mArray.iptables = { iptables } + + luci.http.prepare_content("application/json") + luci.http.write_json(mArray) +end diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_hotplugscript.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_hotplugscript.lua new file mode 100644 index 0000000000..1b97080216 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_hotplugscript.lua @@ -0,0 +1,40 @@ +-- ------ hotplug script configuration ------ -- + +fs = require "nixio.fs" +ut = require "luci.util" + +script = "/etc/mwan3.user" + +m5 = SimpleForm("luci", nil) + m5:append(Template("mwan/advanced_hotplugscript")) -- highlight current tab + +f = m5:section(SimpleSection, nil, + translate("This section allows you to modify the content of \"/etc/mwan3.user\".<br />" .. + "The file is also preserved during sysupgrade.<br />" .. + "<br />" .. + "Notes:<br />" .. + "This file is interpreted as a shell script.<br />" .. + "The first line of the script must be "#!/bin/sh" without quotes.<br />" .. + "Lines beginning with # are comments and are not executed.<br />" .. + "Put your custom mwan3 action here, they will<br />" .. + "be executed with each netifd hotplug interface event<br />" .. + "on interfaces for which mwan3 is enabled.<br />" .. + "<br />" .. + "There are three main environment variables that are passed to this script.<br />" .. + "<br />" .. + "$ACTION Either \"ifup\" or \"ifdown\"<br />" .. + "$INTERFACE Name of the interface which went up or down (e.g. \"wan\" or \"wwan\")<br />" .. + "$DEVICE Physical device name which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br />" .. + "<br />")) + +t = f:option(TextValue, "lines") + t.rmempty = true + t.rows = 20 + function t.cfgvalue() + return fs.readfile(script) + end + function t.write(self, section, data) -- format and write new data to script + return fs.writefile(script, ut.trim(data:gsub("\r\n", "\n")) .. "\n") + end + +return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_mwanconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_mwanconfig.lua new file mode 100644 index 0000000000..e0a99e8366 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_mwanconfig.lua @@ -0,0 +1,32 @@ +-- ------ mwan configuration ------ -- + +ut = require "luci.util" + +mwanConfig = "/etc/config/mwan3" + + +m5 = SimpleForm("luci", nil) + m5:append(Template("mwan/advanced_mwanconfig")) -- highlight current tab + + +f = m5:section(SimpleSection, nil, + translate("This section allows you to modify the contents of /etc/config/mwan3")) + +t = f:option(TextValue, "lines") + t.rmempty = true + t.rows = 20 + + function t.cfgvalue() + return nixio.fs.readfile(mwanConfig) or "" + end + + function t.write(self, section, data) -- format and write new data to script + return nixio.fs.writefile(mwanConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n") + end + + function f.handle(self, state, data) + return true + end + + +return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_networkconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_networkconfig.lua new file mode 100644 index 0000000000..b93d89751b --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_networkconfig.lua @@ -0,0 +1,32 @@ +-- ------ network configuration ------ -- + +ut = require "luci.util" + +networkConfig = "/etc/config/network" + + +m5 = SimpleForm("networkconf", nil) + m5:append(Template("mwan/advanced_networkconfig")) -- highlight current tab + + +f = m5:section(SimpleSection, nil, + translate("This section allows you to modify the contents of /etc/config/network")) + +t = f:option(TextValue, "lines") + t.rmempty = true + t.rows = 20 + + function t.cfgvalue() + return nixio.fs.readfile(networkConfig) or "" + end + + function t.write(self, section, data) -- format and write new data to script + return nixio.fs.writefile(networkConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n") + end + + function f.handle(self, state, data) + return true + end + + +return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_wirelessconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_wirelessconfig.lua new file mode 100644 index 0000000000..95e9f7c7e5 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_wirelessconfig.lua @@ -0,0 +1,32 @@ +-- ------ wireless configuration ------ -- + +ut = require "luci.util" + +wirelessConfig = "/etc/config/wireless" + + +m5 = SimpleForm("wirelessconf", nil) + m5:append(Template("mwan/advanced_wirelessconfig")) -- highlight current tab + + +f = m5:section(SimpleSection, nil, + translate("This section allows you to modify the contents of /etc/config/wireless")) + +t = f:option(TextValue, "lines") + t.rmempty = true + t.rows = 20 + + function t.cfgvalue() + return nixio.fs.readfile(wirelessConfig) or "" + end + + function t.write(self, section, data) -- format and write new data to script + return nixio.fs.writefile(wirelessConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n") + end + + function f.handle(self, state, data) + return true + end + + +return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua new file mode 100644 index 0000000000..919ed46cd4 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua @@ -0,0 +1,40 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2017 Florian Eckert <fe@dev.tdt.de> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +local net = require "luci.model.network".init() + +m = Map("mwan3") + +s = m:section(NamedSection, "globals", "globals", translate("Globals mwan3 options")) +n = s:option(ListValue, "local_source", + translate("Local source interface"), + translate("Use the IP address of this interface as source IP address for traffic initiated by the router itself")) +n:value("none") +n.default = "none" +for _, net in ipairs(net:get_networks()) do + if net:name() ~= "loopback" then + n:value(net:name()) + end +end +n.rmempty = false + +mask = s:option( + Value, + "mmx_mask", + translate("Firewall mask"), + translate("Enter value in hex, starting with <code>0x</code>")) +mask.datatype = "hex(4)" +mask.default = "0xff00" + +return m diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua new file mode 100644 index 0000000000..5ee5fb39f3 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua @@ -0,0 +1,276 @@ +-- ------ extra functions ------ -- + +function interfaceCheck() -- find issues with too many interfaces, reliability and metric + uci.cursor():foreach("mwan3", "interface", + function (section) + local interfaceName = section[".name"] + interfaceNumber = interfaceNumber+1 -- count number of mwan interfaces configured + -- create list of metrics for none and duplicate checking + local metricValue = ut.trim(sys.exec("uci -p /var/state get network." .. interfaceName .. ".metric")) + if metricValue == "" then + errorFound = 1 + errorNoMetricList = errorNoMetricList .. interfaceName .. " " + else + metricList = metricList .. interfaceName .. " " .. metricValue .. "\n" + end + -- check if any interfaces have a higher reliability requirement than tracking IPs configured + local trackingNumber = tonumber(ut.trim(sys.exec("echo $(uci -p /var/state get mwan3." .. interfaceName .. ".track_ip) | wc -w"))) + if trackingNumber > 0 then + local reliabilityNumber = tonumber(ut.trim(sys.exec("uci -p /var/state get mwan3." .. interfaceName .. ".reliability"))) + if reliabilityNumber and reliabilityNumber > trackingNumber then + errorFound = 1 + errorReliabilityList = errorReliabilityList .. interfaceName .. " " + end + end + -- check if any interfaces are not properly configured in /etc/config/network or have no default route in main routing table + if ut.trim(sys.exec("uci -p /var/state get network." .. interfaceName)) == "interface" then + local interfaceDevice = ut.trim(sys.exec("uci -p /var/state get network." .. interfaceName .. ".ifname")) + if interfaceDevice == "uci: Entry not found" or interfaceDevice == "" then + errorFound = 1 + errorNetConfigList = errorNetConfigList .. interfaceName .. " " + errorRouteList = errorRouteList .. interfaceName .. " " + else + local routeCheck = ut.trim(sys.exec("route -n | awk '{if ($8 == \"" .. interfaceDevice .. "\" && $1 == \"0.0.0.0\" && $3 == \"0.0.0.0\") print $1}'")) + if routeCheck == "" then + errorFound = 1 + errorRouteList = errorRouteList .. interfaceName .. " " + end + end + else + errorFound = 1 + errorNetConfigList = errorNetConfigList .. interfaceName .. " " + errorRouteList = errorRouteList .. interfaceName .. " " + end + end + ) + -- check if any interfaces have duplicate metrics + local metricDuplicateNumbers = sys.exec("echo '" .. metricList .. "' | awk '{print $2}' | uniq -d") + if metricDuplicateNumbers ~= "" then + errorFound = 1 + local metricDuplicates = "" + for line in metricDuplicateNumbers:gmatch("[^\r\n]+") do + metricDuplicates = sys.exec("echo '" .. metricList .. "' | grep '" .. line .. "' | awk '{print $1}'") + errorDuplicateMetricList = errorDuplicateMetricList .. metricDuplicates + end + errorDuplicateMetricList = sys.exec("echo '" .. errorDuplicateMetricList .. "' | tr '\n' ' '") + end +end + +function interfaceWarnings() -- display status and warning messages at the top of the page + local warnings = "" + if interfaceNumber <= 250 then + warnings = "<strong>" .. translatef("There are currently %d of 250 supported interfaces configured", interfaceNumber) .. "</strong>" + else + warnings = "<font color=\"ff0000\"><strong>" .. translatef("WARNING: %d interfaces are configured exceeding the maximum of 250!", interfaceNumber) .. "</strong></font>" + end + if errorReliabilityList ~= " " then + warnings = warnings .. "<br /><br /><font color=\"ff0000\"><strong>" .. translate("WARNING: Some interfaces have a higher reliability requirement than there are tracking IP addresses!") .. "</strong></font>" + end + if errorRouteList ~= " " then + warnings = warnings .. "<br /><br /><font color=\"ff0000\"><strong>" .. translate("WARNING: Some interfaces have no default route in the main routing table!") .. "</strong></font>" + end + if errorNetConfigList ~= " " then + warnings = warnings .. "<br /><br /><font color=\"ff0000\"><strong>" .. translate("WARNING: Some interfaces are configured incorrectly or not at all in /etc/config/network!") .. "</strong></font>" + end + if errorNoMetricList ~= " " then + warnings = warnings .. "<br /><br /><font color=\"ff0000\"><strong>" .. translate("WARNING: Some interfaces have no metric configured in /etc/config/network!") .. "</strong></font>" + end + if errorDuplicateMetricList ~= " " then + warnings = warnings .. "<br /><br /><font color=\"ff0000\"><strong>" .. translate("WARNING: Some interfaces have duplicate metrics configured in /etc/config/network!") .. "</strong></font>" + end + return warnings +end + +-- ------ interface configuration ------ -- + +dsp = require "luci.dispatcher" +sys = require "luci.sys" +ut = require "luci.util" + +interfaceNumber = 0 +metricList = "" +errorFound = 0 +errorDuplicateMetricList = " " +errorNetConfigList = " " +errorNoMetricList = " " +errorReliabilityList = " " +errorRouteList = " " +interfaceCheck() + + +m5 = Map("mwan3", translate("MWAN Interface Configuration"), + interfaceWarnings()) + m5:append(Template("mwan/config_css")) + + +mwan_interface = m5:section(TypedSection, "interface", translate("Interfaces"), + translate("MWAN supports up to 250 physical and/or logical interfaces<br />" .. + "MWAN requires that all interfaces have a unique metric configured in /etc/config/network<br />" .. + "Names must match the interface name found in /etc/config/network (see advanced tab)<br />" .. + "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" .. + "Interfaces may not share the same name as configured members, policies or rules")) + mwan_interface.addremove = true + mwan_interface.dynamic = false + mwan_interface.sectionhead = translate("Interface") + mwan_interface.sortable = false + mwan_interface.template = "cbi/tblsection" + mwan_interface.extedit = dsp.build_url("admin", "network", "mwan", "configuration", "interface", "%s") + function mwan_interface.create(self, section) + TypedSection.create(self, section) + m5.uci:save("mwan3") + luci.http.redirect(dsp.build_url("admin", "network", "mwan", "configuration", "interface", section)) + end + + +enabled = mwan_interface:option(DummyValue, "enabled", translate("Enabled")) + enabled.rawhtml = true + function enabled.cfgvalue(self, s) + if self.map:get(s, "enabled") == "1" then + return "Yes" + else + return "No" + end + end + +track_ip = mwan_interface:option(DummyValue, "track_ip", translate("Tracking IP")) + track_ip.rawhtml = true + function track_ip.cfgvalue(self, s) + tracked = self.map:get(s, "track_ip") + if tracked then + local ipList = "" + for k,v in pairs(tracked) do + ipList = ipList .. v .. "<br />" + end + return ipList + else + return "—" + end + end + +track_method = mwan_interface:option(DummyValue, "track_method", translate("Tracking method")) + track_method.rawhtml = true + function track_method.cfgvalue(self, s) + if tracked then + return self.map:get(s, "track_method") or "—" + else + return "—" + end + end + +reliability = mwan_interface:option(DummyValue, "reliability", translate("Tracking reliability")) + reliability.rawhtml = true + function reliability.cfgvalue(self, s) + if tracked then + return self.map:get(s, "reliability") or "—" + else + return "—" + end + end + +count = mwan_interface:option(DummyValue, "count", translate("Ping count")) + count.rawhtml = true + function count.cfgvalue(self, s) + if tracked then + return self.map:get(s, "count") or "—" + else + return "—" + end + end + +timeout = mwan_interface:option(DummyValue, "timeout", translate("Ping timeout")) + timeout.rawhtml = true + function timeout.cfgvalue(self, s) + if tracked then + local timeoutValue = self.map:get(s, "timeout") + if timeoutValue then + return timeoutValue .. "s" + else + return "—" + end + else + return "—" + end + end + +interval = mwan_interface:option(DummyValue, "interval", translate("Ping interval")) + interval.rawhtml = true + function interval.cfgvalue(self, s) + if tracked then + local intervalValue = self.map:get(s, "interval") + if intervalValue then + return intervalValue .. "s" + else + return "—" + end + else + return "—" + end + end + +down = mwan_interface:option(DummyValue, "down", translate("Interface down")) + down.rawhtml = true + function down.cfgvalue(self, s) + if tracked then + return self.map:get(s, "down") or "—" + else + return "—" + end + end + +up = mwan_interface:option(DummyValue, "up", translate("Interface up")) + up.rawhtml = true + function up.cfgvalue(self, s) + if tracked then + return self.map:get(s, "up") or "—" + else + return "—" + end + end + +metric = mwan_interface:option(DummyValue, "metric", translate("Metric")) + metric.rawhtml = true + function metric.cfgvalue(self, s) + local metricValue = sys.exec("uci -p /var/state get network." .. s .. ".metric") + if metricValue ~= "" then + return metricValue + else + return "—" + end + end + +errors = mwan_interface:option(DummyValue, "errors", translate("Errors")) + errors.rawhtml = true + function errors.cfgvalue(self, s) + if errorFound == 1 then + local mouseOver, lineBreak = "", "" + if string.find(errorReliabilityList, " " .. s .. " ") then + mouseOver = "Higher reliability requirement than there are tracking IP addresses" + lineBreak = " " + end + if string.find(errorRouteList, " " .. s .. " ") then + mouseOver = mouseOver .. lineBreak .. "No default route in the main routing table" + lineBreak = " " + end + if string.find(errorNetConfigList, " " .. s .. " ") then + mouseOver = mouseOver .. lineBreak .. "Configured incorrectly or not at all in /etc/config/network" + lineBreak = " " + end + if string.find(errorNoMetricList, " " .. s .. " ") then + mouseOver = mouseOver .. lineBreak .. "No metric configured in /etc/config/network" + lineBreak = " " + end + if string.find(errorDuplicateMetricList, " " .. s .. " ") then + mouseOver = mouseOver .. lineBreak .. "Duplicate metric configured in /etc/config/network" + end + if mouseOver == "" then + return "" + else + return "<span title=\"" .. mouseOver .. "\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>" + end + else + return "" + end + end + + +return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua new file mode 100644 index 0000000000..a7d7c5af7e --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua @@ -0,0 +1,266 @@ +-- ------ extra functions ------ -- + +function interfaceCheck() + metricValue = ut.trim(sys.exec("uci -p /var/state get network." .. arg[1] .. ".metric")) + if metricValue == "" then -- no metric + errorNoMetric = 1 + else -- if metric exists create list of interface metrics to compare against for duplicates + uci.cursor():foreach("mwan3", "interface", + function (section) + local metricValue = ut.trim(sys.exec("uci -p /var/state get network." .. section[".name"] .. ".metric")) + metricList = metricList .. section[".name"] .. " " .. metricValue .. "\n" + end + ) + -- compare metric against list + local metricDuplicateNumbers, metricDuplicates = sys.exec("echo '" .. metricList .. "' | awk '{print $2}' | uniq -d"), "" + for line in metricDuplicateNumbers:gmatch("[^\r\n]+") do + metricDuplicates = sys.exec("echo '" .. metricList .. "' | grep '" .. line .. "' | awk '{print $1}'") + errorDuplicateMetricList = errorDuplicateMetricList .. metricDuplicates + end + if sys.exec("echo '" .. errorDuplicateMetricList .. "' | grep -w " .. arg[1]) ~= "" then + errorDuplicateMetric = 1 + end + end + -- check if this interface has a higher reliability requirement than track IPs configured + local trackingNumber = tonumber(ut.trim(sys.exec("echo $(uci -p /var/state get mwan3." .. arg[1] .. ".track_ip) | wc -w"))) + if trackingNumber > 0 then + local reliabilityNumber = tonumber(ut.trim(sys.exec("uci -p /var/state get mwan3." .. arg[1] .. ".reliability"))) + if reliabilityNumber and reliabilityNumber > trackingNumber then + errorReliability = 1 + end + end + -- check if any interfaces are not properly configured in /etc/config/network or have no default route in main routing table + if ut.trim(sys.exec("uci -p /var/state get network." .. arg[1])) == "interface" then + local interfaceDevice = ut.trim(sys.exec("uci -p /var/state get network." .. arg[1] .. ".ifname")) + if interfaceDevice == "uci: Entry not found" or interfaceDevice == "" then + errorNetConfig = 1 + errorRoute = 1 + else + local routeCheck = ut.trim(sys.exec("route -n | awk '{if ($8 == \"" .. interfaceDevice .. "\" && $1 == \"0.0.0.0\" && $3 == \"0.0.0.0\") print $1}'")) + if routeCheck == "" then + errorRoute = 1 + end + end + else + errorNetConfig = 1 + errorRoute = 1 + end +end + +function interfaceWarnings() -- display warning messages at the top of the page + local warns, lineBreak = "", "" + if errorReliability == 1 then + warns = "<font color=\"ff0000\"><strong>" .. translate("WARNING: This interface has a higher reliability requirement than there are tracking IP addresses!") .. "</strong></font>" + lineBreak = "<br /><br />" + end + if errorRoute == 1 then + warns = warns .. lineBreak .. "<font color=\"ff0000\"><strong>" .. translate("WARNING: This interface has no default route in the main routing table!") .. "</strong></font>" + lineBreak = "<br /><br />" + end + if errorNetConfig == 1 then + warns = warns .. lineBreak .. "<font color=\"ff0000\"><strong>" .. translate("WARNING: This interface is configured incorrectly or not at all in /etc/config/network!") .. "</strong></font>" + lineBreak = "<br /><br />" + end + if errorNoMetric == 1 then + warns = warns .. lineBreak .. "<font color=\"ff0000\"><strong>" .. translate("WARNING: This interface has no metric configured in /etc/config/network!") .. "</strong></font>" + elseif errorDuplicateMetric == 1 then + warns = warns .. lineBreak .. "<font color=\"ff0000\"><strong>" .. translate("WARNING: This and other interfaces have duplicate metrics configured in /etc/config/network!") .. "</strong></font>" + end + return warns +end + +-- ------ interface configuration ------ -- + +dsp = require "luci.dispatcher" +sys = require "luci.sys" +ut = require "luci.util" +arg[1] = arg[1] or "" + +metricValue = "" +metricList = "" +errorDuplicateMetricList = "" +errorNoMetric = 0 +errorDuplicateMetric = 0 +errorRoute = 0 +errorNetConfig = 0 +errorReliability = 0 +interfaceCheck() + + +m5 = Map("mwan3", translatef("MWAN Interface Configuration - %s", arg[1]), + interfaceWarnings()) + m5.redirect = dsp.build_url("admin", "network", "mwan", "configuration", "interface") + + +mwan_interface = m5:section(NamedSection, arg[1], "interface", "") + mwan_interface.addremove = false + mwan_interface.dynamic = false + + +enabled = mwan_interface:option(ListValue, "enabled", translate("Enabled")) + enabled.default = "1" + enabled:value("1", translate("Yes")) + enabled:value("0", translate("No")) + +initial_state = mwan_interface:option(ListValue, "initial_state", translate("Initial state"), + translate("Expect interface state on up event")) + initial_state.default = "online" + initial_state:value("online", translate("Online")) + initial_state:value("offline", translate("Offline")) + +family = mwan_interface:option(ListValue, "family", translate("Internet Protocol")) + family.default = "ipv4" + family:value("ipv4", translate("IPv4")) + family:value("ipv6", translate("IPv6")) + +track_ip = mwan_interface:option(DynamicList, "track_ip", translate("Tracking hostname or IP address"), + translate("This hostname or IP address will be pinged to determine if the link is up or down. Leave blank to assume interface is always online")) + track_ip.datatype = "host" + +track_method = mwan_interface:option(ListValue, "track_method", translate("Tracking method")) + track_method.default = "ping" + track_method:value("ping") + track_method:value("arping") + track_method:value("httping") + +reliability = mwan_interface:option(Value, "reliability", translate("Tracking reliability"), + translate("Acceptable values: 1-100. This many Tracking IP addresses must respond for the link to be deemed up")) + reliability.datatype = "range(1, 100)" + reliability.default = "1" + +count = mwan_interface:option(ListValue, "count", translate("Ping count")) + count.default = "1" + count:value("1") + count:value("2") + count:value("3") + count:value("4") + count:value("5") + +size = mwan_interface:option(Value, "size", translate("Ping size")) + size.default = "56" + size:value("8") + size:value("24") + size:value("56") + size:value("120") + size:value("248") + size:value("504") + size:value("1016") + size:value("1472") + size:value("2040") + size.datatype = "range(1, 65507)" + size.rmempty = false + size.optional = false + +timeout = mwan_interface:option(ListValue, "timeout", translate("Ping timeout")) + timeout.default = "2" + timeout:value("1", translatef("%d second", 1)) + timeout:value("2", translatef("%d seconds", 2)) + timeout:value("3", translatef("%d seconds", 3)) + timeout:value("4", translatef("%d seconds", 4)) + timeout:value("5", translatef("%d seconds", 5)) + timeout:value("6", translatef("%d seconds", 6)) + timeout:value("7", translatef("%d seconds", 7)) + timeout:value("8", translatef("%d seconds", 8)) + timeout:value("9", translatef("%d seconds", 9)) + timeout:value("10", translatef("%d seconds", 10)) + +interval = mwan_interface:option(ListValue, "interval", translate("Ping interval")) + interval.default = "5" + interval:value("1", translatef("%d second", 1)) + interval:value("3", translatef("%d seconds", 3)) + interval:value("5", translatef("%d seconds", 5)) + interval:value("10", translatef("%d seconds", 10)) + interval:value("20", translatef("%d seconds", 20)) + interval:value("30", translatef("%d seconds", 30)) + interval:value("60", translatef("%d minute", 1)) + interval:value("300", translatef("%d minutes", 5)) + interval:value("600", translatef("%d minutes", 10)) + interval:value("900", translatef("%d minutes", 15)) + interval:value("1800", translatef("%d minutes", 30)) + interval:value("3600", translatef("%d hour", 1)) + +failure = mwan_interface:option(Value, "failure_interval", translate("Failure interval"), + translate("Ping interval during failure detection")) + failure.default = "5" + failure:value("1", translatef("%d second", 1)) + failure:value("3", translatef("%d seconds", 3)) + failure:value("5", translatef("%d seconds", 5)) + failure:value("10", translatef("%d seconds", 10)) + failure:value("20", translatef("%d seconds", 20)) + failure:value("30", translatef("%d seconds", 30)) + failure:value("60", translatef("%d minute", 1)) + failure:value("300", translatef("%d minutes", 5)) + failure:value("600", translatef("%d minutes", 10)) + failure:value("900", translatef("%d minutes", 15)) + failure:value("1800", translatef("%d minutes", 30)) + failure:value("3600", translatef("%d hour", 1)) + +keep_failure = mwan_interface:option(Flag, "keep_failure_interval", translate("Keep failure interval"), + translate("Keep ping failure interval during failure state")) + keep_failure.default = keep_failure.disabled + +recovery = mwan_interface:option(Value, "recovery_interval", translate("Recovery interval"), + translate("Ping interval during failure recovering")) + recovery.default = "5" + recovery:value("1", translatef("%d second", 1)) + recovery:value("3", translatef("%d seconds", 3)) + recovery:value("5", translatef("%d seconds", 5)) + recovery:value("10", translatef("%d seconds", 10)) + recovery:value("20", translatef("%d seconds", 20)) + recovery:value("30", translatef("%d seconds", 30)) + recovery:value("60", translatef("%d minute", 1)) + recovery:value("300", translatef("%d minutes", 5)) + recovery:value("600", translatef("%d minutes", 10)) + recovery:value("900", translatef("%d minutes", 15)) + recovery:value("1800", translatef("%d minutes", 30)) + recovery:value("3600", translatef("%d hour", 1)) + +down = mwan_interface:option(ListValue, "down", translate("Interface down"), + translate("Interface will be deemed down after this many failed ping tests")) + down.default = "3" + down:value("1") + down:value("2") + down:value("3") + down:value("4") + down:value("5") + down:value("6") + down:value("7") + down:value("8") + down:value("9") + down:value("10") + +up = mwan_interface:option(ListValue, "up", translate("Interface up"), + translate("Downed interface will be deemed up after this many successful ping tests")) + up.default = "3" + up:value("1") + up:value("2") + up:value("3") + up:value("4") + up:value("5") + up:value("6") + up:value("7") + up:value("8") + up:value("9") + up:value("10") + +flush = mwan_interface:option(ListValue, "flush_conntrack", translate("Flush conntrack table"), + translate("Flush global firewall conntrack table on interface events")) + flush.default = "never" + flush:value("ifup", translate("ifup")) + flush:value("ifdown", translate("ifdown")) + flush:value("never", translate("never")) + flush:value("always", translate("always")) + +metric = mwan_interface:option(DummyValue, "metric", translate("Metric"), + translate("This displays the metric assigned to this interface in /etc/config/network")) + metric.rawhtml = true + function metric.cfgvalue(self, s) + if errorNoMetric == 0 then + return metricValue + else + return "—" + end + end + + +return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua new file mode 100644 index 0000000000..efbe8f7902 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua @@ -0,0 +1,46 @@ +-- ------ member configuration ------ -- + +ds = require "luci.dispatcher" + + +m5 = Map("mwan3", translate("MWAN Member Configuration")) + m5:append(Template("mwan/config_css")) + + +mwan_member = m5:section(TypedSection, "member", translate("Members"), + translate("Members are profiles attaching a metric and weight to an MWAN interface<br />" .. + "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" .. + "Members may not share the same name as configured interfaces, policies or rules")) + mwan_member.addremove = true + mwan_member.dynamic = false + mwan_member.sectionhead = translate("Member") + mwan_member.sortable = true + mwan_member.template = "cbi/tblsection" + mwan_member.extedit = ds.build_url("admin", "network", "mwan", "configuration", "member", "%s") + function mwan_member.create(self, section) + TypedSection.create(self, section) + m5.uci:save("mwan3") + luci.http.redirect(ds.build_url("admin", "network", "mwan", "configuration", "member", section)) + end + + +interface = mwan_member:option(DummyValue, "interface", translate("Interface")) + interface.rawhtml = true + function interface.cfgvalue(self, s) + return self.map:get(s, "interface") or "—" + end + +metric = mwan_member:option(DummyValue, "metric", translate("Metric")) + metric.rawhtml = true + function metric.cfgvalue(self, s) + return self.map:get(s, "metric") or "1" + end + +weight = mwan_member:option(DummyValue, "weight", translate("Weight")) + weight.rawhtml = true + function weight.cfgvalue(self, s) + return self.map:get(s, "weight") or "1" + end + + +return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua new file mode 100644 index 0000000000..eb6f417afe --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua @@ -0,0 +1,47 @@ +-- ------ extra functions ------ -- + +function cbi_add_interface(field) + uci.cursor():foreach("mwan3", "interface", + function (section) + field:value(section[".name"]) + end + ) +end + +-- ------ member configuration ------ -- + +dsp = require "luci.dispatcher" +arg[1] = arg[1] or "" + + +m5 = Map("mwan3", translatef("MWAN Member Configuration - %s", arg[1])) + m5.redirect = dsp.build_url("admin", "network", "mwan", "configuration", "member") + + +mwan_member = m5:section(NamedSection, arg[1], "member", "") + mwan_member.addremove = false + mwan_member.dynamic = false + + +interface = mwan_member:option(Value, "interface", translate("Interface")) + cbi_add_interface(interface) + +metric = mwan_member:option(Value, "metric", translate("Metric"), + translate("Acceptable values: 1-1000. Defaults to 1 if not set")) + metric.datatype = "range(1, 1000)" + +weight = mwan_member:option(Value, "weight", translate("Weight"), + translate("Acceptable values: 1-1000. Defaults to 1 if not set")) + weight.datatype = "range(1, 1000)" + + +-- ------ currently configured interfaces ------ -- + +mwan_interface = m5:section(TypedSection, "interface", translate("Currently Configured Interfaces")) + mwan_interface.addremove = false + mwan_interface.dynamic = false + mwan_interface.sortable = false + mwan_interface.template = "cbi/tblsection" + + +return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua new file mode 100644 index 0000000000..6640564d50 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua @@ -0,0 +1,94 @@ +-- ------ extra functions ------ -- + +function policyCheck() -- check to see if any policy names exceed the maximum of 15 characters + uci.cursor():foreach("mwan3", "policy", + function (section) + if string.len(section[".name"]) > 15 then + nameTooLong = 1 + err_name_list = err_name_list .. section[".name"] .. " " + end + end + ) +end + +function policyWarn() -- display status and warning messages at the top of the page + if nameTooLong == 1 then + return "<font color=\"ff0000\"><strong>" .. translate("WARNING: Some policies have names exceeding the maximum of 15 characters!") .. "</strong></font>" + else + return "" + end +end + +-- ------ policy configuration ------ -- + +ds = require "luci.dispatcher" +sys = require "luci.sys" + +nameTooLong = 0 +err_name_list = " " +policyCheck() + + +m5 = Map("mwan3", translate("MWAN Policy Configuration"), + policyWarn()) + m5:append(Template("mwan/config_css")) + + +mwan_policy = m5:section(TypedSection, "policy", translate("Policies"), + translate("Policies are profiles grouping one or more members controlling how MWAN distributes traffic<br />" .. + "Member interfaces with lower metrics are used first. Interfaces with the same metric load-balance<br />" .. + "Load-balanced member interfaces distribute more traffic out those with higher weights<br />" .. + "Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be 15 characters or less<br />" .. + "Policies may not share the same name as configured interfaces, members or rules")) + mwan_policy.addremove = true + mwan_policy.dynamic = false + mwan_policy.sectionhead = translate("Policy") + mwan_policy.sortable = true + mwan_policy.template = "cbi/tblsection" + mwan_policy.extedit = ds.build_url("admin", "network", "mwan", "configuration", "policy", "%s") + function mwan_policy.create(self, section) + TypedSection.create(self, section) + m5.uci:save("mwan3") + luci.http.redirect(ds.build_url("admin", "network", "mwan", "configuration", "policy", section)) + end + + +use_member = mwan_policy:option(DummyValue, "use_member", translate("Members assigned")) + use_member.rawhtml = true + function use_member.cfgvalue(self, s) + local memberConfig, memberList = self.map:get(s, "use_member"), "" + if memberConfig then + for k,v in pairs(memberConfig) do + memberList = memberList .. v .. "<br />" + end + return memberList + else + return "—" + end + end + +last_resort = mwan_policy:option(DummyValue, "last_resort", translate("Last resort")) + last_resort.rawhtml = true + function last_resort.cfgvalue(self, s) + local action = self.map:get(s, "last_resort") + if action == "blackhole" then + return translate("blackhole (drop)") + elseif action == "default" then + return translate("default (use main routing table)") + else + return translate("unreachable (reject)") + end + end + +errors = mwan_policy:option(DummyValue, "errors", translate("Errors")) + errors.rawhtml = true + function errors.cfgvalue(self, s) + if not string.find(err_name_list, " " .. s .. " ") then + return "" + else + return "<span title=\"Name exceeds 15 characters\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>" + end + end + + +return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policyconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policyconfig.lua new file mode 100644 index 0000000000..feb62dc8a3 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policyconfig.lua @@ -0,0 +1,65 @@ +-- ------ extra functions ------ -- + +function policyCheck() -- check to see if this policy's name exceed the maximum of 15 characters + policyNameLength = string.len(arg[1]) + if policyNameLength > 15 then + nameTooLong = 1 + end +end + +function policyWarn() -- display status and warning messages at the top of the page + if nameTooLong == 1 then + return "<font color=\"ff0000\"><strong>" .. translatef("WARNING: This policy's name is %d characters exceeding the maximum of 15!", policyNameLength) .. "</strong></font>" + else + return "" + end +end + +function cbiAddMember(field) + uci.cursor():foreach("mwan3", "member", + function (section) + field:value(section[".name"]) + end + ) +end + +-- ------ policy configuration ------ -- + +dsp = require "luci.dispatcher" +arg[1] = arg[1] or "" + +nameTooLong = 0 +policyCheck() + + +m5 = Map("mwan3", translatef("MWAN Policy Configuration - %s", arg[1]), + policyWarn()) + m5.redirect = dsp.build_url("admin", "network", "mwan", "configuration", "policy") + + +mwan_policy = m5:section(NamedSection, arg[1], "policy", "") + mwan_policy.addremove = false + mwan_policy.dynamic = false + + +use_member = mwan_policy:option(DynamicList, "use_member", translate("Member used")) + cbiAddMember(use_member) + +last_resort = mwan_policy:option(ListValue, "last_resort", translate("Last resort"), + translate("When all policy members are offline use this behavior for matched traffic")) + last_resort.default = "unreachable" + last_resort:value("unreachable", translate("unreachable (reject)")) + last_resort:value("blackhole", translate("blackhole (drop)")) + last_resort:value("default", translate("default (use main routing table)")) + + +-- ------ currently configured members ------ -- + +mwan_member = m5:section(TypedSection, "member", translate("Currently Configured Members")) + mwan_member.addremove = false + mwan_member.dynamic = false + mwan_member.sortable = false + mwan_member.template = "cbi/tblsection" + + +return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua new file mode 100644 index 0000000000..9cb4756fc8 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua @@ -0,0 +1,141 @@ +-- ------ extra functions ------ -- + +function ruleCheck() -- determine if rules needs a proper protocol configured + uci.cursor():foreach("mwan3", "rule", + function (section) + local sourcePort = ut.trim(sys.exec("uci -p /var/state get mwan3." .. section[".name"] .. ".src_port")) + local destPort = ut.trim(sys.exec("uci -p /var/state get mwan3." .. section[".name"] .. ".dest_port")) + if sourcePort ~= "" or destPort ~= "" then -- ports configured + local protocol = ut.trim(sys.exec("uci -p /var/state get mwan3." .. section[".name"] .. ".proto")) + if protocol == "" or protocol == "all" then -- no or improper protocol + error_protocol_list = error_protocol_list .. section[".name"] .. " " + end + end + end + ) +end + +function ruleWarn() -- display warning messages at the top of the page + if error_protocol_list ~= " " then + return "<font color=\"ff0000\"><strong>" .. translate("WARNING: Some rules have a port configured with no or improper protocol specified! Please configure a specific protocol!") .. "</strong></font>" + else + return "" + end +end + +-- ------ rule configuration ------ -- + +dsp = require "luci.dispatcher" +sys = require "luci.sys" +ut = require "luci.util" + +error_protocol_list = " " +ruleCheck() + + +m5 = Map("mwan3", translate("MWAN Rule Configuration"), + ruleWarn()) + m5:append(Template("mwan/config_css")) + + +mwan_rule = m5:section(TypedSection, "rule", translate("Traffic Rules"), + translate("Rules specify which traffic will use a particular MWAN policy based on IP address, port or protocol<br />" .. + "Rules are matched from top to bottom. Rules below a matching rule are ignored. Traffic not matching any rule is routed using the main routing table<br />" .. + "Traffic destined for known (other than default) networks is handled by the main routing table. Traffic matching a rule, but all WAN interfaces for that policy are down will be blackholed<br />" .. + "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" .. + "Rules may not share the same name as configured interfaces, members or policies")) + mwan_rule.addremove = true + mwan_rule.anonymous = false + mwan_rule.dynamic = false + mwan_rule.sectionhead = translate("Rule") + mwan_rule.sortable = true + mwan_rule.template = "cbi/tblsection" + mwan_rule.extedit = dsp.build_url("admin", "network", "mwan", "configuration", "rule", "%s") + function mwan_rule.create(self, section) + TypedSection.create(self, section) + m5.uci:save("mwan3") + luci.http.redirect(dsp.build_url("admin", "network", "mwan", "configuration", "rule", section)) + end + + +src_ip = mwan_rule:option(DummyValue, "src_ip", translate("Source address")) + src_ip.rawhtml = true + function src_ip.cfgvalue(self, s) + return self.map:get(s, "src_ip") or "—" + end + +src_port = mwan_rule:option(DummyValue, "src_port", translate("Source port")) + src_port.rawhtml = true + function src_port.cfgvalue(self, s) + return self.map:get(s, "src_port") or "—" + end + +dest_ip = mwan_rule:option(DummyValue, "dest_ip", translate("Destination address")) + dest_ip.rawhtml = true + function dest_ip.cfgvalue(self, s) + return self.map:get(s, "dest_ip") or "—" + end + +dest_port = mwan_rule:option(DummyValue, "dest_port", translate("Destination port")) + dest_port.rawhtml = true + function dest_port.cfgvalue(self, s) + return self.map:get(s, "dest_port") or "—" + end + +proto = mwan_rule:option(DummyValue, "proto", translate("Protocol")) + proto.rawhtml = true + function proto.cfgvalue(self, s) + return self.map:get(s, "proto") or "all" + end + +sticky = mwan_rule:option(DummyValue, "sticky", translate("Sticky")) + sticky.rawhtml = true + function sticky.cfgvalue(self, s) + if self.map:get(s, "sticky") == "1" then + stickied = 1 + return translate("Yes") + else + stickied = nil + return translate("No") + end + end + +timeout = mwan_rule:option(DummyValue, "timeout", translate("Sticky timeout")) + timeout.rawhtml = true + function timeout.cfgvalue(self, s) + if stickied then + local timeoutValue = self.map:get(s, "timeout") + if timeoutValue then + return timeoutValue .. "s" + else + return "600s" + end + else + return "—" + end + end + +ipset = mwan_rule:option(DummyValue, "ipset", translate("IPset")) + ipset.rawhtml = true + function ipset.cfgvalue(self, s) + return self.map:get(s, "ipset") or "—" + end + +use_policy = mwan_rule:option(DummyValue, "use_policy", translate("Policy assigned")) + use_policy.rawhtml = true + function use_policy.cfgvalue(self, s) + return self.map:get(s, "use_policy") or "—" + end + +errors = mwan_rule:option(DummyValue, "errors", translate("Errors")) + errors.rawhtml = true + function errors.cfgvalue(self, s) + if not string.find(error_protocol_list, " " .. s .. " ") then + return "" + else + return "<span title=\"" .. translate("No protocol specified") .. "\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>" + end + end + + +return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/ruleconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/ruleconfig.lua new file mode 100644 index 0000000000..cb1b45d261 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/ruleconfig.lua @@ -0,0 +1,113 @@ +-- ------ extra functions ------ -- + +function ruleCheck() -- determine if rule needs a protocol specified + local sourcePort = ut.trim(sys.exec("uci -p /var/state get mwan3." .. arg[1] .. ".src_port")) + local destPort = ut.trim(sys.exec("uci -p /var/state get mwan3." .. arg[1] .. ".dest_port")) + if sourcePort ~= "" or destPort ~= "" then -- ports configured + local protocol = ut.trim(sys.exec("uci -p /var/state get mwan3." .. arg[1] .. ".proto")) + if protocol == "" or protocol == "all" then -- no or improper protocol + error_protocol = 1 + end + end +end + +function ruleWarn() -- display warning message at the top of the page + if error_protocol == 1 then + return "<font color=\"ff0000\"><strong>" .. translate("WARNING: This rule is incorrectly configured with no or improper protocol specified! Please configure a specific protocol!") .. "</strong></font>" + else + return "" + end +end + +function cbiAddPolicy(field) + uci.cursor():foreach("mwan3", "policy", + function (section) + field:value(section[".name"]) + end + ) +end + +function cbiAddProtocol(field) + local protocols = ut.trim(sys.exec("cat /etc/protocols | grep ' # ' | awk '{print $1}' | grep -vw -e 'ip' -e 'tcp' -e 'udp' -e 'icmp' -e 'esp' | grep -v 'ipv6' | sort | tr '\n' ' '")) + for p in string.gmatch(protocols, "%S+") do + field:value(p) + end +end + +-- ------ rule configuration ------ -- + +dsp = require "luci.dispatcher" +sys = require "luci.sys" +ut = require "luci.util" +arg[1] = arg[1] or "" + +error_protocol = 0 +ruleCheck() + + +m5 = Map("mwan3", translatef("MWAN Rule Configuration - %s", arg[1]), + ruleWarn()) + m5.redirect = dsp.build_url("admin", "network", "mwan", "configuration", "rule") + + +mwan_rule = m5:section(NamedSection, arg[1], "rule", "") + mwan_rule.addremove = false + mwan_rule.dynamic = false + + +src_ip = mwan_rule:option(Value, "src_ip", translate("Source address"), + translate("Supports CIDR notation (eg \"192.168.100.0/24\") without quotes")) + src_ip.datatype = ipaddr + +src_port = mwan_rule:option(Value, "src_port", translate("Source port"), + translate("May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or as a portrange (eg \"1024:2048\") without quotes")) + +dest_ip = mwan_rule:option(Value, "dest_ip", translate("Destination address"), + translate("Supports CIDR notation (eg \"192.168.100.0/24\") without quotes")) + dest_ip.datatype = ipaddr + +dest_port = mwan_rule:option(Value, "dest_port", translate("Destination port"), + translate("May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or as a portrange (eg \"1024:2048\") without quotes")) + +proto = mwan_rule:option(Value, "proto", translate("Protocol"), + translate("View the contents of /etc/protocols for protocol descriptions")) + proto.default = "all" + proto.rmempty = false + proto:value("all") + proto:value("ip") + proto:value("tcp") + proto:value("udp") + proto:value("icmp") + proto:value("esp") + cbiAddProtocol(proto) + +sticky = mwan_rule:option(ListValue, "sticky", translate("Sticky"), + translate("Traffic from the same source IP address that previously matched this rule within the sticky timeout period will use the same WAN interface")) + sticky.default = "0" + sticky:value("1", translate("Yes")) + sticky:value("0", translate("No")) + +timeout = mwan_rule:option(Value, "timeout", translate("Sticky timeout"), + translate("Seconds. Acceptable values: 1-1000000. Defaults to 600 if not set")) + timeout.datatype = "range(1, 1000000)" + +ipset = mwan_rule:option(Value, "ipset", translate("IPset"), + translate("Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/youtube.com/youtube\")")) + +use_policy = mwan_rule:option(Value, "use_policy", translate("Policy assigned")) + cbiAddPolicy(use_policy) + use_policy:value("unreachable", translate("unreachable (reject)")) + use_policy:value("blackhole", translate("blackhole (drop)")) + use_policy:value("default", translate("default (use main routing table)")) + + +-- ------ currently configured policies ------ -- + +mwan_policy = m5:section(TypedSection, "policy", translate("Currently Configured Policies")) + mwan_policy.addremove = false + mwan_policy.dynamic = false + mwan_policy.sortable = false + mwan_policy.template = "cbi/tblsection" + + +return m5 diff --git a/applications/luci-app-mwan3/luasrc/view/admin_status/index/mwan.htm b/applications/luci-app-mwan3/luasrc/view/admin_status/index/mwan.htm new file mode 100644 index 0000000000..53b997af90 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/view/admin_status/index/mwan.htm @@ -0,0 +1 @@ +<%+mwan/openwrt_overview_status%> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_diagnostics.htm b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_diagnostics.htm new file mode 100644 index 0000000000..4483485946 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_diagnostics.htm @@ -0,0 +1,115 @@ +<%+header%> + +<ul class="cbi-tabmenu"> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li> + <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li> +</ul> + +<% + local uci = require "luci.model.uci" + + interfaceNames = "" + uci.cursor():foreach("mwan3", "interface", + function (section) + interfaceNames = interfaceNames .. section[".name"] .. " " + end + ) +%> + +<script type="text/javascript" src="<%=resource%>/cbi.js"></script> +<script type="text/javascript">//<![CDATA[ + var stxhr = new XHR(); + + function update_status(tool, task, task_name) + { + var iface = document.getElementById('mwaniface').value; + var output = document.getElementById('diag_output'); + + if (tool == "service") + { + output.innerHTML = + '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="padding: 20px; vertical-align: middle;" /> ' + + String.format("<%:Waiting for MWAN to %s...%>", task_name) + ; + } + else + { + output.innerHTML = + '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="padding: 20px; vertical-align: middle;" /> ' + + "<%:Waiting for diagnostic results...%>" + ; + } + + output.parentNode.style.display = 'block'; + output.style.display = 'inline'; + + stxhr.get('<%=luci.dispatcher.build_url("admin", "network", "mwan", "advanced")%>/diagnostics_display' + '/' + iface + '/' + tool + '/' + task, null, + function(x, mArray) + { + if (mArray.diagnostics) + { + output.innerHTML = String.format('<pre id="diag_output_css">%h</pre>', mArray.diagnostics[0]); + } + else + { + output.innerHTML = '<pre id="diag_output_css"><strong><%:No diagnostic results returned%></strong></pre>'; + } + } + ); + } +//]]></script> + +<div id="mwan_diagnostics" class="cbi-map"> + <fieldset id="diag_select" class="cbi-section"> + <legend><%:MWAN Interface Diagnostics%></legend> + <select id="mwaniface"> + <% for z in interfaceNames:gmatch("[^ ]+") do -%><option value="<%=z%>"><%=z%></option><%- end %> + </select> + <div id="buttoncss"> + <input type="button" value="<%:Ping default gateway%>" class="cbi-button cbi-button-apply" onclick="update_status('ping', 'gateway', null)" /> + <input type="button" value="<%:Ping tracking IP%>" class="cbi-button cbi-button-apply" onclick="update_status('ping', 'track_ip', null)" /> + <input type="button" value="<%:Check IP rules%>" class="cbi-button cbi-button-apply" onclick="update_status('rulechk', null, null)" /> + <input type="button" value="<%:Check routing table%>" class="cbi-button cbi-button-apply" onclick="update_status('routechk', null, null)" /> + <input type="button" value="<%:Hotplug ifup%>" class="cbi-button cbi-button-apply" onclick="update_status('hotplug', 'ifup', null)" /> + <input type="button" value="<%:Hotplug ifdown%>" class="cbi-button cbi-button-apply" onclick="update_status('hotplug', 'ifdown', null)" /> + </div> + </fieldset> + <fieldset id="diag_select" class="cbi-section"> + <legend><%:MWAN Service Control%></legend> + <div id="buttoncss"> + <input type="button" value="<%:Restart MWAN%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'restart', '<%:restart%>')" /> + <input type="button" value="<%:Stop MWAN%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'stop', '<%:stop%>')" /> + <input type="button" value="<%:Start MWAN%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'start', '<%:start%>')" /> + </div> + </fieldset> + <fieldset class="cbi-section" style="display:none"> + <legend><%:Diagnostic Results%></legend> + <div id="diag_output"></div> + </fieldset> +</div> + +<style type="text/css"> + #mwaniface { + float: left; + margin: 8px 20px 0px 0px; + } + #buttoncss { + display: table; + float: left; + text-align: left; + } + .cbi-button { + margin: 8px 20px 0px 0px; + min-width: 153px; + } + #diag_output_css { + padding: 20px; + text-align: left; + } +</style> + +<%+footer%> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_hotplugscript.htm b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_hotplugscript.htm new file mode 100644 index 0000000000..10b4f10558 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_hotplugscript.htm @@ -0,0 +1,14 @@ +<ul class="cbi-tabmenu"> + <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li> +</ul> + +<style type="text/css"> + .cbi-section { + padding: 20px; + } +</style> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_mwanconfig.htm b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_mwanconfig.htm new file mode 100644 index 0000000000..20ae6036fc --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_mwanconfig.htm @@ -0,0 +1,14 @@ +<ul class="cbi-tabmenu"> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li> + <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li> +</ul> + +<style type="text/css"> + .cbi-section { + padding: 20px; + } +</style> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_networkconfig.htm b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_networkconfig.htm new file mode 100644 index 0000000000..bed43107c0 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_networkconfig.htm @@ -0,0 +1,14 @@ +<ul class="cbi-tabmenu"> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li> + <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li> +</ul> + +<style type="text/css"> + .cbi-section { + padding: 20px; + } +</style> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_troubleshooting.htm b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_troubleshooting.htm new file mode 100644 index 0000000000..4174ef4b21 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_troubleshooting.htm @@ -0,0 +1,63 @@ +<%+header%> + +<ul class="cbi-tabmenu"> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li> + <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li> +</ul> + +<script type="text/javascript" src="<%=resource%>/cbi.js"></script> +<script type="text/javascript">//<![CDATA[ + XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "network", "mwan", "advanced", "troubleshooting_display")%>', null, + function(x, mArray) + { + var tshoot = document.getElementById('troubleshoot_text'); + if (mArray.versions) + { + var versions = '<span class="description">Software versions : </span><br /><br />'; + var mwanConfig = '<br /><br /><span class="description">Output of "cat /etc/config/mwan3" : </span><br /><br />'; + var netConfig = '<br /><br /><span class="description">Output of "cat /etc/config/network" : </span><br /><br />'; + var wifiConfig = '<br /><br /><span class="description">Output of "cat /etc/config/wireless" : </span><br /><br />'; + var ifconfig = '<br /><br /><span class="description">Output of "ifconfig" : </span><br /><br />'; + var ipRoute = '<br /><br /><span class="description">Output of "route -n" : </span><br /><br />'; + var ipRuleShow = '<br /><br /><span class="description">Output of "ip rule show" : </span><br /><br />'; + var routeListTable = '<br /><br /><span class="description">Output of "ip route list table 1-250" : </span><br /><br />'; + var firewallOut = '<br /><br /><span class="description">Firewall default output policy (must be ACCEPT) : </span><br /><br />'; + var iptables = '<br /><br /><span class="description">Output of "iptables -L -t mangle -v -n" : </span><br /><br />'; + tshoot.innerHTML = String.format( + '<pre>%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s</pre>', + versions, mArray.versions[0], mwanConfig, mArray.mwanconfig[0], netConfig, mArray.netconfig[0], + wifiConfig, mArray.wificonfig[0], ifconfig, mArray.ifconfig[0], ipRoute, mArray.routeshow[0], + ipRuleShow, mArray.iprule[0], routeListTable, mArray.routelist[0], firewallOut, mArray.firewallout[0], + iptables, mArray.iptables[0] + ); + } + else + { + tshoot.innerHTML = '<strong><%:Error collecting troubleshooting information%></strong>'; + } + } + ); +//]]></script> + +<div id="troubleshoot"> + <fieldset class="cbi-section"> + <legend><%:Troubleshooting Data%></legend> + <div id="troubleshoot_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div> + </fieldset> +</div> + +<style type="text/css"> + #troubleshoot_text { + padding: 20px; + text-align: left; + } + .description { + background-color: rgb(78, 186, 241); + } +</style> + +<%+footer%> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_wirelessconfig.htm b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_wirelessconfig.htm new file mode 100644 index 0000000000..bb18d53493 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_wirelessconfig.htm @@ -0,0 +1,14 @@ +<ul class="cbi-tabmenu"> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li> + <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li> +</ul> + +<style type="text/css"> + .cbi-section { + padding: 20px; + } +</style> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/config_css.htm b/applications/luci-app-mwan3/luasrc/view/mwan/config_css.htm new file mode 100644 index 0000000000..5d91c536eb --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/view/mwan/config_css.htm @@ -0,0 +1,28 @@ +<style type="text/css"> + table td { /* cells showing the configuration values */ + padding: 0px; + text-align: center; + vertical-align: middle; + } + table th { /* column for configuration section name */ + padding: 0px; + text-align: center; + vertical-align: middle; + } + table tbody th { /* column for configuration section name */ + padding: 0px; + vertical-align: middle; + } + .cbi-section-node table div { /* rows */ + padding-top: 5px; + } + table.cbi-section-table td.cbi-section-table-cell { /* sort buttons column */ + text-align: center; + } + .cbi-section h3 { + color: rgb(85, 85, 85); + font-family: Trebuchet MS,Verdana,sans-serif; + font-style: italic; + font-weight: normal; + } +</style> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/openwrt_overview_status.htm b/applications/luci-app-mwan3/luasrc/view/mwan/openwrt_overview_status.htm new file mode 100644 index 0000000000..7cef0630ee --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/view/mwan/openwrt_overview_status.htm @@ -0,0 +1,80 @@ +<script type="text/javascript">//<![CDATA[ + XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "mwan", "overview", "interface_status")%>', null, + function(x, mArray) + { + var status = document.getElementById('mwan_status_text'); + if (mArray.wans) + { + var temp = ''; + for ( var i = 0; i < mArray.wans.length; i++ ) + { + var stat = ''; + var cssc = ''; + switch (mArray.wans[i].status) + { + case 'online': + stat = '<%:Online (tracking active)%>'; + cssc = 'wanon'; + break; + case 'notMonitored': + stat = '<%:Online (tracking off)%>'; + cssc = 'wanon'; + break; + case 'offline': + stat = '<%:Offline%>'; + cssc = 'wanoff'; + break; + case 'notEnabled': + stat = '<%:Disabled%>'; + cssc = 'wanoff'; + break; + } + temp += String.format( + '<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>', + cssc, mArray.wans[i].name, mArray.wans[i].link, mArray.wans[i].ifname, stat + ); + } + status.innerHTML = temp; + } + else + { + status.innerHTML = '<strong><%:No MWAN interfaces found%></strong>'; + } + } + ); +//]]></script> + +<fieldset id="interface_field" class="cbi-section"> + <legend><%:MWAN Interface Live Status%></legend> + <div id="mwan_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div> +</fieldset> + +<style type="text/css"> + .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */ + max-width: 1044px; + } + #mwan_status_text { + display: table; + font-size: 14px; + margin: auto; + max-width: 1044px; + min-width: 246px; + width: 100%; + } + .wanon { + background-color: rgb(144, 240, 144); + } + .wanoff { + background-color: rgb(240, 144, 144); + } + .wanon, .wanoff { + border-radius: 60px; + box-shadow: 0px 2px 5px -3px; + float: left; + margin: 8px 3px 0px 3px; + min-height: 30px; + min-width: 235px; + padding: 5px 10px 8px 10px; + text-align: center; + } +</style> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/overview_detailed.htm b/applications/luci-app-mwan3/luasrc/view/mwan/overview_detailed.htm new file mode 100644 index 0000000000..6a800c3f98 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/view/mwan/overview_detailed.htm @@ -0,0 +1,40 @@ +<%+header%> + +<ul class="cbi-tabmenu"> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/overview")%>"><%:Interface Status%></a></li> + <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/overview/overview_detailed")%>"><%:Detailed Status%></a></li> +</ul> + +<script type="text/javascript" src="<%=resource%>/cbi.js"></script> +<script type="text/javascript">//<![CDATA[ + XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "mwan", "overview", "detailed_status")%>', null, + function(x, mArray) + { + var status = document.getElementById('mwan_detail_text'); + if (mArray.mwandetail) + { + status.innerHTML = String.format('<pre>%s</pre>', mArray.mwandetail[0]); + } + else + { + status.innerHTML = '<strong><%:No detailed status information available%></strong>'; + } + } + ); +//]]></script> + +<div id="mwan_detail_status"> + <fieldset class="cbi-section"> + <legend><%:MWAN Detailed Status%></legend> + <div id="mwan_detail_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div> + </fieldset> +</div> + +<style type="text/css"> + #mwan_detail_text { + padding: 20px; + text-align: left; + } +</style> + +<%+footer%> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/overview_interface.htm b/applications/luci-app-mwan3/luasrc/view/mwan/overview_interface.htm new file mode 100644 index 0000000000..2929a6df60 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/view/mwan/overview_interface.htm @@ -0,0 +1,108 @@ +<%+header%> + +<ul class="cbi-tabmenu"> + <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/overview")%>"><%:Interface Status%></a></li> + <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/overview/overview_detailed")%>"><%:Detailed Status%></a></li> +</ul> + +<script type="text/javascript" src="<%=resource%>/cbi.js"></script> +<script type="text/javascript">//<![CDATA[ + XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "mwan", "overview", "interface_status")%>', null, + function(x, mArray) + { + var statusDiv = document.getElementById('mwan_status_text'); + if (mArray.wans) + { + var interfaceStatus = ''; + for ( var i = 0; i < mArray.wans.length; i++ ) + { + var status = ''; + var css = ''; + switch (mArray.wans[i].status) + { + case 'online': + status = '<%:Online (tracking active)%>'; + css = 'wanon'; + break; + case 'notMonitored': + status = '<%:Online (tracking off)%>'; + css = 'wanon'; + break; + case 'offline': + status = '<%:Offline%>'; + css = 'wanoff'; + break; + case 'notEnabled': + status = '<%:Disabled%>'; + css = 'wanoff'; + break; + } + interfaceStatus += String.format( + '<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>', + css, mArray.wans[i].name, mArray.wans[i].link, mArray.wans[i].ifname, status + ); + } + statusDiv.innerHTML = interfaceStatus; + } + else + { + statusDiv.innerHTML = '<strong><%:No MWAN interfaces found%></strong>'; + } + + var logs = document.getElementById('mwan_statuslog_text'); + if (mArray.mwanlog) + { + var mwanLog = '<%:Last 50 MWAN systemlog entries. Newest entries sorted at the top :%>'; + logs.innerHTML = String.format('<pre>%s<br /><br />%s</pre>', mwanLog, mArray.mwanlog[0]); + } + else + { + logs.innerHTML = '<strong><%:No MWAN systemlog history found%></strong>'; + } + } + ); +//]]></script> + +<div id="mwan_interface_status"> + <fieldset id="interface_field" class="cbi-section"> + <legend><%:MWAN Interface Live Status%></legend> + <div id="mwan_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div> + </fieldset> + <fieldset class="cbi-section"> + <legend><%:MWAN Interface Systemlog%></legend> + <div id="mwan_statuslog_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div> + </fieldset> +</div> + +<style type="text/css"> + #mwan_status_text { + display: table; + font-size: 14px; + margin: auto; + max-width: 1044px; + min-width: 246px; + width: 100%; + } + .wanon { + background-color: rgb(144, 240, 144); + } + .wanoff { + background-color: rgb(240, 144, 144); + } + .wanon, .wanoff { + border-radius: 60px; + box-shadow: 0px 2px 5px -3px; + float: left; + margin: 8px 3px 0px 3px; + min-height: 30px; + min-width: 235px; + padding: 5px 10px 8px 10px; + text-align: center; + } + #mwan_statuslog_text { + padding: 20px; + text-align: left; + } +</style> + +<%+footer%> diff --git a/applications/luci-app-mwan3/po/ja/mwan3.po b/applications/luci-app-mwan3/po/ja/mwan3.po new file mode 100644 index 0000000000..34a9f1f3b3 --- /dev/null +++ b/applications/luci-app-mwan3/po/ja/mwan3.po @@ -0,0 +1,665 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.3\n" +"Last-Translator: INAGAKI Hiroshi <musashino.open@gmail.com>\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language: ja\n" + +msgid "%d hour" +msgstr "%d 時間" + +msgid "%d minute" +msgstr "%d 分" + +msgid "%d minutes" +msgstr "%d 分" + +msgid "%d second" +msgstr "%d 秒" + +msgid "%d seconds" +msgstr "%d 秒" + +msgid "" +"Acceptable values: 1-100. This many Tracking IP addresses must respond for " +"the link to be deemed up" +msgstr "" +"利用可能な値: 1-100。上記の追跡 IP の合計個数のうち、Up 状態と判定するために" +"に必要な、レスポンスが返された追跡 IP アドレスの個数です。" + +msgid "Acceptable values: 1-1000. Defaults to 1 if not set" +msgstr "利用可能な値: 1-1000。空欄の場合のデフォルトは1です。" + +msgid "Advanced" +msgstr "詳細設定" + +msgid "Check IP rules" +msgstr "IP ルールのチェック" + +msgid "Check routing table" +msgstr "ルーティング テーブルのチェック" + +msgid "Collecting data..." +msgstr "データ収集中です..." + +msgid "Configuration" +msgstr "設定" + +msgid "Currently Configured Interfaces" +msgstr "設定済みインターフェース" + +msgid "Currently Configured Members" +msgstr "設定済みメンバー" + +msgid "Currently Configured Policies" +msgstr "設定済みポリシー" + +msgid "Destination address" +msgstr "宛先アドレス" + +msgid "Destination port" +msgstr "宛先ポート" + +msgid "Detailed Status" +msgstr "詳細ステータス" + +msgid "Diagnostic Results" +msgstr "診断結果" + +msgid "Diagnostics" +msgstr "診断機能" + +msgid "Disabled" +msgstr "無効" + +msgid "" +"Downed interface will be deemed up after this many successful ping tests" +msgstr "" +"Down 状態のインターフェースが Up 状態と判断されるまでに要する ping テストの成" +"功回数です。" + +msgid "Enabled" +msgstr "有効" + +msgid "Enter value in hex, starting with <code>0x</code>" +msgstr "<code>0x</code> で始まる16進数の値を入力してください。" + +msgid "Error collecting troubleshooting information" +msgstr "トラブルシューティング情報の収集エラー" + +msgid "Errors" +msgstr "エラー" + +msgid "Expect interface state on up event" +msgstr "Up イベント時に予想されるインターフェースの状態です。" + +msgid "Failure interval" +msgstr "障害検出 インターバル" + +msgid "Firewall mask" +msgstr "ファイアウォール マスク" + +msgid "Flush conntrack table" +msgstr "" + +msgid "Flush global firewall conntrack table on interface events" +msgstr "" + +msgid "Globals" +msgstr "全般" + +msgid "Globals mwan3 options" +msgstr "MWAN3 全般オプション" + +msgid "Hotplug Script" +msgstr "ホットプラグ スクリプト" + +msgid "Hotplug ifdown" +msgstr "ホットプラグ ifdown" + +msgid "Hotplug ifup" +msgstr "ホットプラグ ifup" + +msgid "IPset" +msgstr "IPset" + +msgid "IPv4" +msgstr "IPv4" + +msgid "IPv6" +msgstr "IPv6" + +msgid "Initial state" +msgstr "初期状態" + +msgid "Interface" +msgstr "インターフェース" + +msgid "Interface Status" +msgstr "インターフェース ステータス" + +msgid "Interface down" +msgstr "インターフェース Down" + +msgid "Interface up" +msgstr "インターフェース Up" + +msgid "Interface will be deemed down after this many failed ping tests" +msgstr "" +"インターフェースが Down 状態と判断されるまでに要する ping テストの失敗回数で" +"す。" + +msgid "Interfaces" +msgstr "インターフェース" + +msgid "Internet Protocol" +msgstr "インターネット プロトコル" + +msgid "Keep failure interval" +msgstr "" + +msgid "Keep ping failure interval during failure state" +msgstr "" + +msgid "Last 50 MWAN systemlog entries. Newest entries sorted at the top :" +msgstr "直近の MWAN システムログ(50行)です。一番上が最新の行です:" + +msgid "Last resort" +msgstr "最終手段" + +msgid "Load Balancing" +msgstr "負荷分散" + +msgid "Loading" +msgstr "読込中" + +msgid "Local source interface" +msgstr "" + +msgid "MWAN Config" +msgstr "MWAN 設定" + +msgid "MWAN Detailed Status" +msgstr "MWAN 詳細ステータス" + +msgid "MWAN Interface Configuration" +msgstr "MWAN インターフェース設定" + +msgid "MWAN Interface Configuration - %s" +msgstr "MWAN インターフェース設定 - %s" + +msgid "MWAN Interface Diagnostics" +msgstr "MWAN インターフェース診断" + +msgid "MWAN Interface Live Status" +msgstr "MWAN インターフェース Live ステータス" + +msgid "MWAN Interface Systemlog" +msgstr "MWAN インターフェース システムログ" + +msgid "MWAN Member Configuration" +msgstr "MWAN メンバー設定" + +msgid "MWAN Member Configuration - %s" +msgstr "MWAN メンバー設定 - %s" + +msgid "MWAN Policy Configuration" +msgstr "MWAN ポリシー設定" + +msgid "MWAN Policy Configuration - %s" +msgstr "MWAN ポリシー設定 - %s" + +msgid "MWAN Rule Configuration" +msgstr "MWAN ルール設定" + +msgid "MWAN Rule Configuration - %s" +msgstr "MWAN ルール設定 - %s" + +msgid "MWAN Service Control" +msgstr "MWAN サービス コントロール" + +msgid "" +"MWAN supports up to 250 physical and/or logical interfaces<br />MWAN " +"requires that all interfaces have a unique metric configured in /etc/config/" +"network<br />Names must match the interface name found in /etc/config/" +"network (see advanced tab)<br />Names may contain characters A-Z, a-z, 0-9, " +"_ and no spaces<br />Interfaces may not share the same name as configured " +"members, policies or rules" +msgstr "" +"MWAN は、250個までの物理または論理、あるいは両方のインターフェースをサポート" +"します。<br />MWAN は、全てのインターフェースが /etc/config/network で設定さ" +"れるユニークなメトリックを持つことを必要とします。<br />下記 \"インターフェー" +"ス\" の名前は、 /etc/config/network に存在するインターフェース名と同じでなけ" +"ればなりません(詳細設定タブを確認)。<br />名前は A-Z, a-z, 0-9, _ を含むこ" +"とができますが、スペースは使用できません。<br />インターフェースには、設定済" +"みのメンバーやポリシー、ルールと同じ名前を使用することはできません。" + +msgid "" +"May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or " +"as a portrange (eg \"1024:2048\") without quotes" +msgstr "" +"単一または複数のポート(例: \"22\" または \"80,443\")、あるいはポートの範囲" +"(例: \"1024:2048\")を、クオーテーション無しで指定することができます。" + +msgid "Member" +msgstr "メンバー" + +msgid "Member used" +msgstr "使用されるメンバー" + +msgid "Members" +msgstr "メンバー" + +msgid "" +"Members are profiles attaching a metric and weight to an MWAN interface<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Members " +"may not share the same name as configured interfaces, policies or rules" +msgstr "" +"メンバーは、MWAN インターフェースのメトリックおよびウエイトを関連付けたプロ" +"ファイルです。<br />名前は A-Z, a-z, 0-9, _ を含むことができますが、スペース" +"は使用できません。<br />メンバーには、設定済みのインターフェースやポリシー、" +"ルールと同じ名前を使用することはできません。" + +msgid "Members assigned" +msgstr "アサイン済みメンバー" + +msgid "Metric" +msgstr "メトリック" + +msgid "" +"Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/" +"youtube.com/youtube\")" +msgstr "" +"IPset ルールの名前です。このルールは、 /etc/dnsmasq.conf で必要です。(例: " +"\"ipset=/youtube.com/youtube\")" + +msgid "Network Config" +msgstr "ネットワーク設定" + +msgid "No" +msgstr "いいえ" + +msgid "No MWAN interfaces found" +msgstr "MWAN インターフェースが見つかりません" + +msgid "No MWAN systemlog history found" +msgstr "MWAN システムログの履歴が見つかりません" + +msgid "No detailed status information available" +msgstr "詳細ステータス情報は利用できません" + +msgid "No diagnostic results returned" +msgstr "診断結果がありません" + +msgid "No protocol specified" +msgstr "プロトコルが設定されていません" + +msgid "Offline" +msgstr "オフライン" + +msgid "Online" +msgstr "オンライン" + +msgid "Online (tracking active)" +msgstr "オンライン(追跡実行中)" + +msgid "Online (tracking off)" +msgstr "オンライン(追跡オフ)" + +msgid "Overview" +msgstr "概要" + +msgid "Ping count" +msgstr "Ping 回数" + +msgid "Ping default gateway" +msgstr "Ping デフォルト ゲートウェイ" + +msgid "Ping interval" +msgstr "Ping インターバル" + +msgid "Ping interval during failure detection" +msgstr "障害検出中の Ping 実行間隔です。" + +msgid "Ping interval during failure recovering" +msgstr "障害復旧中の Ping 実行間隔です。" + +msgid "Ping size" +msgstr "Ping サイズ" + +msgid "Ping timeout" +msgstr "Ping タイムアウト" + +msgid "Ping tracking IP" +msgstr "Ping トラッキング IP" + +msgid "Policies" +msgstr "ポリシー" + +msgid "" +"Policies are profiles grouping one or more members controlling how MWAN " +"distributes traffic<br />Member interfaces with lower metrics are used " +"first. Interfaces with the same metric load-balance<br />Load-balanced " +"member interfaces distribute more traffic out those with higher weights<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be " +"15 characters or less<br />Policies may not share the same name as " +"configured interfaces, members or rules" +msgstr "" +"ポリシーは、MWANがどのようにトラフィックの分配を行うかを制御する、1つ以上のメ" +"ンバーをグループ化するプロファイルです。<br />最小のメトリックを持つメンバー " +"インターフェースが最初に使用されます。同じメトリックを持つ複数のインター" +"フェースでは、負荷分散を行います。<br />負荷分散に設定されたメンバー インター" +"フェースでは、ウェイトの値が大きい方により多くのトラフィックを分配します。" +"<br />名前は A-Z, a-z, 0-9, _ を含むことができますが、スペースは使用できませ" +"ん。また、15文字以内でなければなりません。<br />ポリシーでは、設定済みのイン" +"ターフェースやメンバー、ルールと同じ名前を使用することはできません。" + +msgid "Policy" +msgstr "ポリシー" + +msgid "Policy assigned" +msgstr "アサイン済みポリシー" + +msgid "Protocol" +msgstr "プロトコル" + +msgid "Recovery interval" +msgstr "障害復旧 インターバル" + +msgid "Restart MWAN" +msgstr "MWAN の再起動" + +msgid "Rule" +msgstr "ルール" + +msgid "Rules" +msgstr "ルール" + +msgid "" +"Rules specify which traffic will use a particular MWAN policy based on IP " +"address, port or protocol<br />Rules are matched from top to bottom. Rules " +"below a matching rule are ignored. Traffic not matching any rule is routed " +"using the main routing table<br />Traffic destined for known (other than " +"default) networks is handled by the main routing table. Traffic matching a " +"rule, but all WAN interfaces for that policy are down will be blackholed<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Rules may " +"not share the same name as configured interfaces, members or policies" +msgstr "" +"ルールは IP アドレスやポート、プロトコルを基に、トラフィックがどの MWAN ポリ" +"シーを使用するかを設定します。<br />ルールは上から下へマッチングが行われ、合" +"致したルールより下のルールは無視されます。全てのルールに合致しないトラフィッ" +"クは、メインのルーティング テーブルを使用してルートが決定されます。<br />既知" +"(デフォルト以外)のネットワークへのトラフィックは、メインのルーティング テー" +"ブルによって制御されます。ルールに合致したトラフィックでも、当該ポリシーの全 " +"WAN インターフェースが Down 状態の場合は blackhole 状態となります。<br />名前" +"は A-Z, a-z, 0-9, _ を含むことができますが、スペースは使用できません。<br />" +"ルールは、設定済みのインターフェースやメンバー、ポリシーと同じ名前を使用する" +"ことはできません。" + +msgid "Seconds. Acceptable values: 1-1000000. Defaults to 600 if not set" +msgstr "秒。利用可能な値: 1-1000000。空欄の場合のデフォルト値は600です。" + +msgid "Source address" +msgstr "送信元アドレス" + +msgid "Source port" +msgstr "送信元ポート" + +msgid "Start MWAN" +msgstr "MWAN の起動" + +msgid "Sticky" +msgstr "Sticky" + +msgid "Sticky timeout" +msgstr "Sticky タイムアウト" + +msgid "Stop MWAN" +msgstr "MWAN の停止" + +msgid "Supports CIDR notation (eg \"192.168.100.0/24\") without quotes" +msgstr "CIDR 表記のサポート(例: \"192.168.100.0/24\")" + +msgid "There are currently %d of 250 supported interfaces configured" +msgstr "現在、250個中 %d 個のサポートされたインターフェースが設定済みです。" + +msgid "" +"This displays the metric assigned to this interface in /etc/config/network" +msgstr "" +"/etc/config/network で、このインターフェースに割り当てられたメトリックです。" + +msgid "" +"This hostname or IP address will be pinged to determine if the link is up or " +"down. Leave blank to assume interface is always online" +msgstr "" +"リンクの Up または Down 状態を判定するために、このホスト名または IP アドレス" +"に対して Ping の送信が行われます。常にオンラインとする場合、空欄のままにしま" +"す。" + +msgid "" +"This section allows you to modify the content of \"/etc/mwan3.user\".<br /" +">The file is also preserved during sysupgrade.<br /><br />Notes:<br />This " +"file is interpreted as a shell script.<br />The first line of the script " +"must be "#!/bin/sh" without quotes.<br />Lines beginning with # are " +"comments and are not executed.<br />Put your custom mwan3 action here, they " +"will<br />be executed with each netifd hotplug interface event<br />on " +"interfaces for which mwan3 is enabled.<br /><br />There are three main " +"environment variables that are passed to this script.<br /><br />$ACTION " +"Either \"ifup\" or \"ifdown\"<br />$INTERFACE Name of the interface which " +"went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE Physical device name " +"which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br /><br />" +msgstr "" +"このセクションでは、 \"/etc/mwan3.user\" の内容を変更することができます。" +"<br />このファイルは、 sysupgrade 時に保持されます。<br /><br />注意: <br />" +"このファイルは、シェルスクリプトとして解釈されます。<br />スクリプトの1行目" +"は、"#!bin/sh" である必要があります(クォーテーション不要)。<br /># " +"で始まる行はコメントであり、実行されません。<br />mwan3 のカスタム動作をここ" +"に入力してください。これらは、 mwan3 が有効なインターフェースの<br />netifd " +"ホットプラグ インターフェース イベント毎に実行されます。<br /><br />主に3つの" +"環境変数が利用可能です。<br /><br />$ACTION - \"ifup\" および \"ifdown\"<br /" +">$INTERFACE - Up または Down が行われたインターフェース名(例: \"wan\" や " +"\"wwan\")<br />$DEVICE - Up または Down が行われた物理デバイス名(例: " +"\"eth0\" や \"wwan0\")<br /><br />" + +msgid "This section allows you to modify the contents of /etc/config/mwan3" +msgstr "" +"このセクションでは、 /etc/config/mwan3 の内容を変更することができます。" + +msgid "This section allows you to modify the contents of /etc/config/network" +msgstr "" +"このセクションでは、 /etc/config/network の内容を変更することができます。" + +msgid "This section allows you to modify the contents of /etc/config/wireless" +msgstr "" +"このセクションでは、 /etc/config/wireless の内容を変更することができます。" + +msgid "Tracking IP" +msgstr "追跡 IP" + +msgid "Tracking hostname or IP address" +msgstr "追跡ホスト名または IP アドレス" + +msgid "Tracking method" +msgstr "追跡方式" + +msgid "Tracking reliability" +msgstr "追跡の信頼性" + +msgid "Traffic Rules" +msgstr "トラフィック ルール" + +msgid "" +"Traffic from the same source IP address that previously matched this rule " +"within the sticky timeout period will use the same WAN interface" +msgstr "" +"以前このルールにマッチした同じアクセス元 IP アドレスからのトラフィックが、再" +"度 Sticky 制限時間内にマッチした場合には、同じ WAN インターフェースが使用され" +"ます。" + +msgid "Troubleshooting" +msgstr "トラブルシューティング" + +msgid "Troubleshooting Data" +msgstr "トラブルシューティング データ" + +msgid "" +"Use the IP address of this interface as source IP address for traffic " +"initiated by the router itself" +msgstr "" +"ルーター自身によって発生するトラフィックのアクセス元 IP アドレスとして、この" +"インターフェースの IP アドレスが使用されます。" + +msgid "View the contents of /etc/protocols for protocol descriptions" +msgstr "プロトコルの説明については、 /etc/protocols の内容を確認してください。" + +msgid "WARNING: %d interfaces are configured exceeding the maximum of 250!" +msgstr "" +"警告: %d 個のインターフェースが、最大個数の 250個 を超えて設定されています!" + +msgid "" +"WARNING: Some interfaces are configured incorrectly or not at all in /etc/" +"config/network!" +msgstr "" +"警告: 設定を誤っているか、もしくは完全に設定されていないインターフェースがあ" +"ります!" + +msgid "" +"WARNING: Some interfaces have a higher reliability requirement than there " +"are tracking IP addresses!" +msgstr "" +"警告: 追跡 IP アドレスの個数より大きい追跡信頼性の値が設定されたインター" +"フェースがあります!" + +msgid "" +"WARNING: Some interfaces have duplicate metrics configured in /etc/config/" +"network!" +msgstr "" +"警告: /etc/config/network で、重複するメトリックを設定されているインター" +"フェースがあります!" + +msgid "" +"WARNING: Some interfaces have no default route in the main routing table!" +msgstr "" +"警告: メインのルーティング テーブルで、デフォルト ルートを設定されていないイ" +"ンターフェースがあります!" + +msgid "" +"WARNING: Some interfaces have no metric configured in /etc/config/network!" +msgstr "" +"警告: /etc/config/network で、メトリックを設定されていないインターフェースが" +"あります!" + +msgid "" +"WARNING: Some policies have names exceeding the maximum of 15 characters!" +msgstr "" +"警告: 最大文字数の 15 文字を超える名前が設定されているポリシーがあります!" + +msgid "" +"WARNING: Some rules have a port configured with no or improper protocol " +"specified! Please configure a specific protocol!" +msgstr "" +"警告: 不適切なプロトコルが指定されている、または何も指定されていないポートを" +"設定されたルールがあります!プロトコルを指定し直してください!" + +msgid "" +"WARNING: This and other interfaces have duplicate metrics configured in /etc/" +"config/network!" +msgstr "" +"警告: これと他のインターフェースで重複するメトリックが /etc/config/network に" +"設定されています!" + +msgid "" +"WARNING: This interface has a higher reliability requirement than there are " +"tracking IP addresses!" +msgstr "" +"警告: このインターフェースは、追跡 IP アドレスの個数より大きい追跡信頼性の値" +"を設定されています!" + +msgid "WARNING: This interface has no default route in the main routing table!" +msgstr "" +"警告: このインターフェースは、メインのルーティング テーブルにデフォルト ルー" +"トが設定されていません!" + +msgid "" +"WARNING: This interface has no metric configured in /etc/config/network!" +msgstr "" +"警告: このインターフェースは、 /etc/config/network でメトリックが設定されてい" +"ません!" + +msgid "" +"WARNING: This interface is configured incorrectly or not at all in /etc/" +"config/network!" +msgstr "" +"警告: このインターフェースは /etc/config/network で設定が誤っているか、もしく" +"は完全に設定されていません!" + +msgid "" +"WARNING: This policy's name is %d characters exceeding the maximum of 15!" +msgstr "" +"警告: このポリシーの名前は、最大文字数 15 文字を超える %d 文字が設定されてい" +"ます!" + +msgid "" +"WARNING: This rule is incorrectly configured with no or improper protocol " +"specified! Please configure a specific protocol!" +msgstr "" +"警告: このルールは不適切なプロトコルが指定されているか、または何も指定されて" +"いません!プロトコルを指定し直してください!" + +msgid "Waiting for MWAN to %s..." +msgstr "MWAN の %s を待っています..." + +msgid "Waiting for diagnostic results..." +msgstr "診断結果を待っています..." + +msgid "Weight" +msgstr "ウエイト" + +msgid "" +"When all policy members are offline use this behavior for matched traffic" +msgstr "" +"ポリシーの全メンバーがオフラインの場合、合致したトラフィックに対してこのふる" +"まいが使用されます。" + +msgid "Wireless Config" +msgstr "無線設定" + +msgid "Yes" +msgstr "はい" + +msgid "always" +msgstr "always" + +msgid "blackhole (drop)" +msgstr "blackhole (drop)" + +msgid "default (use main routing table)" +msgstr "デフォルト(メインのルーティング テーブルを使用)" + +msgid "ifdown" +msgstr "ifdown" + +msgid "ifup" +msgstr "ifup" + +msgid "never" +msgstr "never" + +msgid "restart" +msgstr "再起動" + +msgid "start" +msgstr "起動" + +msgid "stop" +msgstr "停止" + +msgid "unreachable (reject)" +msgstr "unreachable (reject)" diff --git a/applications/luci-app-mwan3/po/templates/mwan3.pot b/applications/luci-app-mwan3/po/templates/mwan3.pot new file mode 100644 index 0000000000..ed9fdb131d --- /dev/null +++ b/applications/luci-app-mwan3/po/templates/mwan3.pot @@ -0,0 +1,562 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "%d hour" +msgstr "" + +msgid "%d minute" +msgstr "" + +msgid "%d minutes" +msgstr "" + +msgid "%d second" +msgstr "" + +msgid "%d seconds" +msgstr "" + +msgid "" +"Acceptable values: 1-100. This many Tracking IP addresses must respond for " +"the link to be deemed up" +msgstr "" + +msgid "Acceptable values: 1-1000. Defaults to 1 if not set" +msgstr "" + +msgid "Advanced" +msgstr "" + +msgid "Check IP rules" +msgstr "" + +msgid "Check routing table" +msgstr "" + +msgid "Collecting data..." +msgstr "" + +msgid "Configuration" +msgstr "" + +msgid "Currently Configured Interfaces" +msgstr "" + +msgid "Currently Configured Members" +msgstr "" + +msgid "Currently Configured Policies" +msgstr "" + +msgid "Destination address" +msgstr "" + +msgid "Destination port" +msgstr "" + +msgid "Detailed Status" +msgstr "" + +msgid "Diagnostic Results" +msgstr "" + +msgid "Diagnostics" +msgstr "" + +msgid "Disabled" +msgstr "" + +msgid "" +"Downed interface will be deemed up after this many successful ping tests" +msgstr "" + +msgid "Enabled" +msgstr "" + +msgid "Enter value in hex, starting with <code>0x</code>" +msgstr "" + +msgid "Error collecting troubleshooting information" +msgstr "" + +msgid "Errors" +msgstr "" + +msgid "Expect interface state on up event" +msgstr "" + +msgid "Failure interval" +msgstr "" + +msgid "Firewall mask" +msgstr "" + +msgid "Flush conntrack table" +msgstr "" + +msgid "Flush global firewall conntrack table on interface events" +msgstr "" + +msgid "Globals" +msgstr "" + +msgid "Globals mwan3 options" +msgstr "" + +msgid "Hotplug Script" +msgstr "" + +msgid "Hotplug ifdown" +msgstr "" + +msgid "Hotplug ifup" +msgstr "" + +msgid "IPset" +msgstr "" + +msgid "IPv4" +msgstr "" + +msgid "IPv6" +msgstr "" + +msgid "Initial state" +msgstr "" + +msgid "Interface" +msgstr "" + +msgid "Interface Status" +msgstr "" + +msgid "Interface down" +msgstr "" + +msgid "Interface up" +msgstr "" + +msgid "Interface will be deemed down after this many failed ping tests" +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Internet Protocol" +msgstr "" + +msgid "Keep failure interval" +msgstr "" + +msgid "Keep ping failure interval during failure state" +msgstr "" + +msgid "Last 50 MWAN systemlog entries. Newest entries sorted at the top :" +msgstr "" + +msgid "Last resort" +msgstr "" + +msgid "Load Balancing" +msgstr "" + +msgid "Loading" +msgstr "" + +msgid "Local source interface" +msgstr "" + +msgid "MWAN Config" +msgstr "" + +msgid "MWAN Detailed Status" +msgstr "" + +msgid "MWAN Interface Configuration" +msgstr "" + +msgid "MWAN Interface Configuration - %s" +msgstr "" + +msgid "MWAN Interface Diagnostics" +msgstr "" + +msgid "MWAN Interface Live Status" +msgstr "" + +msgid "MWAN Interface Systemlog" +msgstr "" + +msgid "MWAN Member Configuration" +msgstr "" + +msgid "MWAN Member Configuration - %s" +msgstr "" + +msgid "MWAN Policy Configuration" +msgstr "" + +msgid "MWAN Policy Configuration - %s" +msgstr "" + +msgid "MWAN Rule Configuration" +msgstr "" + +msgid "MWAN Rule Configuration - %s" +msgstr "" + +msgid "MWAN Service Control" +msgstr "" + +msgid "" +"MWAN supports up to 250 physical and/or logical interfaces<br />MWAN " +"requires that all interfaces have a unique metric configured in /etc/config/" +"network<br />Names must match the interface name found in /etc/config/" +"network (see advanced tab)<br />Names may contain characters A-Z, a-z, 0-9, " +"_ and no spaces<br />Interfaces may not share the same name as configured " +"members, policies or rules" +msgstr "" + +msgid "" +"May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or " +"as a portrange (eg \"1024:2048\") without quotes" +msgstr "" + +msgid "Member" +msgstr "" + +msgid "Member used" +msgstr "" + +msgid "Members" +msgstr "" + +msgid "" +"Members are profiles attaching a metric and weight to an MWAN interface<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Members " +"may not share the same name as configured interfaces, policies or rules" +msgstr "" + +msgid "Members assigned" +msgstr "" + +msgid "Metric" +msgstr "" + +msgid "" +"Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/" +"youtube.com/youtube\")" +msgstr "" + +msgid "Network Config" +msgstr "" + +msgid "No" +msgstr "" + +msgid "No MWAN interfaces found" +msgstr "" + +msgid "No MWAN systemlog history found" +msgstr "" + +msgid "No detailed status information available" +msgstr "" + +msgid "No diagnostic results returned" +msgstr "" + +msgid "No protocol specified" +msgstr "" + +msgid "Offline" +msgstr "" + +msgid "Online" +msgstr "" + +msgid "Online (tracking active)" +msgstr "" + +msgid "Online (tracking off)" +msgstr "" + +msgid "Overview" +msgstr "" + +msgid "Ping count" +msgstr "" + +msgid "Ping default gateway" +msgstr "" + +msgid "Ping interval" +msgstr "" + +msgid "Ping interval during failure detection" +msgstr "" + +msgid "Ping interval during failure recovering" +msgstr "" + +msgid "Ping size" +msgstr "" + +msgid "Ping timeout" +msgstr "" + +msgid "Ping tracking IP" +msgstr "" + +msgid "Policies" +msgstr "" + +msgid "" +"Policies are profiles grouping one or more members controlling how MWAN " +"distributes traffic<br />Member interfaces with lower metrics are used " +"first. Interfaces with the same metric load-balance<br />Load-balanced " +"member interfaces distribute more traffic out those with higher weights<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be " +"15 characters or less<br />Policies may not share the same name as " +"configured interfaces, members or rules" +msgstr "" + +msgid "Policy" +msgstr "" + +msgid "Policy assigned" +msgstr "" + +msgid "Protocol" +msgstr "" + +msgid "Recovery interval" +msgstr "" + +msgid "Restart MWAN" +msgstr "" + +msgid "Rule" +msgstr "" + +msgid "Rules" +msgstr "" + +msgid "" +"Rules specify which traffic will use a particular MWAN policy based on IP " +"address, port or protocol<br />Rules are matched from top to bottom. Rules " +"below a matching rule are ignored. Traffic not matching any rule is routed " +"using the main routing table<br />Traffic destined for known (other than " +"default) networks is handled by the main routing table. Traffic matching a " +"rule, but all WAN interfaces for that policy are down will be blackholed<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Rules may " +"not share the same name as configured interfaces, members or policies" +msgstr "" + +msgid "Seconds. Acceptable values: 1-1000000. Defaults to 600 if not set" +msgstr "" + +msgid "Source address" +msgstr "" + +msgid "Source port" +msgstr "" + +msgid "Start MWAN" +msgstr "" + +msgid "Sticky" +msgstr "" + +msgid "Sticky timeout" +msgstr "" + +msgid "Stop MWAN" +msgstr "" + +msgid "Supports CIDR notation (eg \"192.168.100.0/24\") without quotes" +msgstr "" + +msgid "There are currently %d of 250 supported interfaces configured" +msgstr "" + +msgid "" +"This displays the metric assigned to this interface in /etc/config/network" +msgstr "" + +msgid "" +"This hostname or IP address will be pinged to determine if the link is up or " +"down. Leave blank to assume interface is always online" +msgstr "" + +msgid "" +"This section allows you to modify the content of \"/etc/mwan3.user\".<br /" +">The file is also preserved during sysupgrade.<br /><br />Notes:<br />This " +"file is interpreted as a shell script.<br />The first line of the script " +"must be "#!/bin/sh" without quotes.<br />Lines beginning with # are " +"comments and are not executed.<br />Put your custom mwan3 action here, they " +"will<br />be executed with each netifd hotplug interface event<br />on " +"interfaces for which mwan3 is enabled.<br /><br />There are three main " +"environment variables that are passed to this script.<br /><br />$ACTION " +"Either \"ifup\" or \"ifdown\"<br />$INTERFACE Name of the interface which " +"went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE Physical device name " +"which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br /><br />" +msgstr "" + +msgid "This section allows you to modify the contents of /etc/config/mwan3" +msgstr "" + +msgid "This section allows you to modify the contents of /etc/config/network" +msgstr "" + +msgid "This section allows you to modify the contents of /etc/config/wireless" +msgstr "" + +msgid "Tracking IP" +msgstr "" + +msgid "Tracking hostname or IP address" +msgstr "" + +msgid "Tracking method" +msgstr "" + +msgid "Tracking reliability" +msgstr "" + +msgid "Traffic Rules" +msgstr "" + +msgid "" +"Traffic from the same source IP address that previously matched this rule " +"within the sticky timeout period will use the same WAN interface" +msgstr "" + +msgid "Troubleshooting" +msgstr "" + +msgid "Troubleshooting Data" +msgstr "" + +msgid "" +"Use the IP address of this interface as source IP address for traffic " +"initiated by the router itself" +msgstr "" + +msgid "View the contents of /etc/protocols for protocol descriptions" +msgstr "" + +msgid "WARNING: %d interfaces are configured exceeding the maximum of 250!" +msgstr "" + +msgid "" +"WARNING: Some interfaces are configured incorrectly or not at all in /etc/" +"config/network!" +msgstr "" + +msgid "" +"WARNING: Some interfaces have a higher reliability requirement than there " +"are tracking IP addresses!" +msgstr "" + +msgid "" +"WARNING: Some interfaces have duplicate metrics configured in /etc/config/" +"network!" +msgstr "" + +msgid "" +"WARNING: Some interfaces have no default route in the main routing table!" +msgstr "" + +msgid "" +"WARNING: Some interfaces have no metric configured in /etc/config/network!" +msgstr "" + +msgid "" +"WARNING: Some policies have names exceeding the maximum of 15 characters!" +msgstr "" + +msgid "" +"WARNING: Some rules have a port configured with no or improper protocol " +"specified! Please configure a specific protocol!" +msgstr "" + +msgid "" +"WARNING: This and other interfaces have duplicate metrics configured in /etc/" +"config/network!" +msgstr "" + +msgid "" +"WARNING: This interface has a higher reliability requirement than there are " +"tracking IP addresses!" +msgstr "" + +msgid "WARNING: This interface has no default route in the main routing table!" +msgstr "" + +msgid "" +"WARNING: This interface has no metric configured in /etc/config/network!" +msgstr "" + +msgid "" +"WARNING: This interface is configured incorrectly or not at all in /etc/" +"config/network!" +msgstr "" + +msgid "" +"WARNING: This policy's name is %d characters exceeding the maximum of 15!" +msgstr "" + +msgid "" +"WARNING: This rule is incorrectly configured with no or improper protocol " +"specified! Please configure a specific protocol!" +msgstr "" + +msgid "Waiting for MWAN to %s..." +msgstr "" + +msgid "Waiting for diagnostic results..." +msgstr "" + +msgid "Weight" +msgstr "" + +msgid "" +"When all policy members are offline use this behavior for matched traffic" +msgstr "" + +msgid "Wireless Config" +msgstr "" + +msgid "Yes" +msgstr "" + +msgid "always" +msgstr "" + +msgid "blackhole (drop)" +msgstr "" + +msgid "default (use main routing table)" +msgstr "" + +msgid "ifdown" +msgstr "" + +msgid "ifup" +msgstr "" + +msgid "never" +msgstr "" + +msgid "restart" +msgstr "" + +msgid "start" +msgstr "" + +msgid "stop" +msgstr "" + +msgid "unreachable (reject)" +msgstr "" diff --git a/applications/luci-app-mwan3/po/zh-cn/mwan3.po b/applications/luci-app-mwan3/po/zh-cn/mwan3.po new file mode 100644 index 0000000000..d0b92a6df1 --- /dev/null +++ b/applications/luci-app-mwan3/po/zh-cn/mwan3.po @@ -0,0 +1,631 @@ +# +# Yangfl <mmyangfl@gmail.com>, 2017. +# +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Last-Translator: Yangfl <mmyangfl@gmail.com>\n" +"Language-Team: <debian-l10n-chinese@lists.debian.org>\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"PO-Revision-Date: 2017-10-28 16:58+0800\n" +"X-Generator: Gtranslator 2.91.7\n" + +msgid "%d hour" +msgstr "%d 小时" + +msgid "%d minute" +msgstr "%d 分钟" + +msgid "%d minutes" +msgstr "%d 分钟" + +msgid "%d second" +msgstr "%d 秒" + +msgid "%d seconds" +msgstr "%d 秒" + +msgid "" +"Acceptable values: 1-100. This many Tracking IP addresses must respond for " +"the link to be deemed up" +msgstr "" +"取值范围:1-100。这个设置项指定了当多少个 IP 地址能够连通时接口会被认为在线" + +msgid "Acceptable values: 1-1000. Defaults to 1 if not set" +msgstr "取值范围:1-100。如果不填写,默认值为 1" + +msgid "Advanced" +msgstr "高级" + +msgid "Check IP rules" +msgstr "检查 IP 规则" + +msgid "Check routing table" +msgstr "检查路由表" + +msgid "Collecting data..." +msgstr "正在收集数据..." + +msgid "Configuration" +msgstr "配置" + +msgid "Currently Configured Interfaces" +msgstr "当前配置的接口" + +msgid "Currently Configured Members" +msgstr "当前配置的成员" + +msgid "Currently Configured Policies" +msgstr "当前配置的策略" + +msgid "Destination address" +msgstr "目标地址" + +msgid "Destination port" +msgstr "目标端口" + +msgid "Detailed Status" +msgstr "详细状态" + +msgid "Diagnostic Results" +msgstr "诊断结果" + +msgid "Diagnostics" +msgstr "诊断" + +msgid "Disabled" +msgstr "已禁用" + +msgid "" +"Downed interface will be deemed up after this many successful ping tests" +msgstr "当 Ping 成功次数达到这个数值后,已经被认为离线的接口将会重新上线" + +msgid "Enabled" +msgstr "已启用" + +msgid "Enter value in hex, starting with <code>0x</code>" +msgstr "输入十六进制值,以 <code>0x</code> 开头" + +msgid "Error collecting troubleshooting information" +msgstr "收集故障排除信息时出错" + +msgid "Errors" +msgstr "错误" + +msgid "Expect interface state on up event" +msgstr "在 up 事件发生时的预期接口状态" + +msgid "Failure interval" +msgstr "故障检测间隔" + +msgid "Firewall mask" +msgstr "防火墙掩码" + +msgid "Flush conntrack table" +msgstr "刷新连接跟踪表" + +msgid "Flush global firewall conntrack table on interface events" +msgstr "在接口事件触发时刷新全局防火墙连接跟踪表" + +msgid "Globals" +msgstr "全局" + +msgid "Globals mwan3 options" +msgstr "全局 mwan3 选项" + +msgid "Hotplug Script" +msgstr "Hotplug 脚本" + +msgid "Hotplug ifdown" +msgstr "Hotplug ifdown" + +msgid "Hotplug ifup" +msgstr "Hotplug ifup" + +msgid "IPset" +msgstr "IPset" + +msgid "IPv4" +msgstr "IPv4" + +msgid "IPv6" +msgstr "IPv6" + +msgid "Initial state" +msgstr "初始状态" + +msgid "Interface" +msgstr "接口" + +msgid "Interface Status" +msgstr "接口状态" + +msgid "Interface down" +msgstr "接口离线" + +msgid "Interface up" +msgstr "接口在线" + +msgid "Interface will be deemed down after this many failed ping tests" +msgstr "当 Ping 失败次数达到这个数值后,接口会被认为离线" + +msgid "Interfaces" +msgstr "接口" + +msgid "Internet Protocol" +msgstr "互联网协议" + +msgid "Keep failure interval" +msgstr "保持故障检测间隔" + +msgid "Keep ping failure interval during failure state" +msgstr "在故障状态期间保持的 Ping 故障检测间隔" + +msgid "Last 50 MWAN systemlog entries. Newest entries sorted at the top :" +msgstr "最近 50 条 MWAN 系统日志,最新条目排在顶部:" + +msgid "Last resort" +msgstr "备用成员" + +msgid "Load Balancing" +msgstr "负载均衡" + +msgid "Loading" +msgstr "载入中" + +msgid "Local source interface" +msgstr "本地源接口" + +msgid "MWAN Config" +msgstr "MWAN 配置文件" + +msgid "MWAN Detailed Status" +msgstr "MWAN 详细状态" + +msgid "MWAN Interface Configuration" +msgstr "MWAN 接口配置" + +msgid "MWAN Interface Configuration - %s" +msgstr "MWAN 接口配置 - %s" + +msgid "MWAN Interface Diagnostics" +msgstr "MWAN 接口诊断" + +msgid "MWAN Interface Live Status" +msgstr "MWAN 接口实时状态" + +msgid "MWAN Interface Systemlog" +msgstr "MWAN 接口系统日志" + +msgid "MWAN Member Configuration" +msgstr "MWAN 成员配置" + +msgid "MWAN Member Configuration - %s" +msgstr "MWAN 成员配置 - %s" + +msgid "MWAN Policy Configuration" +msgstr "MWAN 策略配置" + +msgid "MWAN Policy Configuration - %s" +msgstr "MWAN 策略配置 - %s" + +msgid "MWAN Rule Configuration" +msgstr "MWAN 规则配置" + +msgid "MWAN Rule Configuration - %s" +msgstr "MWAN 规则配置 - %s" + +msgid "MWAN Service Control" +msgstr "MWAN 服务控制" + +msgid "" +"MWAN supports up to 250 physical and/or logical interfaces<br />MWAN " +"requires that all interfaces have a unique metric configured in /etc/config/" +"network<br />Names must match the interface name found in /etc/config/" +"network (see advanced tab)<br />Names may contain characters A-Z, a-z, 0-9, " +"_ and no spaces<br />Interfaces may not share the same name as configured " +"members, policies or rules" +msgstr "" +"MWAN 支持最多 250 个物理或逻辑接口。<br />MWAN 要求所有接口必须在 /etc/" +"config/network 中设定唯一的网关跃点。<br />名称必须与 /etc/config/network 中" +"的接口名称匹配。(可查看“高级”选项卡)<br />名称允许包括 A-Z、a-z、0-9、_ 但" +"是不能有空格。<br />接口不应该与成员、策略、规则中的任意一个设置项使用相同的" +"名称" + +msgid "" +"May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or " +"as a portrange (eg \"1024:2048\") without quotes" +msgstr "" +"可以输入一个或多个端口(例如“22”或者“80,443”)或者是一个端口范围(例" +"如“1024:2048”)不含引号" + +msgid "Member" +msgstr "成员" + +msgid "Member used" +msgstr "使用的成员" + +msgid "Members" +msgstr "成员" + +msgid "" +"Members are profiles attaching a metric and weight to an MWAN interface<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Members " +"may not share the same name as configured interfaces, policies or rules" +msgstr "" +"“成员”用来设置每一个 MWAN 接口的跃点数(即接口优先级)和所占比重。<br />名称" +"允许包括 A-Z、 a-、0-9、_ 但是不能有空格。<br />成员不应该与接口、策略、规则" +"中的任意一个设置项使用相同的名称" + +msgid "Members assigned" +msgstr "分配的成员" + +msgid "Metric" +msgstr "跃点数" + +msgid "" +"Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/" +"youtube.com/youtube\")" +msgstr "" +"匹配 IPset 规则列表名称。需要先配置 /etc/dnsmasq.conf 中的 IPset 规则(例" +"如:“ipset=/youtube.com/youtube”)" + +msgid "Network Config" +msgstr "网络配置文件" + +msgid "No" +msgstr "否" + +msgid "No MWAN interfaces found" +msgstr "没有找到 MWAN 接口" + +msgid "No MWAN systemlog history found" +msgstr "没有在系统日志中找到 MWAN 历史信息" + +msgid "No detailed status information available" +msgstr "没有状态详细信息可用" + +msgid "No diagnostic results returned" +msgstr "没有返回诊断结果" + +msgid "No protocol specified" +msgstr "未指定协议" + +msgid "Offline" +msgstr "离线" + +msgid "Online" +msgstr "在线" + +msgid "Online (tracking active)" +msgstr "在线(跟踪启用中)" + +msgid "Online (tracking off)" +msgstr "在线(跟踪已关闭)" + +msgid "Overview" +msgstr "概况" + +msgid "Ping count" +msgstr "Ping 计数" + +msgid "Ping default gateway" +msgstr "Ping 默认网关" + +msgid "Ping interval" +msgstr "Ping 间隔" + +msgid "Ping interval during failure detection" +msgstr "故障检测期间的 Ping 间隔" + +msgid "Ping interval during failure recovering" +msgstr "故障恢复期间的 Ping 间隔" + +msgid "Ping size" +msgstr "Ping 大小" + +msgid "Ping timeout" +msgstr "Ping 超时" + +msgid "Ping tracking IP" +msgstr "Ping 跟踪 IP" + +msgid "Policies" +msgstr "策略" + +msgid "" +"Policies are profiles grouping one or more members controlling how MWAN " +"distributes traffic<br />Member interfaces with lower metrics are used " +"first. Interfaces with the same metric load-balance<br />Load-balanced " +"member interfaces distribute more traffic out those with higher weights<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be " +"15 characters or less<br />Policies may not share the same name as " +"configured interfaces, members or rules" +msgstr "" +"“策略”把成员进行分组,告诉 MWAN 如何分配“规则”中使用这一策略的流量<br />拥有" +"较低跃点数的成员将会被优先使用。拥有相同跃点数的成员把流量进行负载均衡。<br /" +">进行负载均衡的成员之间拥有较高比重的成员将会被分配到更多流量。<br />名称允许" +"包括A-Z、a-z、0-9、_ 但是不能有空格。名称应该在 15 个字符以内<br />策略不应该" +"与接口、成员、规则中的任意一个设置项使用相同的名称" + +msgid "Policy" +msgstr "策略" + +msgid "Policy assigned" +msgstr "分配的策略" + +msgid "Protocol" +msgstr "通信协议" + +msgid "Recovery interval" +msgstr "故障恢复间隔" + +msgid "Restart MWAN" +msgstr "重启 MWAN" + +msgid "Rule" +msgstr "规则" + +msgid "Rules" +msgstr "规则" + +msgid "" +"Rules specify which traffic will use a particular MWAN policy based on IP " +"address, port or protocol<br />Rules are matched from top to bottom. Rules " +"below a matching rule are ignored. Traffic not matching any rule is routed " +"using the main routing table<br />Traffic destined for known (other than " +"default) networks is handled by the main routing table. Traffic matching a " +"rule, but all WAN interfaces for that policy are down will be blackholed<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Rules may " +"not share the same name as configured interfaces, members or policies" +msgstr "" +"“规则”基于 IP 地址、协议、端口把流量划分到指定的“策略”中。<br />规则按照从上" +"到下的顺序进行匹配。除了第一条能够匹配一次通信的规则以外,其它规则将被忽略。" +"不匹配任何规则的通信将会由系统默认路由表进行。<br />来自已知的网络的转发流量" +"由系统默认路由表接手,然后 MWAN 从中匹配出相应的流量并转移到 MWAN 自己的路由" +"表。但是所有被划分到一个无法使用的策略的流量将会无法正常进行路由。<br />名称" +"允许包括A-Z、a-z、0-9、_ 但是不能有空格。<br />规则不应该与接口、成员、策略中" +"的任意一个设置项使用相同的名称" + +msgid "Seconds. Acceptable values: 1-1000000. Defaults to 600 if not set" +msgstr "单位为秒。接受的值:1-1000000。留空则使用默认值 600 秒" + +msgid "Source address" +msgstr "源地址" + +msgid "Source port" +msgstr "源端口" + +msgid "Start MWAN" +msgstr "启动 MWAN" + +msgid "Sticky" +msgstr "粘滞模式" + +msgid "Sticky timeout" +msgstr "粘滞超时" + +msgid "Stop MWAN" +msgstr "停止 MWAN" + +msgid "Supports CIDR notation (eg \"192.168.100.0/24\") without quotes" +msgstr "支持 CIDR 记法(例如:\"192.168.100.0/24\")不含引号" + +msgid "There are currently %d of 250 supported interfaces configured" +msgstr "当前已配置 %d 个接口,最大支持 250 个" + +msgid "" +"This displays the metric assigned to this interface in /etc/config/network" +msgstr "这里显示了这个接口在 /etc/config/network 中配置的跃点数" + +msgid "" +"This hostname or IP address will be pinged to determine if the link is up or " +"down. Leave blank to assume interface is always online" +msgstr "通过 ping 此主机或 IP 地址来确定链路是否在线。留空则认为接口始终在线" + +msgid "" +"This section allows you to modify the content of \"/etc/mwan3.user\".<br /" +">The file is also preserved during sysupgrade.<br /><br />Notes:<br />This " +"file is interpreted as a shell script.<br />The first line of the script " +"must be "#!/bin/sh" without quotes.<br />Lines beginning with # are " +"comments and are not executed.<br />Put your custom mwan3 action here, they " +"will<br />be executed with each netifd hotplug interface event<br />on " +"interfaces for which mwan3 is enabled.<br /><br />There are three main " +"environment variables that are passed to this script.<br /><br />$ACTION " +"Either \"ifup\" or \"ifdown\"<br />$INTERFACE Name of the interface which " +"went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE Physical device name " +"which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br /><br />" +msgstr "" +"这里允许您修改“/etc/mwan3.user”的内容。<br />该文件在 sysupgrade 期间也会保" +"留。<br /><br />注意:<br />该文件会作为 shell 脚本解释。<br />脚本的第一行必" +"须是"#!/bin/sh",不带引号。<br />以#开头的行是注释,不会执行。<br />" +"将您的自定义 mwan3 动作放在这里,他们将<br />在启用 mwan3 的接口上<br />在 " +"netifd hotplug 接口事件时执行。<br /><br />有三个主要的环境变量传递给这个脚" +"本。<br /><br />$ACTION “ifup”或“ifdown”<br />$INTERFACE 启动或停止的接口名" +"(例如“wan”或“wwan”)<br />$DEVICE 启动或停止接口的物理设备名(例" +"如“eth0”或“wwan0”)<br /><br />" + +msgid "This section allows you to modify the contents of /etc/config/mwan3" +msgstr "这里允许您修改 /etc/config/mwan3 的内容" + +msgid "This section allows you to modify the contents of /etc/config/network" +msgstr "这里允许您修改 /etc/config/network 的内容" + +msgid "This section allows you to modify the contents of /etc/config/wireless" +msgstr "这里允许您修改 /etc/config/wireless 的内容" + +msgid "Tracking IP" +msgstr "跟踪的 IP" + +msgid "Tracking hostname or IP address" +msgstr "跟踪的主机或 IP 地址" + +msgid "Tracking method" +msgstr "跟踪方式" + +msgid "Tracking reliability" +msgstr "跟踪可靠性" + +msgid "Traffic Rules" +msgstr "流量规则" + +msgid "" +"Traffic from the same source IP address that previously matched this rule " +"within the sticky timeout period will use the same WAN interface" +msgstr "" +"来自相同源 IP 的流量,如果已经匹配过此规则并且在粘滞超时时间内,将会使用相同" +"的 WAN 接口" + +msgid "Troubleshooting" +msgstr "故障排除" + +msgid "Troubleshooting Data" +msgstr "故障排除数据" + +msgid "" +"Use the IP address of this interface as source IP address for traffic " +"initiated by the router itself" +msgstr "使用该接口的 IP 地址作为路由器本身发起的流量的源 IP 地址" + +msgid "View the contents of /etc/protocols for protocol descriptions" +msgstr "请查看 /etc/protocols 获取可选协议详情" + +msgid "WARNING: %d interfaces are configured exceeding the maximum of 250!" +msgstr "警告:已配置 %d 个接口,超过最大值 250!" + +msgid "" +"WARNING: Some interfaces are configured incorrectly or not at all in /etc/" +"config/network!" +msgstr "警告:某些接口配置不正确或未配置到 /etc/config/network!" + +msgid "" +"WARNING: Some interfaces have a higher reliability requirement than there " +"are tracking IP addresses!" +msgstr "警告:某些接口的跟踪可靠性要求大于了跟踪 IP 地址总数!" + +msgid "" +"WARNING: Some interfaces have duplicate metrics configured in /etc/config/" +"network!" +msgstr "警告:某些接口在 /etc/config/network 中配置了相同的跃点数!" + +msgid "" +"WARNING: Some interfaces have no default route in the main routing table!" +msgstr "警告:某些接口在主路由表中没有默认路由!" + +msgid "" +"WARNING: Some interfaces have no metric configured in /etc/config/network!" +msgstr "警告:某些接口没有在 /etc/config/network 中配置跃点数!" + +msgid "" +"WARNING: Some policies have names exceeding the maximum of 15 characters!" +msgstr "警告:某些策略的名称超过了 15 个字符!" + +msgid "" +"WARNING: Some rules have a port configured with no or improper protocol " +"specified! Please configure a specific protocol!" +msgstr "" +"警告:某些规则指定了端口却没有配置或配置了不正确的协议,请重新指定协议!" + +msgid "" +"WARNING: This and other interfaces have duplicate metrics configured in /etc/" +"config/network!" +msgstr "警告:此接口和其他接口在 /etc/config/network 中配置了相同的跃点数!" + +msgid "" +"WARNING: This interface has a higher reliability requirement than there are " +"tracking IP addresses!" +msgstr "警告:此接口的跟踪可靠性要求大于了跟踪 IP 地址总数!" + +msgid "WARNING: This interface has no default route in the main routing table!" +msgstr "警告:此接口在主路由表中没有默认路由!" + +msgid "" +"WARNING: This interface has no metric configured in /etc/config/network!" +msgstr "警告:此接口没有在 /etc/config/network 中配置跃点数!" + +msgid "" +"WARNING: This interface is configured incorrectly or not at all in /etc/" +"config/network!" +msgstr "警告:此接口配置不正确或未配置到 /etc/config/network!" + +msgid "" +"WARNING: This policy's name is %d characters exceeding the maximum of 15!" +msgstr "警告:此策略的名称具有 %d 个字符,超过了 15 个字符!" + +msgid "" +"WARNING: This rule is incorrectly configured with no or improper protocol " +"specified! Please configure a specific protocol!" +msgstr "警告:此规则没有配置或配置了不正确的协议,请重新指定协议!" + +msgid "Waiting for MWAN to %s..." +msgstr "等待 MWAN %s..." + +msgid "Waiting for diagnostic results..." +msgstr "等待诊断结果..." + +msgid "Weight" +msgstr "比重" + +msgid "" +"When all policy members are offline use this behavior for matched traffic" +msgstr "当所有策略成员都无法使用的时候,对使用该策略的流量使用这个操作" + +msgid "Wireless Config" +msgstr "无线配置" + +msgid "Yes" +msgstr "是" + +msgid "always" +msgstr "总是" + +msgid "blackhole (drop)" +msgstr "黑洞(丢弃)" + +msgid "default (use main routing table)" +msgstr "默认(使用主路由表)" + +msgid "ifdown" +msgstr "ifdown" + +msgid "ifup" +msgstr "ifup" + +msgid "never" +msgstr "从不" + +msgid "restart" +msgstr "重启" + +msgid "start" +msgstr "启动" + +msgid "stop" +msgstr "停止" + +msgid "unreachable (reject)" +msgstr "不可达(拒绝)" + +#~ msgid "Restore default hotplug script" +#~ msgstr "恢复默认的 hotplug 脚本" + +#~ msgid "Restore..." +#~ msgstr "恢复..." + +#~ msgid "" +#~ "This section allows you to modify the contents of /etc/hotplug.d/iface/16-" +#~ "mwancustom<br />This is useful for running system commands and/or scripts " +#~ "based on interface ifup or ifdown hotplug events<br /><br />Notes:<br /" +#~ ">The first line of the script must be "#!/bin/sh" without " +#~ "quotes<br />Lines beginning with # are comments and are not executed<br /" +#~ "><br />Available variables:<br />$ACTION is the hotplug event (ifup, " +#~ "ifdown)<br />$INTERFACE is the interface name (wan1, wan2, etc.)<br />" +#~ "$DEVICE is the device name attached to the interface (eth0.1, eth1, etc.)" +#~ msgstr "" +#~ "这里允许您修改 /etc/hotplug.d/iface/16-mwancustom 的内容<br />这可以在接" +#~ "口 ifup 或 ifdown Hotplug 事件时运行系统命令或脚本<br /><br />注意:<br />" +#~ "脚本的第一行必须是 "#!/bin/sh" 不含引号<br />以#开头的行是注释," +#~ "不会执行<br /><br />可用变量:<br />$ACTION 是 Hotplug 事件(ifup, ifdown)" +#~ "<br />$INTERFACE 是接口名称(wan1、wan2 等)<br />$DEVICE 是连接到接口的设" +#~ "备名称 (eth0.1、eth1 等)" diff --git a/applications/luci-app-mwan3/po/zh-tw/mwan3.po b/applications/luci-app-mwan3/po/zh-tw/mwan3.po new file mode 100644 index 0000000000..04711ac3d7 --- /dev/null +++ b/applications/luci-app-mwan3/po/zh-tw/mwan3.po @@ -0,0 +1,630 @@ +# +# Yangfl <mmyangfl@gmail.com>, 2017. +# +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Last-Translator: Yangfl <mmyangfl@gmail.com>\n" +"Language-Team: <debian-l10n-chinese@lists.debian.org>\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"PO-Revision-Date: 2017-10-28 16:58+0800\n" +"X-Generator: Gtranslator 2.91.7\n" + +msgid "%d hour" +msgstr "%d 小時" + +msgid "%d minute" +msgstr "%d 分鐘" + +msgid "%d minutes" +msgstr "%d 分鐘" + +msgid "%d second" +msgstr "%d 秒" + +msgid "%d seconds" +msgstr "%d 秒" + +msgid "" +"Acceptable values: 1-100. This many Tracking IP addresses must respond for " +"the link to be deemed up" +msgstr "" +"取值範圍:1-100。這個設定項指定了當多少個 IP 位址能夠連通時介面會被認為線上" + +msgid "Acceptable values: 1-1000. Defaults to 1 if not set" +msgstr "取值範圍:1-100。如果不填寫,預設值為 1" + +msgid "Advanced" +msgstr "高階" + +msgid "Check IP rules" +msgstr "檢查 IP 規則" + +msgid "Check routing table" +msgstr "檢查路由表" + +msgid "Collecting data..." +msgstr "正在收集資料..." + +msgid "Configuration" +msgstr "配置" + +msgid "Currently Configured Interfaces" +msgstr "當前配置的介面" + +msgid "Currently Configured Members" +msgstr "當前配置的成員" + +msgid "Currently Configured Policies" +msgstr "當前配置的策略" + +msgid "Destination address" +msgstr "目標位址" + +msgid "Destination port" +msgstr "目標埠" + +msgid "Detailed Status" +msgstr "詳細狀態" + +msgid "Diagnostic Results" +msgstr "診斷結果" + +msgid "Diagnostics" +msgstr "診斷" + +msgid "Disabled" +msgstr "已禁用" + +msgid "" +"Downed interface will be deemed up after this many successful ping tests" +msgstr "當 Ping 成功次數達到這個數值後,已經被認為離線的介面將會重新上線" + +msgid "Enabled" +msgstr "已啟用" + +msgid "Enter value in hex, starting with <code>0x</code>" +msgstr "輸入十六進位制值,以 <code>0x</code> 開頭" + +msgid "Error collecting troubleshooting information" +msgstr "收集故障排除資訊時出錯" + +msgid "Errors" +msgstr "錯誤" + +msgid "Expect interface state on up event" +msgstr "在 up 事件發生時的預期介面狀態" + +msgid "Failure interval" +msgstr "故障檢測間隔" + +msgid "Firewall mask" +msgstr "防火牆掩碼" + +msgid "Flush conntrack table" +msgstr "重新整理連線跟蹤表" + +msgid "Flush global firewall conntrack table on interface events" +msgstr "在介面事件觸發時重新整理全域性防火牆連線跟蹤表" + +msgid "Globals" +msgstr "全域性" + +msgid "Globals mwan3 options" +msgstr "全域性 mwan3 選項" + +msgid "Hotplug Script" +msgstr "Hotplug 指令碼" + +msgid "Hotplug ifdown" +msgstr "Hotplug ifdown" + +msgid "Hotplug ifup" +msgstr "Hotplug ifup" + +msgid "IPset" +msgstr "IPset" + +msgid "IPv4" +msgstr "IPv4" + +msgid "IPv6" +msgstr "IPv6" + +msgid "Initial state" +msgstr "初始狀態" + +msgid "Interface" +msgstr "介面" + +msgid "Interface Status" +msgstr "介面狀態" + +msgid "Interface down" +msgstr "介面離線" + +msgid "Interface up" +msgstr "介面線上" + +msgid "Interface will be deemed down after this many failed ping tests" +msgstr "當 Ping 失敗次數達到這個數值後,介面會被認為離線" + +msgid "Interfaces" +msgstr "介面" + +msgid "Internet Protocol" +msgstr "網際網路協議" + +msgid "Keep failure interval" +msgstr "保持故障檢測間隔" + +msgid "Keep ping failure interval during failure state" +msgstr "在故障狀態期間保持的 Ping 故障檢測間隔" + +msgid "Last 50 MWAN systemlog entries. Newest entries sorted at the top :" +msgstr "最近 50 條 MWAN 系統日誌,最新條目排在頂部:" + +msgid "Last resort" +msgstr "備用成員" + +msgid "Load Balancing" +msgstr "負載均衡" + +msgid "Loading" +msgstr "載入中" + +msgid "Local source interface" +msgstr "本地源介面" + +msgid "MWAN Config" +msgstr "MWAN 配置檔案" + +msgid "MWAN Detailed Status" +msgstr "MWAN 詳細狀態" + +msgid "MWAN Interface Configuration" +msgstr "MWAN 介面配置" + +msgid "MWAN Interface Configuration - %s" +msgstr "MWAN 介面配置 - %s" + +msgid "MWAN Interface Diagnostics" +msgstr "MWAN 介面診斷" + +msgid "MWAN Interface Live Status" +msgstr "MWAN 介面實時狀態" + +msgid "MWAN Interface Systemlog" +msgstr "MWAN 介面系統日誌" + +msgid "MWAN Member Configuration" +msgstr "MWAN 成員配置" + +msgid "MWAN Member Configuration - %s" +msgstr "MWAN 成員配置 - %s" + +msgid "MWAN Policy Configuration" +msgstr "MWAN 策略配置" + +msgid "MWAN Policy Configuration - %s" +msgstr "MWAN 策略配置 - %s" + +msgid "MWAN Rule Configuration" +msgstr "MWAN 規則配置" + +msgid "MWAN Rule Configuration - %s" +msgstr "MWAN 規則配置 - %s" + +msgid "MWAN Service Control" +msgstr "MWAN 服務控制" + +msgid "" +"MWAN supports up to 250 physical and/or logical interfaces<br />MWAN " +"requires that all interfaces have a unique metric configured in /etc/config/" +"network<br />Names must match the interface name found in /etc/config/" +"network (see advanced tab)<br />Names may contain characters A-Z, a-z, 0-9, " +"_ and no spaces<br />Interfaces may not share the same name as configured " +"members, policies or rules" +msgstr "" +"MWAN 支援最多 250 個物理或邏輯介面。<br />MWAN 要求所有介面必須在 /etc/" +"config/network 中設定唯一的閘道器躍點。<br />名稱必須與 /etc/config/network " +"中的介面名稱匹配。(可檢視“高階”選項卡)<br />名稱允許包括 A-Z、a-z、0-9、_ " +"但是不能有空格。<br />介面不應該與成員、策略、規則中的任意一個設定項使用相同" +"的名稱" + +msgid "" +"May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or " +"as a portrange (eg \"1024:2048\") without quotes" +msgstr "" +"可以輸入一個或多個埠(例如“22”或者“80,443”)或者是一個埠範圍(例" +"如“1024:2048”)不含引號" + +msgid "Member" +msgstr "成員" + +msgid "Member used" +msgstr "使用的成員" + +msgid "Members" +msgstr "成員" + +msgid "" +"Members are profiles attaching a metric and weight to an MWAN interface<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Members " +"may not share the same name as configured interfaces, policies or rules" +msgstr "" +"“成員”用來設定每一個 MWAN 介面的躍點數(即介面優先順序)和所佔比重。<br />名" +"稱允許包括 A-Z、 a-、0-9、_ 但是不能有空格。<br />成員不應該與介面、策略、規" +"則中的任意一個設定項使用相同的名稱" + +msgid "Members assigned" +msgstr "分配的成員" + +msgid "Metric" +msgstr "躍點數" + +msgid "" +"Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/" +"youtube.com/youtube\")" +msgstr "" +"匹配 IPset 規則列表名稱。需要先配置 /etc/dnsmasq.conf 中的 IPset 規則(例" +"如:“ipset=/youtube.com/youtube”)" + +msgid "Network Config" +msgstr "網路配置檔案" + +msgid "No" +msgstr "否" + +msgid "No MWAN interfaces found" +msgstr "沒有找到 MWAN 介面" + +msgid "No MWAN systemlog history found" +msgstr "沒有在系統日誌中找到 MWAN 歷史資訊" + +msgid "No detailed status information available" +msgstr "沒有狀態詳細資訊可用" + +msgid "No diagnostic results returned" +msgstr "沒有返回診斷結果" + +msgid "No protocol specified" +msgstr "未指定協議" + +msgid "Offline" +msgstr "離線" + +msgid "Online" +msgstr "線上" + +msgid "Online (tracking active)" +msgstr "線上(跟蹤啟用中)" + +msgid "Online (tracking off)" +msgstr "線上(跟蹤已關閉)" + +msgid "Overview" +msgstr "概況" + +msgid "Ping count" +msgstr "Ping 計數" + +msgid "Ping default gateway" +msgstr "Ping 預設閘道器" + +msgid "Ping interval" +msgstr "Ping 間隔" + +msgid "Ping interval during failure detection" +msgstr "故障檢測期間的 Ping 間隔" + +msgid "Ping interval during failure recovering" +msgstr "故障恢復期間的 Ping 間隔" + +msgid "Ping size" +msgstr "Ping 大小" + +msgid "Ping timeout" +msgstr "Ping 超時" + +msgid "Ping tracking IP" +msgstr "Ping 跟蹤 IP" + +msgid "Policies" +msgstr "策略" + +msgid "" +"Policies are profiles grouping one or more members controlling how MWAN " +"distributes traffic<br />Member interfaces with lower metrics are used " +"first. Interfaces with the same metric load-balance<br />Load-balanced " +"member interfaces distribute more traffic out those with higher weights<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be " +"15 characters or less<br />Policies may not share the same name as " +"configured interfaces, members or rules" +msgstr "" +"“策略”把成員進行分組,告訴 MWAN 如何分配“規則”中使用這一策略的流量<br />擁有" +"較低躍點數的成員將會被優先使用。擁有相同躍點數的成員把流量進行負載均衡。<br /" +">進行負載均衡的成員之間擁有較高比重的成員將會被分配到更多流量。<br />名稱允許" +"包括A-Z、a-z、0-9、_ 但是不能有空格。名稱應該在 15 個字元以內<br />策略不應該" +"與介面、成員、規則中的任意一個設定項使用相同的名稱" + +msgid "Policy" +msgstr "策略" + +msgid "Policy assigned" +msgstr "分配的策略" + +msgid "Protocol" +msgstr "通訊協議" + +msgid "Recovery interval" +msgstr "故障恢復間隔" + +msgid "Restart MWAN" +msgstr "重啟 MWAN" + +msgid "Rule" +msgstr "規則" + +msgid "Rules" +msgstr "規則" + +msgid "" +"Rules specify which traffic will use a particular MWAN policy based on IP " +"address, port or protocol<br />Rules are matched from top to bottom. Rules " +"below a matching rule are ignored. Traffic not matching any rule is routed " +"using the main routing table<br />Traffic destined for known (other than " +"default) networks is handled by the main routing table. Traffic matching a " +"rule, but all WAN interfaces for that policy are down will be blackholed<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Rules may " +"not share the same name as configured interfaces, members or policies" +msgstr "" +"“規則”基於 IP 位址、協議、埠把流量劃分到指定的“策略”中。<br />規則按照從上到" +"下的順序進行匹配。除了第一條能夠匹配一次通訊的規則以外,其它規則將被忽略。不" +"匹配任何規則的通訊將會由系統預設路由表進行。<br />來自已知的網路的轉發流量由" +"系統預設路由表接手,然後 MWAN 從中匹配出相應的流量並轉移到 MWAN 自己的路由" +"表。但是所有被劃分到一個無法使用的策略的流量將會無法正常進行路由。<br />名稱" +"允許包括A-Z、a-z、0-9、_ 但是不能有空格。<br />規則不應該與介面、成員、策略中" +"的任意一個設定項使用相同的名稱" + +msgid "Seconds. Acceptable values: 1-1000000. Defaults to 600 if not set" +msgstr "單位為秒。接受的值:1-1000000。留空則使用預設值 600 秒" + +msgid "Source address" +msgstr "源位址" + +msgid "Source port" +msgstr "源埠" + +msgid "Start MWAN" +msgstr "啟動 MWAN" + +msgid "Sticky" +msgstr "粘滯模式" + +msgid "Sticky timeout" +msgstr "粘滯超時" + +msgid "Stop MWAN" +msgstr "停止 MWAN" + +msgid "Supports CIDR notation (eg \"192.168.100.0/24\") without quotes" +msgstr "支援 CIDR 記法(例如:\"192.168.100.0/24\")不含引號" + +msgid "There are currently %d of 250 supported interfaces configured" +msgstr "當前已配置 %d 個介面,最大支援 250 個" + +msgid "" +"This displays the metric assigned to this interface in /etc/config/network" +msgstr "這裡顯示了這個介面在 /etc/config/network 中配置的躍點數" + +msgid "" +"This hostname or IP address will be pinged to determine if the link is up or " +"down. Leave blank to assume interface is always online" +msgstr "通過 ping 此主機或 IP 位址來確定鏈路是否線上。留空則認為介面始終線上" + +msgid "" +"This section allows you to modify the content of \"/etc/mwan3.user\".<br /" +">The file is also preserved during sysupgrade.<br /><br />Notes:<br />This " +"file is interpreted as a shell script.<br />The first line of the script " +"must be "#!/bin/sh" without quotes.<br />Lines beginning with # are " +"comments and are not executed.<br />Put your custom mwan3 action here, they " +"will<br />be executed with each netifd hotplug interface event<br />on " +"interfaces for which mwan3 is enabled.<br /><br />There are three main " +"environment variables that are passed to this script.<br /><br />$ACTION " +"Either \"ifup\" or \"ifdown\"<br />$INTERFACE Name of the interface which " +"went up or down (e.g. \"wan\" or \"wwan\")<br />$DEVICE Physical device name " +"which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br /><br />" +msgstr "" +"這裡允許您修改“/etc/mwan3.user”的內容。<br />該檔案在 sysupgrade 期間也會保" +"留。<br /><br />注意:<br />該檔案會作為 shell 指令碼解釋。<br />指令碼的第一" +"行必須是"#!/bin/sh",不帶引號。<br />以#開頭的行是註釋,不會執行。" +"<br />將您的自定義 mwan3 動作放在這裡,他們將<br />在啟用 mwan3 的介面上<br /" +">在 netifd hotplug 介面事件時執行。<br /><br />有三個主要的環境變數傳遞給這個" +"腳本。<br /><br />$ACTION “ifup”或“ifdown”<br />$INTERFACE 啟動或停止的介面名" +"(例如“wan”或“wwan”)<br />$DEVICE 啟動或停止介面的物理裝置名(例" +"如“eth0”或“wwan0”)<br /><br />" + +msgid "This section allows you to modify the contents of /etc/config/mwan3" +msgstr "這裡允許您修改 /etc/config/mwan3 的內容" + +msgid "This section allows you to modify the contents of /etc/config/network" +msgstr "這裡允許您修改 /etc/config/network 的內容" + +msgid "This section allows you to modify the contents of /etc/config/wireless" +msgstr "這裡允許您修改 /etc/config/wireless 的內容" + +msgid "Tracking IP" +msgstr "跟蹤的 IP" + +msgid "Tracking hostname or IP address" +msgstr "跟蹤的主機或 IP 位址" + +msgid "Tracking method" +msgstr "跟蹤方式" + +msgid "Tracking reliability" +msgstr "跟蹤可靠性" + +msgid "Traffic Rules" +msgstr "流量規則" + +msgid "" +"Traffic from the same source IP address that previously matched this rule " +"within the sticky timeout period will use the same WAN interface" +msgstr "" +"來自相同源 IP 的流量,如果已經匹配過此規則並且在粘滯超時時間內,將會使用相同" +"的 WAN 介面" + +msgid "Troubleshooting" +msgstr "故障排除" + +msgid "Troubleshooting Data" +msgstr "故障排除資料" + +msgid "" +"Use the IP address of this interface as source IP address for traffic " +"initiated by the router itself" +msgstr "使用該介面的 IP 位址作為路由器本身發起的流量的源 IP 位址" + +msgid "View the contents of /etc/protocols for protocol descriptions" +msgstr "請檢視 /etc/protocols 獲取可選協議詳情" + +msgid "WARNING: %d interfaces are configured exceeding the maximum of 250!" +msgstr "警告:已配置 %d 個介面,超過最大值 250!" + +msgid "" +"WARNING: Some interfaces are configured incorrectly or not at all in /etc/" +"config/network!" +msgstr "警告:某些介面配置不正確或未配置到 /etc/config/network!" + +msgid "" +"WARNING: Some interfaces have a higher reliability requirement than there " +"are tracking IP addresses!" +msgstr "警告:某些介面的跟蹤可靠性要求大於了跟蹤 IP 位址總數!" + +msgid "" +"WARNING: Some interfaces have duplicate metrics configured in /etc/config/" +"network!" +msgstr "警告:某些介面在 /etc/config/network 中配置了相同的躍點數!" + +msgid "" +"WARNING: Some interfaces have no default route in the main routing table!" +msgstr "警告:某些介面在主路由表中沒有預設路由!" + +msgid "" +"WARNING: Some interfaces have no metric configured in /etc/config/network!" +msgstr "警告:某些介面沒有在 /etc/config/network 中配置躍點數!" + +msgid "" +"WARNING: Some policies have names exceeding the maximum of 15 characters!" +msgstr "警告:某些策略的名稱超過了 15 個字元!" + +msgid "" +"WARNING: Some rules have a port configured with no or improper protocol " +"specified! Please configure a specific protocol!" +msgstr "警告:某些規則指定了埠卻沒有配置或配置了不正確的協議,請重新指定協議!" + +msgid "" +"WARNING: This and other interfaces have duplicate metrics configured in /etc/" +"config/network!" +msgstr "警告:此介面和其他介面在 /etc/config/network 中配置了相同的躍點數!" + +msgid "" +"WARNING: This interface has a higher reliability requirement than there are " +"tracking IP addresses!" +msgstr "警告:此介面的跟蹤可靠性要求大於了跟蹤 IP 位址總數!" + +msgid "WARNING: This interface has no default route in the main routing table!" +msgstr "警告:此介面在主路由表中沒有預設路由!" + +msgid "" +"WARNING: This interface has no metric configured in /etc/config/network!" +msgstr "警告:此介面沒有在 /etc/config/network 中配置躍點數!" + +msgid "" +"WARNING: This interface is configured incorrectly or not at all in /etc/" +"config/network!" +msgstr "警告:此介面配置不正確或未配置到 /etc/config/network!" + +msgid "" +"WARNING: This policy's name is %d characters exceeding the maximum of 15!" +msgstr "警告:此策略的名稱具有 %d 個字元,超過了 15 個字元!" + +msgid "" +"WARNING: This rule is incorrectly configured with no or improper protocol " +"specified! Please configure a specific protocol!" +msgstr "警告:此規則沒有配置或配置了不正確的協議,請重新指定協議!" + +msgid "Waiting for MWAN to %s..." +msgstr "等待 MWAN %s..." + +msgid "Waiting for diagnostic results..." +msgstr "等待診斷結果..." + +msgid "Weight" +msgstr "比重" + +msgid "" +"When all policy members are offline use this behavior for matched traffic" +msgstr "當所有策略成員都無法使用的時候,對使用該策略的流量使用這個操作" + +msgid "Wireless Config" +msgstr "無線配置" + +msgid "Yes" +msgstr "是" + +msgid "always" +msgstr "總是" + +msgid "blackhole (drop)" +msgstr "黑洞(丟棄)" + +msgid "default (use main routing table)" +msgstr "預設(使用主路由表)" + +msgid "ifdown" +msgstr "ifdown" + +msgid "ifup" +msgstr "ifup" + +msgid "never" +msgstr "從不" + +msgid "restart" +msgstr "重啟" + +msgid "start" +msgstr "啟動" + +msgid "stop" +msgstr "停止" + +msgid "unreachable (reject)" +msgstr "不可達(拒絕)" + +#~ msgid "Restore default hotplug script" +#~ msgstr "恢復預設的 hotplug 指令碼" + +#~ msgid "Restore..." +#~ msgstr "恢復..." + +#~ msgid "" +#~ "This section allows you to modify the contents of /etc/hotplug.d/iface/16-" +#~ "mwancustom<br />This is useful for running system commands and/or scripts " +#~ "based on interface ifup or ifdown hotplug events<br /><br />Notes:<br /" +#~ ">The first line of the script must be "#!/bin/sh" without " +#~ "quotes<br />Lines beginning with # are comments and are not executed<br /" +#~ "><br />Available variables:<br />$ACTION is the hotplug event (ifup, " +#~ "ifdown)<br />$INTERFACE is the interface name (wan1, wan2, etc.)<br />" +#~ "$DEVICE is the device name attached to the interface (eth0.1, eth1, etc.)" +#~ msgstr "" +#~ "這裡允許您修改 /etc/hotplug.d/iface/16-mwancustom 的內容<br />這可以在接" +#~ "口 ifup 或 ifdown Hotplug 事件時執行系統命令或指令碼<br /><br />注意:<br /" +#~ ">指令碼的第一行必須是 "#!/bin/sh" 不含引號<br />以#開頭的行是註" +#~ "釋,不會執行<br /><br />可用變數:<br />$ACTION 是 Hotplug 事件(ifup, " +#~ "ifdown)<br />$INTERFACE 是介面名稱(wan1、wan2 等)<br />$DEVICE 是連線到" +#~ "介面的設備名稱 (eth0.1、eth1 等)" diff --git a/applications/luci-app-mwan3/root/etc/hotplug.d/iface/16-mwancustombak b/applications/luci-app-mwan3/root/etc/hotplug.d/iface/16-mwancustombak new file mode 100755 index 0000000000..6e2875e3de --- /dev/null +++ b/applications/luci-app-mwan3/root/etc/hotplug.d/iface/16-mwancustombak @@ -0,0 +1,38 @@ +#!/bin/sh + +# to enable this script uncomment the case loop at the bottom +# to report mwan status on interface hotplug ifup/ifdown events modify the lines in the send_alert function + +send_alert() +{ + # variable "$1" stores the MWAN status information + # insert your code here to send the contents of "$1" + echo "$1" +} + +gather_event_info() +{ + # create event information message + local EVENT_INFO="Interface [ "$INTERFACE" ($DEVICE) ] on router [ "$(uci -p /var/state get system.@system[0].hostname)" ] has triggered a hotplug [ "$ACTION" ] event on "$(date +"%a %b %d %Y %T %Z")"" + + # get current interface, policy and rule status + local CURRENT_STATUS="$(/usr/sbin/mwan3 status)" + + # get last 50 MWAN systemlog messages + local MWAN_LOG="$(echo -e "Last 50 MWAN systemlog entries. Newest entries sorted at the top:\n$(logread | grep mwan3 | tail -n 50 | sed 'x;1!H;$!d;x')")" + + # pass event info to send_alert function + send_alert "$(echo -e "$EVENT_INFO\n\n$CURRENT_STATUS\n\n$MWAN_LOG")" +} + +#case "$ACTION" in +# ifup) +# gather_event_info +# ;; +# +# ifdown) +# gather_event_info +# ;; +#esac + +exit 0 diff --git a/applications/luci-app-mwan3/root/etc/uci-defaults/60_luci-mwan3 b/applications/luci-app-mwan3/root/etc/uci-defaults/60_luci-mwan3 new file mode 100755 index 0000000000..50c65ad678 --- /dev/null +++ b/applications/luci-app-mwan3/root/etc/uci-defaults/60_luci-mwan3 @@ -0,0 +1,21 @@ +#!/bin/sh + +# replace existing mwan ucitrack entry +uci -q batch <<-EOF >/dev/null + del ucitrack.@mwan3[-1] + add ucitrack mwan3 + set ucitrack.@mwan3[-1].exec="/usr/sbin/mwan3 restart" + commit ucitrack +EOF + +uci -q get mwan3.globals >/dev/null || { + uci -q add mwan3 globals >/dev/null + uci -q rename mwan3.@globals[-1]="globals" >/dev/null + uci -q set mwan3.globals.local_source="none" >/dev/null + uci commit mwan3 +} + +# remove LuCI cache +rm -rf /tmp/luci-indexcache /tmp/luci-modulecache + +exit 0 |