summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-04-07 17:53:18 +0200
committerGitHub <noreply@github.com>2020-04-07 17:53:18 +0200
commit9ffbf0781edfe479cb9a75723cc13deac7ff8a34 (patch)
tree3f4e1411815d0d6d91baff42e27e742ff4a15041
parent40982927c6b54e950be19aceeb93fe56f6d8ab29 (diff)
parent0f8aea76e0d1597cf3f53664941e157cdeb631ed (diff)
Merge pull request #3851 from dibdot/adblock
luci-app-adblock: revert poll/view class changes
-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, 10 insertions, 17 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 23e346ed7..69c25d6dd 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,9 +1,8 @@
'use strict';
-'require view';
'require fs';
'require ui';
-return view.extend({
+return L.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 a042c3516..58a6dbe1a 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,5 +1,4 @@
'use strict';
-'require view';
'require fs';
'require ui';
@@ -187,7 +186,7 @@ function handleAction(ev) {
}
}
-return view.extend({
+return L.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 4dc2a2e53..64f23b14c 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,9 +1,7 @@
'use strict';
-'require view';
-'require poll';
'require fs';
-return view.extend({
+return L.view.extend({
load: function() {
return Promise.all([
L.resolveDefault(fs.stat('/sbin/logread'), null),
@@ -12,7 +10,7 @@ return view.extend({
},
render: function(stat) {
var logger = stat[0] ? stat[0].path : stat[1] ? stat[1].path : null;
- poll.add(function() {
+ L.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 5d4eca53a..4c20c48ec 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,6 +1,4 @@
'use strict';
-'require view';
-'require poll';
'require fs';
'require ui';
'require uci';
@@ -100,7 +98,7 @@ async function handleAction(ev) {
}
}
- poll.start();
+ L.Poll.start();
fs.exec_direct('/etc/init.d/adblock', [ev])
var running = 1;
while (running === 1) {
@@ -111,10 +109,10 @@ async function handleAction(ev) {
}
})
}
- poll.stop();
+ L.Poll.stop();
}
-return view.extend({
+return L.view.extend({
load: function() {
return Promise.all([
L.resolveDefault(fs.exec_direct('/etc/init.d/adblock', ['list']), {}),
@@ -131,7 +129,7 @@ return view.extend({
/*
poll runtime information
*/
- pollData: poll.add(function() {
+ pollData: L.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');
@@ -144,7 +142,7 @@ return view.extend({
} else {
if (status.classList.contains("spinning")) {
status.classList.remove("spinning");
- poll.stop();
+ L.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 68c6644fb..6fc14beca 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,9 +1,8 @@
'use strict';
-'require view';
'require fs';
'require ui';
-return view.extend({
+return L.view.extend({
load: function() {
return L.resolveDefault(fs.read_direct('/etc/adblock/adblock.whitelist'), '');
},