diff --git a/luci-app-vantage/Makefile b/luci-app-vantage/Makefile index 0d2d51197..432c7a2b3 100644 --- a/luci-app-vantage/Makefile +++ b/luci-app-vantage/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-vantage PKG_VERSION:=1.0.8 -PKG_RELEASE:=12 +PKG_RELEASE:=13 PKG_LICENSE:=GPL-3.0-or-later LUCI_TITLE:=Vantage dashboard diff --git a/luci-app-vantage/htdocs/luci-static/resources/vantage/model.js b/luci-app-vantage/htdocs/luci-static/resources/vantage/model.js index 3d6970af2..26a563609 100644 --- a/luci-app-vantage/htdocs/luci-static/resources/vantage/model.js +++ b/luci-app-vantage/htdocs/luci-static/resources/vantage/model.js @@ -173,10 +173,10 @@ return baseclass.extend({ }, /* Pick the interface carrying traffic in/out of this device, and the - physical device its counters live on. Routers: wan/wan6/*wan*. - Access points: the interface with the default route, else the first - one that is up. A bridge is followed to its wired member (wireless - members are skipped; netifd 'ethernet' members preferred); DSA with + physical device its counters live on. Prefer interfaces with a default + route, keeping wan/wan6/*wan* priority within that set. Fall back to + WAN names, then the first up interface. A bridge is followed to its + wired member (wireless members skipped; netifd 'ethernet' preferred); DSA with hardware offload uses the conduit's counters. */ resolveUplink: function(ifaces, devs, wirelessNames) { var self = this; @@ -186,15 +186,19 @@ return baseclass.extend({ var up = ifaces.filter(function(i) { return i && i.up && i.interface !== 'loopback' && (i.l3_device || i.device); }); - function named(re) { return up.filter(function(i) { return re.test(i.interface); })[0]; } + function named(list, re) { return list.filter(function(i) { return re.test(i.interface); })[0]; } + function preferredWan(list) { + return named(list, /^wan$/) || named(list, /^wan6$/) || named(list, /wan/i); + } function defRoute(i) { return arr(i.route).filter(function(r) { return r && +r.mask === 0 && (r.target === '0.0.0.0' || r.target === '::'); })[0] || null; } - var wan = named(/^wan$/) || named(/^wan6$/) || named(/wan/i); - var pick = wan || up.filter(defRoute)[0] || up[0]; + /* An AP may retain an up, unmanaged WAN port without any routes. */ + var routed = up.filter(defRoute); + var pick = preferredWan(routed) || routed[0] || preferredWan(up) || up[0]; if (!pick) return null; var l3 = pick.l3_device || pick.device, dev = l3, d = devs[dev]; @@ -216,7 +220,7 @@ return baseclass.extend({ l3dev: l3, dev: dev, statsDev: statsDev, - isWan: !!wan, + isWan: /wan/i.test(pick.interface), proto: pick.proto || null, uptime: finite(pick.uptime) ? pick.uptime : null, up: !!pick.up, diff --git a/luci-app-vantage/po/templates/vantage.pot b/luci-app-vantage/po/templates/vantage.pot index 337dc0057..ae43d53d2 100644 --- a/luci-app-vantage/po/templates/vantage.pot +++ b/luci-app-vantage/po/templates/vantage.pot @@ -1332,7 +1332,7 @@ msgstr "" msgid "Open network" msgstr "" -#: luci-app-vantage/htdocs/luci-static/resources/vantage/model.js:484 +#: luci-app-vantage/htdocs/luci-static/resources/vantage/model.js:488 msgid "OpenWrt device" msgstr "" @@ -1464,7 +1464,7 @@ msgstr "" msgid "Reverse DNS of its address" msgstr "" -#: luci-app-vantage/htdocs/luci-static/resources/vantage/model.js:496 +#: luci-app-vantage/htdocs/luci-static/resources/vantage/model.js:500 msgid "Root (overlay)" msgstr "" @@ -1605,7 +1605,7 @@ msgstr "" msgid "Tbit/s" msgstr "" -#: luci-app-vantage/htdocs/luci-static/resources/vantage/model.js:496 +#: luci-app-vantage/htdocs/luci-static/resources/vantage/model.js:500 msgid "Temporary (RAM)" msgstr "" diff --git a/luci-app-vantage/po/zh_Hans/vantage.po b/luci-app-vantage/po/zh_Hans/vantage.po index 646439c65..e72057788 100644 --- a/luci-app-vantage/po/zh_Hans/vantage.po +++ b/luci-app-vantage/po/zh_Hans/vantage.po @@ -1348,7 +1348,7 @@ msgstr "对互联网开放:%d" msgid "Open network" msgstr "开放网络" -#: luci-app-vantage/htdocs/luci-static/resources/vantage/model.js:484 +#: luci-app-vantage/htdocs/luci-static/resources/vantage/model.js:488 msgid "OpenWrt device" msgstr "OpenWrt 设备" @@ -1484,7 +1484,7 @@ msgstr "" msgid "Reverse DNS of its address" msgstr "其地址的反向 DNS" -#: luci-app-vantage/htdocs/luci-static/resources/vantage/model.js:496 +#: luci-app-vantage/htdocs/luci-static/resources/vantage/model.js:500 msgid "Root (overlay)" msgstr "Root(overlay)" @@ -1625,7 +1625,7 @@ msgstr "系统设置" msgid "Tbit/s" msgstr "Tbit/s" -#: luci-app-vantage/htdocs/luci-static/resources/vantage/model.js:496 +#: luci-app-vantage/htdocs/luci-static/resources/vantage/model.js:500 msgid "Temporary (RAM)" msgstr "临时(RAM)"