summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-adblock/htdocs
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 /applications/luci-app-adblock/htdocs
parent1099aebdee29b8e5408688d0fd64d49e6ec4bd35 (diff)
treewide: import utility classes explicitly
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-adblock/htdocs')
-rw-r--r--applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/blacklist.js3
-rw-r--r--applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/dnsreport.js3
-rw-r--r--applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/logread.js6
-rw-r--r--applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js12
-rw-r--r--applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/whitelist.js3
5 files changed, 17 insertions, 10 deletions
diff --git a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/blacklist.js b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/blacklist.js
index 7e053c619..b0c8b5aaf 100644
--- a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/blacklist.js
+++ b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/blacklist.js
@@ -1,8 +1,9 @@
'use strict';
+'require view';
'require fs';
'require ui';
-return L.view.extend({
+return view.extend({
load: function() {
return L.resolveDefault(fs.read_direct('/etc/adblock/adblock.blacklist'), '');
},
diff --git a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/dnsreport.js b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/dnsreport.js
index 58a6dbe1a..a042c3516 100644
--- a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/dnsreport.js
+++ b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/dnsreport.js
@@ -1,4 +1,5 @@
'use strict';
+'require view';
'require fs';
'require ui';
@@ -186,7 +187,7 @@ function handleAction(ev) {
}
}
-return L.view.extend({
+return view.extend({
load: function() {
return L.resolveDefault(fs.exec_direct('/etc/init.d/adblock', ['report', '+', '50', 'false', 'json']),'');
},
diff --git a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/logread.js b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/logread.js
index 64f23b14c..4dc2a2e53 100644
--- a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/logread.js
+++ b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/logread.js
@@ -1,7 +1,9 @@
'use strict';
+'require view';
+'require poll';
'require fs';
-return L.view.extend({
+return view.extend({
load: function() {
return Promise.all([
L.resolveDefault(fs.stat('/sbin/logread'), null),
@@ -10,7 +12,7 @@ return L.view.extend({
},
render: function(stat) {
var logger = stat[0] ? stat[0].path : stat[1] ? stat[1].path : null;
- L.Poll.add(function() {
+ poll.add(function() {
return L.resolveDefault(fs.exec_direct(logger, ['-e', 'adblock-'])).then(function(res) {
var log = document.getElementById("logfile");
if (res) {
diff --git a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js
index bd997a49c..2ebab91dd 100644
--- a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js
+++ b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js
@@ -1,4 +1,6 @@
'use strict';
+'require view';
+'require poll';
'require fs';
'require ui';
'require uci';
@@ -98,7 +100,7 @@ async function handleAction(ev) {
}
}
- L.Poll.start();
+ poll.start();
fs.exec_direct('/etc/init.d/adblock', [ev])
var running = 1;
while (running === 1) {
@@ -109,10 +111,10 @@ async function handleAction(ev) {
}
})
}
- L.Poll.stop();
+ poll.stop();
}
-return L.view.extend({
+return view.extend({
load: function() {
return Promise.all([
L.resolveDefault(fs.exec_direct('/etc/init.d/adblock', ['list']), {}),
@@ -129,7 +131,7 @@ return L.view.extend({
/*
poll runtime information
*/
- pollData: L.Poll.add(function() {
+ pollData: poll.add(function() {
return L.resolveDefault(fs.read_direct('/tmp/adb_runtime.json'), 'null').then(function(res) {
var info = JSON.parse(res);
var status = document.getElementById('status');
@@ -142,7 +144,7 @@ return L.view.extend({
} else {
if (status.classList.contains("spinning")) {
status.classList.remove("spinning");
- L.Poll.stop();
+ poll.stop();
}
}
if (status.textContent.substr(0,6) === 'paused' && document.getElementById('btn_suspend')) {
diff --git a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/whitelist.js b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/whitelist.js
index 26ca7bfd2..5d310f1db 100644
--- a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/whitelist.js
+++ b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/whitelist.js
@@ -1,8 +1,9 @@
'use strict';
+'require view';
'require fs';
'require ui';
-return L.view.extend({
+return view.extend({
load: function() {
return L.resolveDefault(fs.read_direct('/etc/adblock/adblock.whitelist'), '');
},