summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-status/htdocs
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-mod-status/htdocs')
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js44
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/connections.js2
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js4
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js2
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/30_network.js25
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js4
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js3
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/processes.js2
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js11
9 files changed, 55 insertions, 42 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js
index fa6d26538c..c6b1c053f8 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js
@@ -291,20 +291,24 @@ return view.extend({
continue;
res.channel_width = "20 MHz";
- if (res.ht_operation != null)
- if (res.ht_operation.channel_width == 2040) { /* 40 MHz Channel Enabled */
- if (res.ht_operation.secondary_channel_offset == "below") {
- res.channel_width = "40 MHz";
- chan_width = 4; /* 40 MHz Channel Used */
- center_channels[0] -= 2;
- } else if (res.ht_operation.secondary_channel_offset == "above") {
- res.channel_width = "40 MHz";
- chan_width = 4; /* 40 MHz Channel Used */
- center_channels[0] += 2;
- } else {
+ if (res.ht_operation != null) {
+ /* Detect 40 MHz operation by looking for the presence of
+ * a secondary channel. */
+ if (res.ht_operation.secondary_channel_offset == "below") {
+ res.channel_width = "40 MHz";
+ chan_width = 4; /* 40 MHz Channel Used */
+ center_channels[0] -= 2;
+ } else if (res.ht_operation.secondary_channel_offset == "above") {
+ res.channel_width = "40 MHz";
+ chan_width = 4; /* 40 MHz Channel Used */
+ center_channels[0] += 2;
+ } else {
+ /* Fallback to 20 MHz due to discovery of other APs on the
+ * same channel (802.11n coexistence mechanism). */
+ if (res.ht_operation.channel_width == 2040)
res.channel_width = "20 MHz (40 MHz Intolerant)";
- }
}
+ }
/* if channel_width <= 40, refer to HT (above) for actual channel width,
* as vht_operation.channel_width == 40 really only means that the used
@@ -314,6 +318,22 @@ return view.extend({
if (res.vht_operation.channel_width == 80) {
chan_width = 8;
res.channel_width = "80 MHz";
+
+ /* If needed, adjust based on the 802.11ac Wave 2 interop workaround. */
+ if (res.vht_operation.center_freq_2) {
+ var diff = Math.abs(res.vht_operation.center_freq_2 -
+ res.vht_operation.center_freq_1);
+
+ if (diff == 8) {
+ chan_width = 16;
+ res.channel_width = "160 MHz";
+ center_channels.push(res.vht_operation.center_freq_2);
+ } else if (diff > 8) {
+ chan_width = 8;
+ res.channel_width = "80+80 MHz";
+ center_channels.push(res.vht_operation.center_freq_2);
+ }
+ }
} else if (res.vht_operation.channel_width == 8080) {
res.channel_width = "80+80 MHz";
chan_width = 8;
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/connections.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/connections.js
index 23ff1df53e..bb5e937e36 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/connections.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/connections.js
@@ -135,7 +135,7 @@ return view.extend({
c.layer4.toUpperCase(),
'%h'.format(c.hasOwnProperty('sport') ? (src + ':' + c.sport) : src),
'%h'.format(c.hasOwnProperty('dport') ? (dst + ':' + c.dport) : dst),
- '%1024.2mB (%d %s)'.format(c.bytes, c.packets, _('Pkts.'))
+ [ c.bytes, '%1024.2mB (%d %s)'.format(c.bytes, c.packets, _('Pkts.')) ]
]);
}
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js
index 45b483962d..aad0383646 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js
@@ -38,7 +38,7 @@ return view.extend({
}, _('Scroll to tail', 'scroll to bottom (the tail) of the log file')
);
scrollDownButton.addEventListener('click', function() {
- scrollUpButton.focus();
+ scrollUpButton.scrollIntoView();
});
var scrollUpButton = E('button', {
@@ -47,7 +47,7 @@ return view.extend({
}, _('Scroll to head', 'scroll to top (the head) of the log file')
);
scrollUpButton.addEventListener('click', function() {
- scrollDownButton.focus();
+ scrollDownButton.scrollIntoView();
});
return E([], [
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js
index b511897921..3718d70ccf 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js
@@ -210,7 +210,7 @@ function buildInterfaceMapping(zones, networks) {
}
function formatSpeed(carrier, speed, duplex) {
- if (speed && duplex) {
+ if ((speed > 0) && duplex) {
var d = (duplex == 'half') ? '\u202f(H)' : '',
e = E('span', { 'title': _('Speed: %d Mibit/s, Duplex: %s').format(speed, duplex) });
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 1a0f7037f9..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
@@ -21,32 +21,23 @@ function renderbox(ifc, ipv6) {
active = (dev && ifc.getProtocol() != 'none'),
addrs = (ipv6 ? ifc.getIP6Addrs() : ifc.getIPAddrs()) || [],
dnssrv = (ipv6 ? ifc.getDNS6Addrs() : ifc.getDNSAddrs()) || [],
- expires = (ipv6 ? null : ifc.getExpiry()),
+ 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
]),
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js
index 0894d3d4d1..1cb923755d 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js
@@ -33,7 +33,7 @@ return baseclass.extend({
var cfg = uci.add('dhcp', 'host');
uci.set('dhcp', cfg, 'name', lease.hostname);
uci.set('dhcp', cfg, 'ip', lease.ipaddr);
- uci.set('dhcp', cfg, 'mac', lease.macaddr.toUpperCase());
+ uci.set('dhcp', cfg, 'mac', [lease.macaddr.toUpperCase()]);
return uci.save()
.then(L.bind(L.ui.changes.init, L.ui.changes))
@@ -50,7 +50,7 @@ return baseclass.extend({
uci.set('dhcp', cfg, 'name', lease.hostname);
uci.set('dhcp', cfg, 'duid', lease.duid.toUpperCase());
- uci.set('dhcp', cfg, 'mac', lease.macaddr);
+ uci.set('dhcp', cfg, 'mac', [lease.macaddr]);
if (ip6arr)
uci.set('dhcp', cfg, 'hostid', (ip6arr[6] * 0xFFFF + ip6arr[7]).toString(16));
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js
index be62d91350..406f134327 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js
@@ -93,6 +93,7 @@ var op_translations = {
var action_translations = {
'accept': _('Accept packet', 'nft accept action'),
+ 'notrack': _('Do not track', 'nft notrack action'),
'drop': _('Drop packet', 'nft drop action'),
'jump': _('Continue in <strong><a href="#%q.%q">%h</a></strong>', 'nft jump action'),
'log': _('Log event "<strong>%h</strong>…"', 'nft log action'),
@@ -145,6 +146,7 @@ return view.extend({
if (expr.hasOwnProperty(k)) {
switch (k) {
case 'accept':
+ case 'notrack':
case 'reject':
case 'drop':
case 'jump':
@@ -361,6 +363,7 @@ return view.extend({
}, (action_translations[k] || k).format(this.exprToString(spec.expr)));
case 'accept':
+ case 'notrack':
case 'drop':
return E('span', {
'class': 'ifacebadge'
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/processes.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/processes.js
index e7d094a7f9..96a1fdecb9 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/processes.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/processes.js
@@ -36,7 +36,7 @@ return view.extend({
rows.push([
proc.PID,
proc.USER,
- proc.COMMAND,
+ E('span', {'style': 'word-break: break-word'}, proc.COMMAND),
proc['%CPU'],
proc['%MEM'],
E('div', {}, [
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js
index 2e3d705c22..83a42cdbbf 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js
@@ -7,12 +7,11 @@
return view.extend({
retrieveLog: async function() {
return Promise.all([
- L.resolveDefault(fs.stat('/sbin/logread'), null),
- L.resolveDefault(fs.stat('/usr/sbin/logread'), null)
+ L.resolveDefault(fs.stat('/usr/libexec/syslog-wrapper'), null)
]).then(function(stat) {
- var logger = stat[0] ? stat[0].path : stat[1] ? stat[1].path : null;
+ var logger = stat[0].path;
- return fs.exec_direct(logger, [ '-e', '^' ]).then(logdata => {
+ return fs.exec_direct(logger).then(logdata => {
const loglines = logdata.trim().split(/\n/);
return { value: loglines.join('\n'), rows: loglines.length + 1 };
}).catch(function(err) {
@@ -43,7 +42,7 @@ return view.extend({
}, _('Scroll to tail', 'scroll to bottom (the tail) of the log file')
);
scrollDownButton.addEventListener('click', function() {
- scrollUpButton.focus();
+ scrollUpButton.scrollIntoView();
});
var scrollUpButton = E('button', {
@@ -52,7 +51,7 @@ return view.extend({
}, _('Scroll to head', 'scroll to top (the head) of the log file')
);
scrollUpButton.addEventListener('click', function() {
- scrollDownButton.focus();
+ scrollDownButton.scrollIntoView();
});
return E([], [