luci-app-adblock: revert poll/view class changes 3851/head
authorDirk Brenken <dev@brenken.org>
Mon, 6 Apr 2020 12:41:36 +0000 (14:41 +0200)
committerDirk Brenken <dev@brenken.org>
Mon, 6 Apr 2020 12:41:36 +0000 (14:41 +0200)
* this partly reverts 3c4bc22 to ensure 19.07.2 compatibility,
  this is only a temporary "fix" as long as we don't have
  adblock 4 backported to 19.07 branch

Signed-off-by: Dirk Brenken <dev@brenken.org>
applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/blacklist.js
applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/dnsreport.js
applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/logread.js
applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js
applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/whitelist.js

index 23e346ed7dcbc9e4cca4f5928652dca1afc16ee1..69c25d6dd490816c2756aff38c6220c503a693d6 100644 (file)
@@ -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'), '');
        },
index a042c351696719d0dd416a5a3336d87c093e8a46..58a6dbe1a96b4e8258ded72867541e8a4c79b571 100644 (file)
@@ -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']),'');
        },
index 4dc2a2e53313b624ac5a57ddaf40c9b70f5d98be..64f23b14c808315c10bb147216b5ed96d410e51a 100644 (file)
@@ -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) {
index 5d4eca53a6d084a42d6ca77eeb71f26bfdfba1bd..4c20c48ec36ea64cf5b365b77df5decc2d3f5345 100644 (file)
@@ -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')) {
index 68c6644fb391d97db10ff6c7bf0453e41edf0115..6fc14becadf7b05869923150a1633d0963188e11 100644 (file)
@@ -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'), '');
        },