diff options
Diffstat (limited to 'applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js')
-rw-r--r-- | applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js | 12 |
1 files changed, 7 insertions, 5 deletions
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 4c20c48ec..5d4eca53a 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')) { |