summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/30_network.js23
1 files changed, 7 insertions, 16 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/30_network.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/30_network.js
index 0d051bdeaf..e87aa34542 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/30_network.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/30_network.js
@@ -24,29 +24,20 @@ function renderbox(ifc, ipv6) {
expires = ifc.getExpiry(),
uptime = ifc.getUptime();
+ function addEntries(label, array) {
+ return Array.isArray(array) ? array.flatMap((item) => [label, item]) : [label, null];
+ }
+
return E('div', { class: 'ifacebox' }, [
E('div', { class: 'ifacebox-head center ' + (active ? 'active' : '') },
E('strong', ipv6 ? _('IPv6 Upstream') : _('IPv4 Upstream'))),
E('div', { class: 'ifacebox-body left' }, [
L.itemlist(E('span'), [
_('Protocol'), ifc.getI18n() || E('em', _('Not connected')),
- _('Prefix Delegated'), ipv6 ? ifc.getIP6Prefix() : null,
- _('Address'), addrs[0],
- _('Address'), addrs[1],
- _('Address'), addrs[2],
- _('Address'), addrs[3],
- _('Address'), addrs[4],
- _('Address'), addrs[5],
- _('Address'), addrs[6],
- _('Address'), addrs[7],
- _('Address'), addrs[8],
- _('Address'), addrs[9],
+ ...addEntries(_('Prefix Delegated'), ipv6 ? ifc.getIP6Prefixes?.() : null),
+ ...addEntries(_('Address'), addrs),
_('Gateway'), ipv6 ? (ifc.getGateway6Addr() || '::') : (ifc.getGatewayAddr() || '0.0.0.0'),
- _('DNS') + ' 1', dnssrv[0],
- _('DNS') + ' 2', dnssrv[1],
- _('DNS') + ' 3', dnssrv[2],
- _('DNS') + ' 4', dnssrv[3],
- _('DNS') + ' 5', dnssrv[4],
+ ...addEntries(_('DNS'), dnssrv),
_('Expires'), (expires != null && expires > -1) ? '%t'.format(expires) : null,
_('Connected'), (uptime > 0) ? '%t'.format(uptime) : null
]),