summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-status/htdocs/luci-static/resources/view
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-mod-status/htdocs/luci-static/resources/view')
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js51
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js13
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js11
3 files changed, 48 insertions, 27 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 0c8cff8c0e..692c67e3cd 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
@@ -163,6 +163,8 @@ return view.extend({
chan_analysis.tab.addEventListener('cbi-tab-active', L.bind(function(ev) {
this.active_tab = ev.detail.tab;
+ if (!this.radios[this.active_tab].loadedOnce)
+ poll.start();
}, this));
},
@@ -170,17 +172,17 @@ return view.extend({
if (!this.active_tab)
return;
- var radioDev = this.radios[this.active_tab].dev,
- table = this.radios[this.active_tab].table,
- chan_analysis = this.radios[this.active_tab].graph,
- scanCache = this.radios[this.active_tab].scanCache;
+ var radio = this.radios[this.active_tab];
return Promise.all([
- radioDev.getScanList(),
- this.callInfo(radioDev.getName())
+ radio.dev.getScanList(),
+ this.callInfo(radio.dev.getName())
]).then(L.bind(function(data) {
var results = data[0],
- local_wifi = data[1];
+ local_wifi = data[1],
+ table = radio.table,
+ chan_analysis = radio.graph,
+ scanCache = radio.scanCache;
var rows = [];
@@ -198,7 +200,7 @@ return view.extend({
if (chan_analysis.offset_tbl[local_wifi.channel] != null && local_wifi.center_chan1) {
var center_channels = [local_wifi.center_chan1],
- chan_width_text = local_wifi.htmode.replace(/(V)*HT/,''),
+ chan_width_text = local_wifi.htmode.replace(/(V)*H[TE]/,''), /* Handle HT VHT HE */
chan_width = parseInt(chan_width_text)/10;
if (local_wifi.center_chan2) {
@@ -228,10 +230,8 @@ return view.extend({
results.push(scanCache[k].data);
results.sort(function(a, b) {
- var diff = (b.quality - a.quality) || (a.channel - b.channel);
-
- if (diff)
- return diff;
+ if (a.channel - b.channel)
+ return 1;
if (a.ssid < b.ssid)
return -1;
@@ -306,6 +306,11 @@ return view.extend({
}
cbi_update_table(table, rows);
+
+ if (!radio.loadedOnce) {
+ radio.loadedOnce = true;
+ poll.stop();
+ }
}, this))
},
@@ -347,7 +352,16 @@ return view.extend({
var svg = data[0],
wifiDevs = data[1];
- var v = E('div', {}, E('div'));
+ var h2 = E('div', {'class' : 'cbi-title-section'}, [
+ E('h2', {'class': 'cbi-title-field'}, [ _('Channel Analysis') ]),
+ E('div', {'class': 'cbi-title-buttons' }, [
+ E('button', {
+ 'class': 'cbi-button cbi-button-edit',
+ 'click': ui.createHandlerFn(this, 'handleScanRefresh')
+ }, [ _('Refresh Channels') ])])
+ ]);
+
+ var tabs = E('div', {}, E('div'));
for (var ifname in wifiDevs) {
var freq_tbl = {
@@ -392,25 +406,24 @@ return view.extend({
dev: wifiDevs[ifname].dev,
graph: graph_data,
table: table,
- scanCache: {}
+ scanCache: {},
+ loadedOnce: false,
};
cbi_update_table(table, [], E('em', { class: 'spinning' }, _('Starting wireless scan...')));
- v.firstElementChild.appendChild(tab)
+ tabs.firstElementChild.appendChild(tab)
requestAnimationFrame(L.bind(this.create_channel_graph, this, graph_data, freq_tbl[freq], freq));
}
}
- ui.tabs.initTabGroup(v.firstElementChild.childNodes);
+ ui.tabs.initTabGroup(tabs.firstElementChild.childNodes);
this.pollFn = L.bind(this.handleScanRefresh, this);
-
poll.add(this.pollFn);
- poll.start();
- return v;
+ return E('div', {}, [h2, tabs]);
},
handleSaveApply: null,
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
index ae7efa3e75..45f7b4acae 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
@@ -3,6 +3,11 @@
'require fs';
'require rpc';
+var callLuciVersion = rpc.declare({
+ object: 'luci',
+ method: 'getVersion'
+});
+
var callSystemBoard = rpc.declare({
object: 'system',
method: 'board'
@@ -20,7 +25,7 @@ return baseclass.extend({
return Promise.all([
L.resolveDefault(callSystemBoard(), {}),
L.resolveDefault(callSystemInfo(), {}),
- fs.lines('/usr/lib/lua/luci/version.lua')
+ L.resolveDefault(callLuciVersion(), { revision: _('unknown version'), branch: 'LuCI' })
]);
},
@@ -29,11 +34,7 @@ return baseclass.extend({
systeminfo = data[1],
luciversion = data[2];
- luciversion = luciversion.filter(function(l) {
- return l.match(/^\s*(luciname|luciversion)\s*=/);
- }).map(function(l) {
- return l.replace(/^\s*\w+\s*=\s*['"]([^'"]+)['"].*$/, '$1');
- }).join(' ');
+ luciversion = luciversion.branch + ' ' + luciversion.revision;
var datestr = null;
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 82660c1595..de2f3d4daa 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
@@ -25,6 +25,7 @@ var expr_translations = {
'meta.mark': _('Packet mark', 'nft meta mark'),
+ 'meta.time': _('Packet receive time', 'nft meta time'),
'meta.hour': _('Current time', 'nft meta hour'),
'meta.day': _('Current weekday', 'nft meta day'),
@@ -95,6 +96,7 @@ var action_translations = {
'accept': _('Accept packet', 'nft accept 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'),
'reject.tcp reset': _('Reject packet with <strong>TCP reset</strong>', 'nft reject with tcp reset'),
'reject.icmp': _('Reject IPv4 packet with <strong>ICMP type %h</strong>', 'nft reject with icmp type'),
@@ -154,6 +156,7 @@ return view.extend({
case 'masquerade':
case 'return':
case 'flow':
+ case 'log':
return true;
}
}
@@ -355,8 +358,7 @@ return view.extend({
var k = 'reject.%s'.format(spec.type);
return E('span', {
- 'class': 'ifacebadge',
- 'data-tooltip': JSON.stringify(spec)
+ 'class': 'ifacebadge'
}, (action_translations[k] || k).format(this.exprToString(spec.expr)));
case 'accept':
@@ -445,6 +447,11 @@ return view.extend({
'class': 'ifacebadge'
}, action_translations.flow.format(spec.flowtable.replace(/^@/, '')));
+ case 'log':
+ return E('span', {
+ 'class': 'ifacebadge'
+ }, action_translations.log.format(spec.prefix));
+
default:
return E('span', {
'class': 'ifacebadge',