summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-status/htdocs/luci-static/resources
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-04-03 10:00:06 +0200
committerJo-Philipp Wich <jo@mein.io>2020-04-03 10:00:06 +0200
commit3c4bc228a1f7b5731cf464f3f407c9ed9ace3cd2 (patch)
treed9ac0458c66dfa3c5d4922314df9d41499f578bc /modules/luci-mod-status/htdocs/luci-static/resources
parent1099aebdee29b8e5408688d0fd64d49e6ec4bd35 (diff)
treewide: import utility classes explicitly
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-status/htdocs/luci-static/resources')
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/bandwidth.js22
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/connections.js9
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js3
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js3
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js3
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/30_network.js3
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js3
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js3
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js6
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/index.js9
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js6
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/load.js9
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/processes.js3
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/routes.js3
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js3
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/wireless.js9
16 files changed, 63 insertions, 34 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/bandwidth.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/bandwidth.js
index 0d89ae8ae..edb934ed9 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/bandwidth.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/bandwidth.js
@@ -1,4 +1,8 @@
'use strict';
+'require view';
+'require dom';
+'require poll';
+'require request';
'require ui';
'require rpc';
'require network';
@@ -20,7 +24,7 @@ function rate(n, br) {
return [ '%1024.2mbit/s'.format(n * 8), br ? E('br') : ' ', '(%1024.2mB/s)'.format(n) ]
}
-return L.view.extend({
+return view.extend({
load: function() {
return Promise.all([
this.loadSVG(L.resource('bandwidth.svg')),
@@ -95,7 +99,7 @@ return L.view.extend({
},
pollData: function() {
- L.Poll.add(L.bind(function() {
+ poll.add(L.bind(function() {
var tasks = [];
for (var i = 0; i < graphPolls.length; i++) {
@@ -227,7 +231,7 @@ return L.view.extend({
},
loadSVG: function(src) {
- return L.Request.get(src).then(function(response) {
+ return request.get(src).then(function(response) {
if (!response.ok)
throw new Error(response.statusText);
@@ -289,13 +293,13 @@ return L.view.extend({
tab.querySelector('#scale').firstChild.data = _('(%d minute window, %d second interval)').format(info.timeframe, info.interval);
- L.dom.content(tab.querySelector('#rx_bw_cur'), rate(info.line_current[0], true));
- L.dom.content(tab.querySelector('#rx_bw_avg'), rate(info.line_average[0], true));
- L.dom.content(tab.querySelector('#rx_bw_peak'), rate(info.line_peak[0], true));
+ dom.content(tab.querySelector('#rx_bw_cur'), rate(info.line_current[0], true));
+ dom.content(tab.querySelector('#rx_bw_avg'), rate(info.line_average[0], true));
+ dom.content(tab.querySelector('#rx_bw_peak'), rate(info.line_peak[0], true));
- L.dom.content(tab.querySelector('#tx_bw_cur'), rate(info.line_current[1], true));
- L.dom.content(tab.querySelector('#tx_bw_avg'), rate(info.line_average[1], true));
- L.dom.content(tab.querySelector('#tx_bw_peak'), rate(info.line_peak[1], true));
+ dom.content(tab.querySelector('#tx_bw_cur'), rate(info.line_current[1], true));
+ dom.content(tab.querySelector('#tx_bw_avg'), rate(info.line_average[1], true));
+ dom.content(tab.querySelector('#tx_bw_peak'), rate(info.line_peak[1], true));
});
}
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 458437ede..4c1b097f2 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
@@ -1,4 +1,7 @@
'use strict';
+'require view';
+'require poll';
+'require request';
'require rpc';
var callLuciRealtimeStats = rpc.declare({
@@ -30,7 +33,7 @@ var recheck_lookup_queue = {};
Math.log2 = Math.log2 || function(x) { return Math.log(x) * Math.LOG2E; };
-return L.view.extend({
+return view.extend({
load: function() {
return Promise.all([
this.loadSVG(L.resource('connections.svg'))
@@ -177,7 +180,7 @@ return L.view.extend({
},
pollData: function() {
- L.Poll.add(L.bind(function() {
+ poll.add(L.bind(function() {
var tasks = [
L.resolveDefault(callLuciConntrackList(), [])
];
@@ -300,7 +303,7 @@ return L.view.extend({
},
loadSVG: function(src) {
- return L.Request.get(src).then(function(response) {
+ return request.get(src).then(function(response) {
if (!response.ok)
throw new Error(response.statusText);
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 3b9428eaf..f3ee539bd 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
@@ -1,8 +1,9 @@
'use strict';
+'require view';
'require fs';
'require ui';
-return L.view.extend({
+return view.extend({
load: function() {
return fs.exec_direct('/bin/dmesg', [ '-r' ]).catch(function(err) {
ui.addNotification(null, E('p', {}, _('Unable to load log data: ' + err.message)));
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 4a3517529..942b2dd56 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
@@ -1,4 +1,5 @@
'use strict';
+'require baseclass';
'require fs';
'require rpc';
@@ -12,7 +13,7 @@ var callSystemInfo = rpc.declare({
method: 'info'
});
-return L.Class.extend({
+return baseclass.extend({
title: _('System'),
load: function() {
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js
index 4219a8797..ceb13b56f 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js
@@ -1,4 +1,5 @@
'use strict';
+'require baseclass';
'require rpc';
var callSystemInfo = rpc.declare({
@@ -19,7 +20,7 @@ function progressbar(value, max, byte) {
}, E('div', { 'style': 'width:%.2f%%'.format(pc) }));
}
-return L.Class.extend({
+return baseclass.extend({
title: _('Memory'),
load: function() {
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 0a7b00e21..d52840823 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
@@ -1,4 +1,5 @@
'use strict';
+'require baseclass';
'require fs';
'require network';
@@ -58,7 +59,7 @@ function renderbox(ifc, ipv6) {
]);
}
-return L.Class.extend({
+return baseclass.extend({
title: _('Network'),
load: function() {
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 5de79a8ee..f839a180c 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
@@ -1,4 +1,5 @@
'use strict';
+'require baseclass';
'require rpc';
'require network';
@@ -8,7 +9,7 @@ var callLuciDHCPLeases = rpc.declare({
expect: { '': {} }
});
-return L.Class.extend({
+return baseclass.extend({
title: '',
load: function() {
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js
index 5a3d64e7a..cafd554f9 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js
@@ -1,4 +1,5 @@
'use strict';
+'require baseclass';
'require rpc';
var callLuciDSLStatus = rpc.declare({
@@ -40,7 +41,7 @@ function renderbox(dsl) {
]);
}
-return L.Class.extend({
+return baseclass.extend({
title: _('DSL'),
load: function() {
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js
index 5eff56153..115fe9909 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js
@@ -1,4 +1,6 @@
'use strict';
+'require baseclass';
+'require dom';
'require network';
function renderbox(radio, networks) {
@@ -73,11 +75,11 @@ function wifirate(rt) {
return s;
}
-return L.Class.extend({
+return baseclass.extend({
title: _('Wireless'),
handleDelClient: function(wifinet, mac, ev) {
- L.dom.parent(ev.currentTarget, '.tr').style.opacity = 0.5;
+ dom.parent(ev.currentTarget, '.tr').style.opacity = 0.5;
ev.currentTarget.classList.add('spinning');
ev.currentTarget.disabled = true;
ev.currentTarget.blur();
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/index.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/index.js
index 01a8e1835..15dcbe638 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/index.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/index.js
@@ -1,4 +1,7 @@
'use strict';
+'require view';
+'require dom';
+'require poll';
'require fs';
'require network';
@@ -35,7 +38,7 @@ function startPolling(includes, containers) {
containers[i].parentNode.style.display = '';
containers[i].parentNode.classList.add('fade-in');
- L.dom.content(containers[i], content);
+ dom.content(containers[i], content);
}
}
@@ -48,11 +51,11 @@ function startPolling(includes, containers) {
};
return step().then(function() {
- L.Poll.add(step);
+ poll.add(step);
});
}
-return L.view.extend({
+return view.extend({
load: function() {
return L.resolveDefault(fs.list('/www' + L.resource('view/status/include')), []).then(function(entries) {
return Promise.all(entries.filter(function(e) {
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js
index fc7c7cdd1..84d2b1055 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js
@@ -1,10 +1,12 @@
'use strict';
+'require view';
+'require poll';
'require fs';
'require ui';
var table_names = [ 'Filter', 'NAT', 'Mangle', 'Raw' ];
-return L.view.extend({
+return view.extend({
load: function() {
return L.resolveDefault(fs.stat('/usr/sbin/ip6tables'));
},
@@ -215,7 +217,7 @@ return L.view.extend({
if (has_ip6tables)
cmds.push('/usr/sbin/ip6tables');
- L.Poll.add(L.bind(function() {
+ poll.add(L.bind(function() {
var tasks = [];
for (var i = 0; i < cmds.length; i++) {
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/load.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/load.js
index 646d256d6..3b302dc50 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/load.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/load.js
@@ -1,4 +1,7 @@
'use strict';
+'require view';
+'require poll';
+'require request';
'require rpc';
var callLuciRealtimeStats = rpc.declare({
@@ -13,7 +16,7 @@ var graphPolls = [],
Math.log2 = Math.log2 || function(x) { return Math.log(x) * Math.LOG2E; };
-return L.view.extend({
+return view.extend({
load: function() {
return Promise.all([
this.loadSVG(L.resource('load.svg'))
@@ -86,7 +89,7 @@ return L.view.extend({
},
pollData: function() {
- L.Poll.add(L.bind(function() {
+ poll.add(L.bind(function() {
var tasks = [];
for (var i = 0; i < graphPolls.length; i++) {
@@ -205,7 +208,7 @@ return L.view.extend({
},
loadSVG: function(src) {
- return L.Request.get(src).then(function(response) {
+ return request.get(src).then(function(response) {
if (!response.ok)
throw new Error(response.statusText);
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 d56eca507..8a77306e5 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
@@ -1,4 +1,5 @@
'use strict';
+'require view';
'require fs';
'require ui';
'require rpc';
@@ -9,7 +10,7 @@ var callLuciProcessList = rpc.declare({
expect: { result: [] }
});
-return L.view.extend({
+return view.extend({
load: function() {
return callLuciProcessList();
},
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/routes.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/routes.js
index 90cf2dd53..5da5d403b 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/routes.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/routes.js
@@ -1,4 +1,5 @@
'use strict';
+'require view';
'require fs';
'require rpc';
'require validation';
@@ -25,7 +26,7 @@ function applyMask(addr, mask, v6) {
v6 ? '%x:%x:%x:%x:%x:%x:%x:%x' : '%d.%d.%d.%d', words);
}
-return L.view.extend({
+return view.extend({
load: function() {
return Promise.all([
callNetworkInterfaceDump(),
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 69694bcfb..145a632e6 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
@@ -1,8 +1,9 @@
'use strict';
+'require view';
'require fs';
'require ui';
-return L.view.extend({
+return view.extend({
load: function() {
return fs.exec_direct('/sbin/logread', [ '-e', '^' ]).catch(function(err) {
ui.addNotification(null, E('p', {}, _('Unable to load log data: ' + err.message)));
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/wireless.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/wireless.js
index cd8cff133..171899262 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/wireless.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/wireless.js
@@ -1,4 +1,7 @@
'use strict';
+'require view';
+'require poll';
+'require request';
'require ui';
'require rpc';
'require network';
@@ -15,7 +18,7 @@ var graphPolls = [],
Math.log2 = Math.log2 || function(x) { return Math.log(x) * Math.LOG2E; };
-return L.view.extend({
+return view.extend({
load: function() {
return Promise.all([
this.loadSVG(L.resource('wireless.svg')),
@@ -102,7 +105,7 @@ return L.view.extend({
},
pollData: function() {
- L.Poll.add(L.bind(function() {
+ poll.add(L.bind(function() {
var tasks = [];
for (var i = 0; i < graphPolls.length; i++) {
@@ -221,7 +224,7 @@ return L.view.extend({
},
loadSVG: function(src) {
- return L.Request.get(src).then(function(response) {
+ return request.get(src).then(function(response) {
if (!response.ok)
throw new Error(response.statusText);