luci-mod-status: show all interface addresses on index page

Insteado f displaying only the primary/delegated address, display all
configured IP addresses in the upstream interface boxes, similar to
the interface overview page.

Fixes: #2757
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-07-10 07:13:00 +02:00
parent 66dfe64ca1
commit b5895e7c63
2 changed files with 22 additions and 6 deletions

View file

@ -52,8 +52,16 @@ L.poll(5, L.location(), { status: 1 },
_('Device'), ifc ? (ifc.name || ifc.ifname || '-') : '-',
_('MAC-Address'), (ifc && ifc.ether) ? ifc.mac : null)) ],
_('Protocol'), ifc.i18n || E('em', _('Not connected')),
_('Address'), (ifc.ipaddr) ? ifc.ipaddr : '0.0.0.0',
_('Netmask'), (ifc.netmask && ifc.netmask != ifc.ipaddr) ? ifc.netmask : '255.255.255.255',
_('Address'), (ifc.ipaddrs) ? ifc.ipaddrs[0] : null,
_('Address'), (ifc.ipaddrs) ? ifc.ipaddrs[1] : null,
_('Address'), (ifc.ipaddrs) ? ifc.ipaddrs[2] : null,
_('Address'), (ifc.ipaddrs) ? ifc.ipaddrs[3] : null,
_('Address'), (ifc.ipaddrs) ? ifc.ipaddrs[4] : null,
_('Address'), (ifc.ipaddrs) ? ifc.ipaddrs[5] : null,
_('Address'), (ifc.ipaddrs) ? ifc.ipaddrs[6] : null,
_('Address'), (ifc.ipaddrs) ? ifc.ipaddrs[7] : null,
_('Address'), (ifc.ipaddrs) ? ifc.ipaddrs[8] : null,
_('Address'), (ifc.ipaddrs) ? ifc.ipaddrs[9] : null,
_('Gateway'), (ifc.gwaddr) ? ifc.gwaddr : '0.0.0.0',
_('DNS') + ' 1', (ifc.dns) ? ifc.dns[0] : null,
_('DNS') + ' 2', (ifc.dns) ? ifc.dns[1] : null,
@ -78,7 +86,16 @@ L.poll(5, L.location(), { status: 1 },
_('MAC-Address'), (ifc6 && ifc6.ether) ? ifc6.mac : null)) ],
_('Protocol'), ifc6.i18n ? (ifc6.i18n + (ifc6.proto === 'dhcp' && ifc6.ip6prefix ? '-PD' : '')) : E('em', _('Not connected')),
_('Prefix Delegated'), ifc6.ip6prefix,
_('Address'), (ifc6.ip6prefix) ? (ifc6.ip6addr || null) : (ifc6.ip6addr || '::'),
_('Address'), (ifc6.ip6addrs) ? ifc6.ip6addrs[0] : null,
_('Address'), (ifc6.ip6addrs) ? ifc6.ip6addrs[1] : null,
_('Address'), (ifc6.ip6addrs) ? ifc6.ip6addrs[2] : null,
_('Address'), (ifc6.ip6addrs) ? ifc6.ip6addrs[3] : null,
_('Address'), (ifc6.ip6addrs) ? ifc6.ip6addrs[4] : null,
_('Address'), (ifc6.ip6addrs) ? ifc6.ip6addrs[5] : null,
_('Address'), (ifc6.ip6addrs) ? ifc6.ip6addrs[6] : null,
_('Address'), (ifc6.ip6addrs) ? ifc6.ip6addrs[7] : null,
_('Address'), (ifc6.ip6addrs) ? ifc6.ip6addrs[8] : null,
_('Address'), (ifc6.ip6addrs) ? ifc6.ip6addrs[9] : null,
_('Gateway'), (ifc6.gw6addr) ? ifc6.gw6addr : '::',
_('DNS') + ' 1', (ifc6.dns) ? ifc6.dns[0] : null,
_('DNS') + ' 2', (ifc6.dns) ? ifc6.dns[1] : null,

View file

@ -61,9 +61,8 @@
local link = dev and ipc.link(dev:name())
local wan_info = {
ipaddr = v:ipaddr(),
ipaddrs = v:ipaddrs(),
gwaddr = v:gwaddr(),
netmask = v:netmask(),
dns = v:dnsaddrs(),
expires = v:expires(),
uptime = v:uptime(),
@ -90,7 +89,7 @@
local dev = v:get_interface()
local link = dev and ipc.link(dev:name())
local wan6_info = {
ip6addr = v:ip6addr(),
ip6addrs = v:ip6addrs(),
gw6addr = v:gw6addr(),
dns = v:dns6addrs(),
ip6prefix = v:ip6prefix(),