X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-app-mwan3%2Fluasrc%2Fmodel%2Fcbi%2Fmwan%2Finterface.lua;h=4f5dc75360dc981bdc0d38db5fea6e9f88cec627;hp=a8e68a01be84b059112792db9345e0f77906ede2;hb=72bcd39b9fdcf9d1aad01894c8cc72bfb1d33cb7;hpb=c69622e5afb31490044e975c760daf81debd390e diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua index a8e68a01b..4f5dc7536 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua @@ -59,24 +59,24 @@ end function interfaceWarnings() -- display status and warning messages at the top of the page local warnings = "" if interfaceNumber <= 250 then - warnings = "There are currently " .. interfaceNumber .. " of 250 supported interfaces configured" + warnings = "" .. translatef("There are currently %d of 250 supported interfaces configured", interfaceNumber) .. "" else - warnings = "WARNING: " .. interfaceNumber .. " interfaces are configured exceeding the maximum of 250!" + warnings = "" .. translatef("WARNING: %d interfaces are configured exceeding the maximum of 250!", interfaceNumber) .. "" end if errorReliabilityList ~= " " then - warnings = warnings .. "

WARNING: some interfaces have a higher reliability requirement than there are tracking IP addresses!" + warnings = warnings .. "

" .. translate("WARNING: Some interfaces have a higher reliability requirement than there are tracking IP addresses!") .. "" end if errorRouteList ~= " " then - warnings = warnings .. "

WARNING: some interfaces have no default route in the main routing table!" + warnings = warnings .. "

" .. translate("WARNING: Some interfaces have no default route in the main routing table!") .. "" end if errorNetConfigList ~= " " then - warnings = warnings .. "

WARNING: some interfaces are configured incorrectly or not at all in /etc/config/network!" + warnings = warnings .. "

" .. translate("WARNING: Some interfaces are configured incorrectly or not at all in /etc/config/network!") .. "" end if errorNoMetricList ~= " " then - warnings = warnings .. "

WARNING: some interfaces have no metric configured in /etc/config/network!" + warnings = warnings .. "

" .. translate("WARNING: Some interfaces have no metric configured in /etc/config/network!") .. "" end if errorDuplicateMetricList ~= " " then - warnings = warnings .. "

WARNING: some interfaces have duplicate metrics configured in /etc/config/network!" + warnings = warnings .. "

" .. translate("WARNING: Some interfaces have duplicate metrics configured in /etc/config/network!") .. "" end return warnings end @@ -98,12 +98,12 @@ errorRouteList = " " interfaceCheck() -m5 = Map("mwan3", translate("MWAN Interface Configuration"), - translate(interfaceWarnings())) +m5 = Map("mwan3", translate("MWAN - Interfaces"), + interfaceWarnings()) m5:append(Template("mwan/config_css")) -mwan_interface = m5:section(TypedSection, "interface", translate("Interfaces"), +mwan_interface = m5:section(TypedSection, "interface", nil, translate("MWAN supports up to 250 physical and/or logical interfaces
" .. "MWAN requires that all interfaces have a unique metric configured in /etc/config/network
" .. "Names must match the interface name found in /etc/config/network (see advanced tab)
" .. @@ -111,14 +111,14 @@ mwan_interface = m5:section(TypedSection, "interface", translate("Interfaces"), "Interfaces may not share the same name as configured members, policies or rules")) mwan_interface.addremove = true mwan_interface.dynamic = false - mwan_interface.sectionhead = "Interface" - mwan_interface.sortable = true + 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") + mwan_interface.extedit = dsp.build_url("admin", "network", "mwan", "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)) + luci.http.redirect(dsp.build_url("admin", "network", "mwan", "interface", section)) end @@ -147,6 +147,16 @@ track_ip = mwan_interface:option(DummyValue, "track_ip", translate("Tracking IP" 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)