From 3c4bc228a1f7b5731cf464f3f407c9ed9ace3cd2 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 3 Apr 2020 10:00:06 +0200 Subject: [PATCH] treewide: import utility classes explicitly Signed-off-by: Jo-Philipp Wich --- .../resources/view/adblock/blacklist.js | 3 +- .../resources/view/adblock/dnsreport.js | 3 +- .../resources/view/adblock/logread.js | 6 ++- .../resources/view/adblock/overview.js | 12 +++--- .../resources/view/adblock/whitelist.js | 3 +- .../resources/view/ddns/overview.js | 11 +++-- .../resources/view/status/include/70_ddns.js | 3 +- .../luci-static/resources/tools/firewall.js | 8 ++-- .../resources/view/firewall/custom.js | 3 +- .../resources/view/firewall/forwards.js | 3 +- .../resources/view/firewall/rules.js | 3 +- .../resources/view/firewall/snats.js | 3 +- .../resources/view/firewall/zones.js | 3 +- .../htdocs/luci-static/resources/view/frpc.js | 3 +- .../htdocs/luci-static/resources/view/frps.js | 3 +- .../luci-static/resources/view/ksmbd.js | 3 +- .../resources/view/system/led-trigger/rssi.js | 3 +- .../view/system/led-trigger/switch0.js | 3 +- .../view/system/led-trigger/switch1.js | 3 +- .../view/system/led-trigger/usbport.js | 3 +- .../luci-static/resources/view/minidlna.js | 3 +- .../view/status/include/80_minidlna.js | 3 +- .../resources/view/nextdns/logread.js | 6 ++- .../resources/view/nextdns/overview.js | 3 +- .../htdocs/luci-static/resources/view/nlbw.js | 8 ++-- .../luci-static/resources/view/omcproxy.js | 3 +- .../htdocs/luci-static/resources/view/opkg.js | 3 +- .../luci-static/resources/view/pagekitec.js | 3 +- .../luci-static/resources/view/samba4.js | 3 +- .../resources/view/ser2net/leds.js | 3 +- .../resources/view/ser2net/proxies.js | 3 +- .../resources/view/ser2net/settings.js | 3 +- .../resources/shadowsocks-libev.js | 3 +- .../view/shadowsocks-libev/instances.js | 6 ++- .../resources/view/shadowsocks-libev/rules.js | 3 +- .../view/shadowsocks-libev/servers.js | 3 +- .../resources/statistics/rrdtool.js | 3 +- .../statistics/rrdtool/definitions/apcups.js | 3 +- .../rrdtool/definitions/conntrack.js | 3 +- .../rrdtool/definitions/contextswitch.js | 3 +- .../statistics/rrdtool/definitions/cpu.js | 3 +- .../statistics/rrdtool/definitions/cpufreq.js | 3 +- .../statistics/rrdtool/definitions/curl.js | 3 +- .../statistics/rrdtool/definitions/df.js | 3 +- .../statistics/rrdtool/definitions/disk.js | 3 +- .../statistics/rrdtool/definitions/dns.js | 3 +- .../statistics/rrdtool/definitions/entropy.js | 3 +- .../rrdtool/definitions/interface.js | 3 +- .../rrdtool/definitions/ip6tables.js | 3 +- .../rrdtool/definitions/iptables.js | 3 +- .../statistics/rrdtool/definitions/irq.js | 3 +- .../statistics/rrdtool/definitions/iwinfo.js | 3 +- .../statistics/rrdtool/definitions/load.js | 3 +- .../statistics/rrdtool/definitions/memory.js | 3 +- .../statistics/rrdtool/definitions/netlink.js | 3 +- .../statistics/rrdtool/definitions/nut.js | 3 +- .../statistics/rrdtool/definitions/olsrd.js | 3 +- .../statistics/rrdtool/definitions/openvpn.js | 3 +- .../statistics/rrdtool/definitions/ping.js | 3 +- .../rrdtool/definitions/processes.js | 3 +- .../statistics/rrdtool/definitions/sensors.js | 3 +- .../rrdtool/definitions/splash_leases.js | 3 +- .../rrdtool/definitions/tcpconns.js | 3 +- .../statistics/rrdtool/definitions/thermal.js | 3 +- .../statistics/rrdtool/definitions/uptime.js | 3 +- .../resources/view/statistics/collectd.js | 6 ++- .../resources/view/statistics/graphs.js | 15 ++++--- .../view/statistics/plugins/apcups.js | 3 +- .../view/statistics/plugins/conntrack.js | 3 +- .../view/statistics/plugins/contextswitch.js | 3 +- .../resources/view/statistics/plugins/cpu.js | 3 +- .../view/statistics/plugins/cpufreq.js | 3 +- .../resources/view/statistics/plugins/csv.js | 3 +- .../resources/view/statistics/plugins/curl.js | 3 +- .../resources/view/statistics/plugins/df.js | 3 +- .../resources/view/statistics/plugins/disk.js | 3 +- .../resources/view/statistics/plugins/dns.js | 3 +- .../view/statistics/plugins/email.js | 3 +- .../view/statistics/plugins/entropy.js | 3 +- .../resources/view/statistics/plugins/exec.js | 3 +- .../view/statistics/plugins/interface.js | 3 +- .../view/statistics/plugins/iptables.js | 3 +- .../resources/view/statistics/plugins/irq.js | 3 +- .../view/statistics/plugins/iwinfo.js | 3 +- .../resources/view/statistics/plugins/load.js | 3 +- .../view/statistics/plugins/memory.js | 3 +- .../view/statistics/plugins/netlink.js | 3 +- .../view/statistics/plugins/network.js | 3 +- .../resources/view/statistics/plugins/nut.js | 3 +- .../view/statistics/plugins/olsrd.js | 3 +- .../view/statistics/plugins/openvpn.js | 3 +- .../resources/view/statistics/plugins/ping.js | 3 +- .../view/statistics/plugins/processes.js | 3 +- .../view/statistics/plugins/rrdtool.js | 3 +- .../view/statistics/plugins/sensors.js | 3 +- .../view/statistics/plugins/splash_leases.js | 3 +- .../view/statistics/plugins/tcpconns.js | 3 +- .../view/statistics/plugins/thermal.js | 3 +- .../view/statistics/plugins/unixsock.js | 3 +- .../view/statistics/plugins/uptime.js | 3 +- .../resources/view/transmission.js | 3 +- .../luci-static/resources/view/ttyd/config.js | 3 +- .../luci-static/resources/view/ttyd/term.js | 3 +- .../resources/view/status/include/80_upnp.js | 6 ++- .../luci-static/resources/view/upnp/upnp.js | 9 ++-- .../resources/view/vnstat2/config.js | 3 +- .../resources/view/vnstat2/graphs.js | 3 +- .../htdocs/luci-static/resources/view/wol.js | 6 ++- .../resources/view/yggdrasil/keys.js | 3 +- .../resources/view/yggdrasil/peers.js | 3 +- .../view/yggdrasil/session_firewall.js | 3 +- .../resources/view/yggdrasil/settings.js | 3 +- .../resources/view/yggdrasil/status.js | 3 +- .../view/yggdrasil/tunnel_routing.js | 3 +- .../resources/view/network/dhcp.js | 9 ++-- .../resources/view/network/diagnostics.js | 6 ++- .../resources/view/network/hosts.js | 3 +- .../resources/view/network/interfaces.js | 29 +++++++------ .../resources/view/network/routes.js | 3 +- .../resources/view/network/switch.js | 11 +++-- .../resources/view/network/wireless.js | 41 ++++++++++--------- .../resources/view/status/bandwidth.js | 22 ++++++---- .../resources/view/status/connections.js | 9 ++-- .../resources/view/status/dmesg.js | 3 +- .../view/status/include/10_system.js | 3 +- .../view/status/include/20_memory.js | 3 +- .../view/status/include/30_network.js | 3 +- .../resources/view/status/include/40_dhcp.js | 3 +- .../resources/view/status/include/50_dsl.js | 3 +- .../resources/view/status/include/60_wifi.js | 6 ++- .../resources/view/status/index.js | 9 ++-- .../resources/view/status/iptables.js | 6 ++- .../luci-static/resources/view/status/load.js | 9 ++-- .../resources/view/status/processes.js | 3 +- .../resources/view/status/routes.js | 3 +- .../resources/view/status/syslog.js | 3 +- .../resources/view/status/wireless.js | 9 ++-- .../luasrc/view/admin_status/index.htm | 2 +- .../resources/view/system/crontab.js | 3 +- .../resources/view/system/dropbear.js | 3 +- .../resources/view/system/flash.js | 6 ++- .../view/system/led-trigger/default-on.js | 3 +- .../view/system/led-trigger/heartbeat.js | 3 +- .../view/system/led-trigger/netdev.js | 3 +- .../resources/view/system/led-trigger/none.js | 3 +- .../view/system/led-trigger/timer.js | 3 +- .../luci-static/resources/view/system/leds.js | 3 +- .../resources/view/system/mounts.js | 3 +- .../resources/view/system/password.js | 8 ++-- .../resources/view/system/reboot.js | 3 +- .../resources/view/system/sshkeys.js | 3 +- .../resources/view/system/startup.js | 3 +- .../resources/view/system/system.js | 6 ++- 153 files changed, 426 insertions(+), 236 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'), ''); }, diff --git a/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js b/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js index 392cf239b..a15563e5b 100644 --- a/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js +++ b/applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js @@ -1,4 +1,7 @@ 'use strict'; +'require view'; +'require dom'; +'require poll'; 'require uci'; 'require rpc'; 'require fs'; @@ -41,7 +44,7 @@ callDDnsGetStatus = rpc.declare({ expect: { } }); -return L.view.extend({ +return view.extend({ callDDnsGetEnv: rpc.declare({ object: 'luci.ddns', @@ -64,7 +67,7 @@ return L.view.extend({ ddns_toggle.innerHTML = status['_enabled'] ? _('Stop DDNS') : _('Start DDNS') - L.dom.content(ddns_enabled, function() { + dom.content(ddns_enabled, function() { return E([], [ E('div', {}, status['_enabled'] ? _('DDNS Autostart enabled') : [ _('DDNS Autostart disabled'), @@ -374,7 +377,7 @@ return L.view.extend({ (resolved[section_id].pid && cfg_enabled == '1')) stop_opt['disabled'] = 'disabled'; - L.dom.content(tdEl.lastChild, [ + dom.content(tdEl.lastChild, [ E('button', stop_opt, _('Stop')), E('button', reload_opt, _('Reload')), tdEl.lastChild.childNodes[0], @@ -982,7 +985,7 @@ return L.view.extend({ } return m.render().then(L.bind(function(m, nodes) { - L.Poll.add(L.bind(function() { + poll.add(L.bind(function() { return Promise.all([ this.callDDnsGetServicesStatus(), callDDnsGetStatus() diff --git a/applications/luci-app-ddns/htdocs/luci-static/resources/view/status/include/70_ddns.js b/applications/luci-app-ddns/htdocs/luci-static/resources/view/status/include/70_ddns.js index 698cf8d25..13e8fba21 100644 --- a/applications/luci-app-ddns/htdocs/luci-static/resources/view/status/include/70_ddns.js +++ b/applications/luci-app-ddns/htdocs/luci-static/resources/view/status/include/70_ddns.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require rpc'; 'require uci'; -return L.Class.extend({ +return baseclass.extend({ title: _('Dynamic DNS'), callDDnsGetServicesStatus: rpc.declare({ diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js b/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js index 640b28cf7..e85b6bc6e 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js @@ -1,4 +1,6 @@ 'use strict'; +'require baseclass'; +'require dom'; 'require ui'; 'require uci'; 'require form'; @@ -81,7 +83,7 @@ function lookupProto(x) { return [ -1, x, x ]; } -return L.Class.extend({ +return baseclass.extend({ fmt: function(fmtstr, args, values) { var repl = [], wrap = false, @@ -112,7 +114,7 @@ return L.Class.extend({ }; var isset = function(val) { - if (L.isObject(val) && !L.dom.elem(val)) { + if (L.isObject(val) && !dom.elem(val)) { for (var k in val) if (val.hasOwnProperty(k)) return true; @@ -128,7 +130,7 @@ return L.Class.extend({ }; var parse = function(tokens, text) { - if (L.dom.elem(text)) { + if (dom.elem(text)) { tokens.push(''.format(values.length)); values.push(text); } diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/custom.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/custom.js index 9feafd824..ca870552a 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/custom.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/custom.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('/etc/firewall.user'), ''); }, diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js index 916a32fca..82703c320 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require ui'; 'require rpc'; 'require uci'; @@ -84,7 +85,7 @@ function rule_target_txt(s) { }); } -return L.view.extend({ +return view.extend({ callHostHints: rpc.declare({ object: 'luci-rpc', method: 'getHostHints', diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js index ada05f24c..8cb1a1242 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require ui'; 'require rpc'; 'require uci'; @@ -136,7 +137,7 @@ function rule_target_txt(s, ctHelpers) { } } -return L.view.extend({ +return view.extend({ callHostHints: rpc.declare({ object: 'luci-rpc', method: 'getHostHints', diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js index 8a1d41e71..859dba3e8 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require ui'; 'require rpc'; 'require uci'; @@ -90,7 +91,7 @@ function rule_target_txt(s) { } } -return L.view.extend({ +return view.extend({ callHostHints: rpc.declare({ object: 'luci-rpc', method: 'getHostHints', diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js index 85c126d7a..85e20a23c 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require rpc'; 'require uci'; 'require form'; @@ -7,7 +8,7 @@ 'require tools.firewall as fwtool'; 'require tools.widgets as widgets'; -return L.view.extend({ +return view.extend({ callConntrackHelpers: rpc.declare({ object: 'luci', method: 'getConntrackHelpers', diff --git a/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js b/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js index da86569f1..d93655188 100644 --- a/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js +++ b/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require ui'; 'require form'; 'require tools.widgets as widgets'; @@ -113,7 +114,7 @@ function defOpts(s, opts, params) { } } -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-frps/htdocs/luci-static/resources/view/frps.js b/applications/luci-app-frps/htdocs/luci-static/resources/view/frps.js index d941a9937..5c2162f94 100644 --- a/applications/luci-app-frps/htdocs/luci-static/resources/view/frps.js +++ b/applications/luci-app-frps/htdocs/luci-static/resources/view/frps.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require form'; 'require tools.widgets as widgets'; @@ -88,7 +89,7 @@ function defOpts(s, opts, params) { } } -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js b/applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js index 6cf9f3eda..4a9de896f 100644 --- a/applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js +++ b/applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js @@ -1,9 +1,10 @@ 'use strict'; +'require view'; 'require fs'; 'require form'; 'require tools.widgets as widgets'; -return L.view.extend({ +return view.extend({ load: function() { return Promise.all([ L.resolveDefault(fs.stat('/sbin/block'), null), diff --git a/applications/luci-app-ledtrig-rssi/htdocs/luci-static/resources/view/system/led-trigger/rssi.js b/applications/luci-app-ledtrig-rssi/htdocs/luci-static/resources/view/system/led-trigger/rssi.js index 611adc8b1..8f8b8ad78 100644 --- a/applications/luci-app-ledtrig-rssi/htdocs/luci-static/resources/view/system/led-trigger/rssi.js +++ b/applications/luci-app-ledtrig-rssi/htdocs/luci-static/resources/view/system/led-trigger/rssi.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require form'; 'require tools.widgets as widgets'; -return L.Class.extend({ +return baseclass.extend({ trigger: _('rssi (service)'), kernel: false, addFormOptions(s){ diff --git a/applications/luci-app-ledtrig-switch/htdocs/luci-static/resources/view/system/led-trigger/switch0.js b/applications/luci-app-ledtrig-switch/htdocs/luci-static/resources/view/system/led-trigger/switch0.js index 2f59866a6..dd68c93cf 100644 --- a/applications/luci-app-ledtrig-switch/htdocs/luci-static/resources/view/system/led-trigger/switch0.js +++ b/applications/luci-app-ledtrig-switch/htdocs/luci-static/resources/view/system/led-trigger/switch0.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ trigger: _('switch0 (kernel)'), kernel: true, addFormOptions(s){ diff --git a/applications/luci-app-ledtrig-switch/htdocs/luci-static/resources/view/system/led-trigger/switch1.js b/applications/luci-app-ledtrig-switch/htdocs/luci-static/resources/view/system/led-trigger/switch1.js index 7800cba22..42cac4edb 100644 --- a/applications/luci-app-ledtrig-switch/htdocs/luci-static/resources/view/system/led-trigger/switch1.js +++ b/applications/luci-app-ledtrig-switch/htdocs/luci-static/resources/view/system/led-trigger/switch1.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ trigger: _('switch1 (kernel)'), kernel: true, addFormOptions(s){ diff --git a/applications/luci-app-ledtrig-usbport/htdocs/luci-static/resources/view/system/led-trigger/usbport.js b/applications/luci-app-ledtrig-usbport/htdocs/luci-static/resources/view/system/led-trigger/usbport.js index 970016c42..71ed7bf8a 100644 --- a/applications/luci-app-ledtrig-usbport/htdocs/luci-static/resources/view/system/led-trigger/usbport.js +++ b/applications/luci-app-ledtrig-usbport/htdocs/luci-static/resources/view/system/led-trigger/usbport.js @@ -1,4 +1,5 @@ 'use strict'; +'require baseclass'; 'require rpc'; 'require uci'; 'require form'; @@ -9,7 +10,7 @@ var callUSB = rpc.declare({ expect: { 'ports': [] } }); -return L.Class.extend({ +return baseclass.extend({ trigger: _('usbport (kernel)'), kernel: true, addFormOptions(s){ diff --git a/applications/luci-app-minidlna/htdocs/luci-static/resources/view/minidlna.js b/applications/luci-app-minidlna/htdocs/luci-static/resources/view/minidlna.js index ff3cae13e..083f2bafa 100644 --- a/applications/luci-app-minidlna/htdocs/luci-static/resources/view/minidlna.js +++ b/applications/luci-app-minidlna/htdocs/luci-static/resources/view/minidlna.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require fs'; 'require uci'; 'require form'; @@ -28,7 +29,7 @@ var CBIMiniDLNAStatus = form.DummyValue.extend({ } }); -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-minidlna/htdocs/luci-static/resources/view/status/include/80_minidlna.js b/applications/luci-app-minidlna/htdocs/luci-static/resources/view/status/include/80_minidlna.js index f67e5f84b..55a78c0cb 100644 --- a/applications/luci-app-minidlna/htdocs/luci-static/resources/view/status/include/80_minidlna.js +++ b/applications/luci-app-minidlna/htdocs/luci-static/resources/view/status/include/80_minidlna.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require fs'; 'require uci'; -return L.Class.extend({ +return baseclass.extend({ title: _('miniDLNA Status'), load: function() { diff --git a/applications/luci-app-nextdns/htdocs/luci-static/resources/view/nextdns/logread.js b/applications/luci-app-nextdns/htdocs/luci-static/resources/view/nextdns/logread.js index 9b3c7bfc4..0ad4a7982 100644 --- a/applications/luci-app-nextdns/htdocs/luci-static/resources/view/nextdns/logread.js +++ b/applications/luci-app-nextdns/htdocs/luci-static/resources/view/nextdns/logread.js @@ -1,9 +1,11 @@ 'use strict'; +'require view'; +'require poll'; 'require fs'; -return L.view.extend({ +return view.extend({ render: function() { - L.Poll.add(function() { + poll.add(function() { return L.resolveDefault(fs.exec('/sbin/logread', ['-e', 'nextdns']), { code: 1 }) .then(function(res) { var content; diff --git a/applications/luci-app-nextdns/htdocs/luci-static/resources/view/nextdns/overview.js b/applications/luci-app-nextdns/htdocs/luci-static/resources/view/nextdns/overview.js index 2fd693f3e..4899fda97 100644 --- a/applications/luci-app-nextdns/htdocs/luci-static/resources/view/nextdns/overview.js +++ b/applications/luci-app-nextdns/htdocs/luci-static/resources/view/nextdns/overview.js @@ -1,7 +1,8 @@ 'use strict'; +'require view'; 'require form'; -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw.js b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw.js index 8a01b1db4..033f1f06c 100644 --- a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw.js +++ b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw.js @@ -63,7 +63,7 @@ Chart.defaults.global.tooltipTemplate = function(tip) { function kpi(id, val1, val2, val3) { - var e = L.dom.elem(id) ? id : document.getElementById(id); + var e = dom.elem(id) ? id : document.getElementById(id); if (val1 && val2 && val3) e.innerHTML = _('%s, %s and %s').format(val1, val2, val3); @@ -96,8 +96,8 @@ function pie(id, data) } } - var node = L.dom.elem(id) ? id : document.getElementById(id), - key = L.dom.elem(id) ? id.id : id, + var node = dom.elem(id) ? id : document.getElementById(id), + key = dom.elem(id) ? id.id : id, ctx = node.getContext('2d'); if (chartRegistry.hasOwnProperty(key)) @@ -279,7 +279,7 @@ function renderHostDetail(tooltip) var rxData = [], txData = []; - L.dom.content(tooltip, [ + dom.content(tooltip, [ E('div', { 'class': 'head' }, [ E('div', { 'class': 'pie' }, [ E('label', _('Download')), diff --git a/applications/luci-app-omcproxy/htdocs/luci-static/resources/view/omcproxy.js b/applications/luci-app-omcproxy/htdocs/luci-static/resources/view/omcproxy.js index cbc77f66f..a74bb4cd6 100644 --- a/applications/luci-app-omcproxy/htdocs/luci-static/resources/view/omcproxy.js +++ b/applications/luci-app-omcproxy/htdocs/luci-static/resources/view/omcproxy.js @@ -2,10 +2,11 @@ // This is free software, licensed under the Apache License, Version 2.0 'use strict'; +'require view'; 'require form'; 'require tools.widgets as widgets'; -return L.view.extend({ +return view.extend({ render: function () { var m, s, o; diff --git a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js index b7a52d1d1..952f83676 100644 --- a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js +++ b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require fs'; 'require ui'; 'require rpc'; @@ -995,7 +996,7 @@ function handleKeyUp(ev) { }, 250); } -return L.view.extend({ +return view.extend({ load: function() { return downloadLists(); }, diff --git a/applications/luci-app-pagekitec/htdocs/luci-static/resources/view/pagekitec.js b/applications/luci-app-pagekitec/htdocs/luci-static/resources/view/pagekitec.js index 13161de7a..9289bf326 100644 --- a/applications/luci-app-pagekitec/htdocs/luci-static/resources/view/pagekitec.js +++ b/applications/luci-app-pagekitec/htdocs/luci-static/resources/view/pagekitec.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require form'; var desc = _("" @@ -9,7 +10,7 @@ var desc = _("" + "some very very basic uses of pagekite." ); -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-samba4/htdocs/luci-static/resources/view/samba4.js b/applications/luci-app-samba4/htdocs/luci-static/resources/view/samba4.js index 48779c91c..7b6430b96 100644 --- a/applications/luci-app-samba4/htdocs/luci-static/resources/view/samba4.js +++ b/applications/luci-app-samba4/htdocs/luci-static/resources/view/samba4.js @@ -1,9 +1,10 @@ 'use strict'; +'require view'; 'require fs'; 'require form'; 'require tools.widgets as widgets'; -return L.view.extend({ +return view.extend({ load: function() { return Promise.all([ L.resolveDefault(fs.stat('/sbin/block'), null), diff --git a/applications/luci-app-ser2net/htdocs/luci-static/resources/view/ser2net/leds.js b/applications/luci-app-ser2net/htdocs/luci-static/resources/view/ser2net/leds.js index 1f85396f1..d1342cd7b 100644 --- a/applications/luci-app-ser2net/htdocs/luci-static/resources/view/ser2net/leds.js +++ b/applications/luci-app-ser2net/htdocs/luci-static/resources/view/ser2net/leds.js @@ -1,7 +1,8 @@ 'use strict'; +'require view'; 'require form'; -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-ser2net/htdocs/luci-static/resources/view/ser2net/proxies.js b/applications/luci-app-ser2net/htdocs/luci-static/resources/view/ser2net/proxies.js index 105f591c4..9e1c3c8f7 100644 --- a/applications/luci-app-ser2net/htdocs/luci-static/resources/view/ser2net/proxies.js +++ b/applications/luci-app-ser2net/htdocs/luci-static/resources/view/ser2net/proxies.js @@ -1,7 +1,8 @@ 'use strict'; +'require view'; 'require form'; -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-ser2net/htdocs/luci-static/resources/view/ser2net/settings.js b/applications/luci-app-ser2net/htdocs/luci-static/resources/view/ser2net/settings.js index 68a113fb4..a93cc55e4 100644 --- a/applications/luci-app-ser2net/htdocs/luci-static/resources/view/ser2net/settings.js +++ b/applications/luci-app-ser2net/htdocs/luci-static/resources/view/ser2net/settings.js @@ -1,7 +1,8 @@ 'use strict'; +'require view'; 'require form'; -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/shadowsocks-libev.js b/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/shadowsocks-libev.js index 3d111d579..ef93a1c75 100644 --- a/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/shadowsocks-libev.js +++ b/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/shadowsocks-libev.js @@ -1,4 +1,5 @@ 'use strict'; +'require baseclass'; 'require uci'; 'require form'; 'require network'; @@ -67,7 +68,7 @@ function ucival_to_bool(val) { return val === 'true' || val === '1' || val === 'yes' || val === 'on'; } -return L.Class.extend({ +return baseclass.extend({ values_actions: function(o) { o.value('bypass'); o.value('forward'); diff --git a/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/instances.js b/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/instances.js index 27a2b950c..9a591d596 100644 --- a/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/instances.js +++ b/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/instances.js @@ -1,4 +1,6 @@ 'use strict'; +'require view'; +'require poll'; 'require form'; 'require uci'; 'require fs'; @@ -16,7 +18,7 @@ var callServiceList = rpc.declare({ expect: { '': {} } }); -return L.view.extend({ +return view.extend({ render: function(stats) { var m, s, o; @@ -137,7 +139,7 @@ return L.view.extend({ } return m.render().finally(function() { - L.Poll.add(function() { + poll.add(function() { return L.resolveDefault(callServiceList(conf), {}) .then(function(res) { var instances = null; diff --git a/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/rules.js b/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/rules.js index 798237adb..4cb653e57 100644 --- a/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/rules.js +++ b/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/rules.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require uci'; 'require fs'; 'require form'; @@ -12,7 +13,7 @@ function src_dst_option(s /*, ... */) { o.datatype = 'or(ipaddr,cidr)'; } -return L.view.extend({ +return view.extend({ load: function() { return Promise.all([ L.resolveDefault(fs.stat('/usr/lib/iptables/libxt_recent.so'), {}), diff --git a/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/servers.js b/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/servers.js index 5951e92e5..57756b83e 100644 --- a/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/servers.js +++ b/applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/servers.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require form'; 'require uci'; 'require ui'; @@ -6,7 +7,7 @@ var conf = 'shadowsocks-libev'; -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js index 00b65d5b6..092dd4552 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js @@ -1,4 +1,5 @@ 'use strict'; +'require baseclass'; 'require fs'; 'require uci'; 'require tools.prng as random'; @@ -133,7 +134,7 @@ var colors = L.Class.singleton({ var rrdtree = {}, graphdefs = {}; -return L.Class.extend({ +return baseclass.extend({ __init__: function() { this.opts = {}; }, diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js index 50de3a6b0..c03e38cf5 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('APC UPS'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/conntrack.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/conntrack.js index c61d4f291..9c54f5c91 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/conntrack.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/conntrack.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Conntrack'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/contextswitch.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/contextswitch.js index fc4c80a93..8dc3cc75f 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/contextswitch.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/contextswitch.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Context Switches'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js index 4e130704a..464b28e8e 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js @@ -1,9 +1,10 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; 'require uci'; -return L.Class.extend({ +return baseclass.extend({ title: _('Processor'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js index 6f4d52deb..308d58dac 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js @@ -1,9 +1,10 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; 'require uci'; -return L.Class.extend({ +return baseclass.extend({ title: _('CPU Frequency'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/curl.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/curl.js index af78dd0b9..718aa7bbb 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/curl.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/curl.js @@ -4,8 +4,9 @@ */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('cUrl'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/df.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/df.js index 240d1da61..34fbb9b5c 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/df.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/df.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Disk Space Usage'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/disk.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/disk.js index 52542a1f8..12ed9568f 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/disk.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/disk.js @@ -4,8 +4,9 @@ */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Disk Usage'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dns.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dns.js index 9e71bb42c..029471f80 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dns.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dns.js @@ -4,8 +4,9 @@ */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('DNS'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/entropy.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/entropy.js index 574724c42..b4f6f0594 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/entropy.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/entropy.js @@ -4,8 +4,9 @@ */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Entropy'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/interface.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/interface.js index 04b1b8d1e..ccf184924 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/interface.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/interface.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Interfaces'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ip6tables.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ip6tables.js index 1b9755cce..c956c1988 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ip6tables.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ip6tables.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Firewall (IPv6)'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/iptables.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/iptables.js index a115c044b..69a3a87eb 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/iptables.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/iptables.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Firewall'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/irq.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/irq.js index 158fbce9e..29675f77c 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/irq.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/irq.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Interrupts'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/iwinfo.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/iwinfo.js index 9eeb1d001..638242f10 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/iwinfo.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/iwinfo.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Wireless'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/load.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/load.js index 8b1e6c284..a10469110 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/load.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/load.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('System Load'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js index 4c52fc781..9b0d179b0 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js @@ -4,8 +4,9 @@ */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Memory'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/netlink.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/netlink.js index f7d55a89d..3bf3756b0 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/netlink.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/netlink.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Netlink'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/nut.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/nut.js index a9cb770c7..5d7a92f7f 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/nut.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/nut.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('UPS'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/olsrd.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/olsrd.js index 4ccc417da..b311efba3 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/olsrd.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/olsrd.js @@ -4,8 +4,9 @@ */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('OLSRd'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/openvpn.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/openvpn.js index 08951018f..f78e2a491 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/openvpn.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/openvpn.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('OpenVPN'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ping.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ping.js index 063db2189..27624828c 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ping.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ping.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Ping'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/processes.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/processes.js index c11770970..9087b8e33 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/processes.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/processes.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Processes'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js index 72806df88..b3361e1bf 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Sensors'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/splash_leases.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/splash_leases.js index 64741f16e..33df893f8 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/splash_leases.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/splash_leases.js @@ -4,8 +4,9 @@ */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Splash Leases'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/tcpconns.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/tcpconns.js index 4ecd532fa..626e2c64b 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/tcpconns.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/tcpconns.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('TCP Connections'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/thermal.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/thermal.js index 6ff303de9..a94c83bdf 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/thermal.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/thermal.js @@ -1,8 +1,9 @@ /* Licensed to the public under the Apache License 2.0. */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Thermal'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/uptime.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/uptime.js index c764897b5..2b6ea226a 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/uptime.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/uptime.js @@ -9,8 +9,9 @@ You may obtain a copy of the License at */ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ title: _('Uptime'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/collectd.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/collectd.js index d92693525..282b867c4 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/collectd.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/collectd.js @@ -1,10 +1,12 @@ 'use strict'; +'require view'; +'require dom'; 'require fs'; 'require ui'; 'require uci'; 'require form'; -return L.view.extend({ +return view.extend({ load: function() { return Promise.all([ fs.list('/usr/lib/collectd'), @@ -172,7 +174,7 @@ return L.view.extend({ var trEl = this.super('renderRowActions', [ section_id, _('Configure…') ]); if (!plugin || !plugin.form.addFormOptions) - L.dom.content(trEl, null); + dom.content(trEl, null); return trEl; }; diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js index f1e69b89c..838af8c66 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js @@ -1,4 +1,7 @@ 'use strict'; +'require view'; +'require dom'; +'require poll'; 'require ui'; 'require uci'; 'require statistics.rrdtool as rrdtool'; @@ -7,7 +10,7 @@ var pollFn = null, activePlugin = null, activeInstance = null; -return L.view.extend({ +return view.extend({ load: function() { return rrdtool.load(); }, @@ -22,7 +25,7 @@ return L.view.extend({ activePlugin = plugin; - L.dom.content(container, [ + dom.content(container, [ E('p', {}, [ E('em', { 'class': 'spinning' }, [ _('Loading data…') ]) ]) @@ -52,7 +55,7 @@ return L.view.extend({ })).then(function(blobs) { var multiple = blobs.length > 1; - L.dom.content(container, E('div', {}, blobs.map(function(blobs, i) { + dom.content(container, E('div', {}, blobs.map(function(blobs, i) { var plugin_instance = i ? plugin_instances[i-1] : plugin_instances.join('|'), title = '%s: %s'.format(rrdtool.pluginTitle(plugin), i ? plugin_instance : _('Overview')); @@ -85,7 +88,7 @@ return L.view.extend({ URL.revokeObjectURL(img.src); }); - L.dom.content(container, null); + dom.content(container, null); if (container.hasAttribute('data-initialized')) { container.removeAttribute('data-initialized'); @@ -147,13 +150,13 @@ return L.view.extend({ var btn = ev.currentTarget; if (pollFn) { - L.Poll.remove(pollFn); + poll.remove(pollFn); pollFn = null; } if (time.value != '0') { pollFn = L.bind(this.refreshGraphs, this, host, span, time, container); - L.Poll.add(pollFn, +time.value); + poll.add(pollFn, +time.value); } }, diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/apcups.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/apcups.js index b4f170c8a..89b861a84 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/apcups.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/apcups.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('APCUPS Plugin Configuration'), description: _('The APCUPS plugin collects statistics about the APC UPS.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/conntrack.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/conntrack.js index 23f14e846..ac859c855 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/conntrack.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/conntrack.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('Conntrack Plugin Configuration'), description: _('The conntrack plugin collects statistics about the number of tracked connections.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/contextswitch.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/contextswitch.js index f4e30fe35..d978a556c 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/contextswitch.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/contextswitch.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('CPU Context Switches Plugin Configuration'), description: _('This plugin collects statistics about the processor context switches.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/cpu.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/cpu.js index 3a27a67df..7b2963cad 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/cpu.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/cpu.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('CPU Plugin Configuration'), description: _('The cpu plugin collects basic statistics about the processor usage.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/cpufreq.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/cpufreq.js index 64c260877..636ac8f7c 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/cpufreq.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/cpufreq.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('CPU Frequency Plugin Configuration'), description: _('This plugin collects statistics about the processor frequency scaling.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/csv.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/csv.js index 244a07be2..87d8c9f6b 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/csv.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/csv.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('CSV Plugin Configuration'), description: _('The csv plugin stores collected data in csv file format for further processing by external programs.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/curl.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/curl.js index c49c475c6..60a167c24 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/curl.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/curl.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('cUrl Plugin Configuration'), addFormOptions: function(s) { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/df.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/df.js index 7b063869b..9e3dc5630 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/df.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/df.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require fs'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('DF Plugin Configuration'), description: _('The df plugin collects statistics about the disk space usage on different devices, mount points or filesystem types.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/disk.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/disk.js index c737a7dbe..c36df1025 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/disk.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/disk.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require fs'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('Disk Plugin Configuration'), description: _('The disk plugin collects detailed usage statistics for selected partitions or whole disks.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/dns.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/dns.js index 27b08cf39..8ff705298 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/dns.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/dns.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require form'; 'require tools.widgets as widgets'; -return L.Class.extend({ +return baseclass.extend({ title: _('DNS Plugin Configuration'), description: _('The dns plugin collects detailed statistics about dns related traffic on selected interfaces.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/email.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/email.js index 5306dd4ce..51f8284e4 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/email.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/email.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require form'; 'require tools.widgets as widgets'; -return L.Class.extend({ +return baseclass.extend({ title: _('E-Mail Plugin Configuration'), description: _('The email plugin creates a unix socket which can be used to transmit email-statistics to a running collectd daemon. This plugin is primarily intended to be used in conjunction with Mail::SpamAssasin::Plugin::Collectd but can be used in other ways as well.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/entropy.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/entropy.js index cf15d98a3..ffe679194 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/entropy.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/entropy.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('Entropy Plugin Configuration'), description: _('The entropy plugin collects statistics about the available entropy.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/exec.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/exec.js index ff1a5a0ad..d19714427 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/exec.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/exec.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require form'; 'require tools.widgets as widgets'; -return L.Class.extend({ +return baseclass.extend({ title: _('Exec Plugin Configuration'), description: _('The exec plugin starts external commands to read values from or to notify external processes when certain threshold values have been reached.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/interface.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/interface.js index 1d60d644f..cb4d680b2 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/interface.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/interface.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require form'; 'require tools.widgets as widgets'; -return L.Class.extend({ +return baseclass.extend({ title: _('Interface Plugin Configuration'), description: _('The interface plugin collects traffic statistics on selected interfaces.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/iptables.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/iptables.js index 34b75f928..6dcaf26de 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/iptables.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/iptables.js @@ -1,9 +1,10 @@ 'use strict'; +'require baseclass'; 'require fs'; 'require uci'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('Iptables Plugin Configuration'), description: _('The iptables plugin will monitor selected firewall rules and collect information about processed bytes and packets per rule.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/irq.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/irq.js index 0061c4dfd..4271a8f81 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/irq.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/irq.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require fs'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('IRQ Plugin Configuration'), description: _('The irq plugin will monitor the rate of issues per second for each selected interrupt. If no interrupt is selected then all interrupts are monitored.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/iwinfo.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/iwinfo.js index 3f9987236..868c1f303 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/iwinfo.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/iwinfo.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require form'; 'require tools.widgets as widgets'; -return L.Class.extend({ +return baseclass.extend({ title: _('Wireless iwinfo Plugin Configuration'), description: _('The iwinfo plugin collects statistics about wireless signal strength, noise and quality.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/load.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/load.js index be6aba44c..25755637c 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/load.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/load.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('Load Plugin Configuration'), description: _('The load plugin collects statistics about the general system load.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js index fdd55f0cf..a4a8eb276 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('Memory Plugin Configuration'), description: _('The memory plugin collects statistics about the memory usage.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/netlink.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/netlink.js index 3797b690a..891020692 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/netlink.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/netlink.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require form'; 'require tools.widgets as widgets'; -return L.Class.extend({ +return baseclass.extend({ title: _('Netlink Plugin Configuration'), description: _('The netlink plugin collects extended information like qdisc-, class- and filter-statistics for selected interfaces.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/network.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/network.js index 5419e6d34..2429b8ac7 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/network.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/network.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('Network Plugin Configuration'), description: _('The network plugin provides network based communication between different collectd instances. Collectd can operate both in client and server mode. In client mode locally collected data is transferred to a collectd server instance, in server mode the local instance receives data from other hosts.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/nut.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/nut.js index 7148ed112..ca20e1172 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/nut.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/nut.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('UPS Plugin Configuration'), description: _('The NUT plugin reads information about Uninterruptible Power Supplies.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/olsrd.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/olsrd.js index 973c0858f..4e6eca234 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/olsrd.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/olsrd.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('OLSRd Plugin Configuration'), description: _('The OLSRd plugin reads information about meshed networks from the txtinfo plugin of OLSRd.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/openvpn.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/openvpn.js index b0704fc72..b48ed93a3 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/openvpn.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/openvpn.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require fs'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('OpenVPN Plugin Configuration'), description: _('The OpenVPN plugin gathers information about the current vpn connection status.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/ping.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/ping.js index 07f0f5094..33ef8e2b4 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/ping.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/ping.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('Ping Plugin Configuration'), description: _('The ping plugin will send icmp echo replies to selected hosts and measure the roundtrip time for each host.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/processes.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/processes.js index e2331998a..d29ac8763 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/processes.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/processes.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('Processes Plugin Configuration'), description: _('The processes plugin collects information like cpu time, page faults and memory usage of selected processes.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/rrdtool.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/rrdtool.js index 6e0b8e6a2..4d0520471 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/rrdtool.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/rrdtool.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('RRDTool Plugin Configuration'), description: _('The rrdtool plugin stores the collected data in rrd database files, the foundation of the diagrams.

Warning: Setting the wrong values will result in a very high memory consumption in the temporary directory. This can render the device unusable!'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js index cda59a2a9..8424966d2 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js @@ -1,4 +1,5 @@ 'use strict'; +'require baseclass'; 'require fs'; 'require form'; @@ -10,7 +11,7 @@ var sensorTypes = [ /^(?:power)[0-9]*$/, 'power' ]; -return L.Class.extend({ +return baseclass.extend({ title: _('Sensors Plugin Configuration'), description: _('The sensors plugin uses the Linux Sensors framework to gather environmental statistics.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/splash_leases.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/splash_leases.js index 9db738860..6ab519618 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/splash_leases.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/splash_leases.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('Splash Leases Plugin Configuration'), description: _('The splash leases plugin uses libuci to collect statistics about splash leases.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/tcpconns.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/tcpconns.js index 916241879..3bab72776 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/tcpconns.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/tcpconns.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('TCPConns Plugin Configuration'), description: _('The tcpconns plugin collects information about open tcp connections on selected ports.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/thermal.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/thermal.js index c2def4609..650e54747 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/thermal.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/thermal.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require fs'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('Thermal Plugin Configuration'), description: _('The thermal plugin will monitor temperature of the system. Data is typically read from /sys/class/thermal/*/temp ( \'*\' denotes the thermal device to be read, e.g. thermal_zone1 )'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/unixsock.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/unixsock.js index c2f33a0a1..996cfda45 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/unixsock.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/unixsock.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require form'; 'require tools.widgets as widgets'; -return L.Class.extend({ +return baseclass.extend({ title: _('Unixsock Plugin Configuration'), description: _('The unixsock plugin creates a unix socket which can be used to read collected data from a running collectd instance.'), diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/uptime.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/uptime.js index c31cfd2e9..2c42708ef 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/uptime.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/uptime.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ title: _('Uptime Plugin Configuration'), description: _('The uptime plugin collects statistics about the uptime of the system.'), diff --git a/applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js b/applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js index dfbd9af6c..aecb4ecaa 100644 --- a/applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js +++ b/applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require fs'; 'require uci'; 'require rpc'; @@ -17,7 +18,7 @@ function setFlagBool(o) { o.disabled = 'false'; } -return L.view.extend({ +return view.extend({ load: function() { return Promise.all([ L.resolveDefault(callServiceList('transmission')), diff --git a/applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/config.js b/applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/config.js index e92880d53..9934ecebd 100644 --- a/applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/config.js +++ b/applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/config.js @@ -1,8 +1,9 @@ 'use strict'; +'require view'; 'require form'; 'require tools.widgets as widgets'; -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/term.js b/applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/term.js index 4725f7a5b..26756a369 100644 --- a/applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/term.js +++ b/applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/term.js @@ -1,7 +1,8 @@ 'use strict'; +'require view'; 'require uci'; -return L.view.extend({ +return view.extend({ load: function() { return uci.load('ttyd'); }, diff --git a/applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js b/applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js index b1a2531c8..608929c70 100644 --- a/applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js +++ b/applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js @@ -1,4 +1,6 @@ 'use strict'; +'require baseclass'; +'require dom'; 'require rpc'; 'require uci'; @@ -18,14 +20,14 @@ callUpnpDeleteRule = rpc.declare({ }); handleDelRule = function(num, 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(); callUpnpDeleteRule(num); }; -return L.Class.extend({ +return baseclass.extend({ title: _('Active UPnP Redirects'), load: function() { diff --git a/applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js b/applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js index cfd1e3508..095078a4e 100644 --- a/applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js +++ b/applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js @@ -1,4 +1,7 @@ 'use strict'; +'require view'; +'require dom'; +'require poll'; 'require uci'; 'require rpc'; 'require form'; @@ -26,14 +29,14 @@ callUpnpDeleteRule = rpc.declare({ }); handleDelRule = function(num, 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(); callUpnpDeleteRule(num); }; -return L.view.extend({ +return view.extend({ load: function() { return Promise.all([ callUpnpGetStatus(), @@ -190,7 +193,7 @@ return L.view.extend({ o.value('deny') return m.render().then(L.bind(function(m, nodes) { - L.Poll.add(L.bind(function() { + poll.add(L.bind(function() { return Promise.all([ callUpnpGetStatus() ]).then(L.bind(this.poll_status, this, nodes)); diff --git a/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js b/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js index 0b0123979..14e968a07 100644 --- a/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js +++ b/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js @@ -1,13 +1,14 @@ // This is free software, licensed under the Apache License, Version 2.0 'use strict'; +'require view'; 'require fs'; 'require ui'; 'require uci'; 'require form'; 'require tools.widgets as widgets'; -return L.view.extend({ +return view.extend({ handleDeleteModal: function(m, iface, ev) { L.showModal(_('Delete interface %h').format(iface), [ E('p', _('The interface will be removed from the database permanently. This cannot be undone.')), diff --git a/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/graphs.js b/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/graphs.js index 770884655..fbe9d5933 100644 --- a/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/graphs.js +++ b/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/graphs.js @@ -1,10 +1,11 @@ // This is free software, licensed under the Apache License, Version 2.0 'use strict'; +'require view'; 'require fs'; 'require ui'; -return L.view.extend({ +return view.extend({ renderTab: function(ifaces, style, title) { var tab = E('div', { 'class': 'cbi-section', diff --git a/applications/luci-app-wol/htdocs/luci-static/resources/view/wol.js b/applications/luci-app-wol/htdocs/luci-static/resources/view/wol.js index cafed753c..f3b363d60 100644 --- a/applications/luci-app-wol/htdocs/luci-static/resources/view/wol.js +++ b/applications/luci-app-wol/htdocs/luci-static/resources/view/wol.js @@ -1,4 +1,6 @@ 'use strict'; +'require view'; +'require dom'; 'require uci'; 'require fs'; 'require ui'; @@ -6,7 +8,7 @@ 'require form'; 'require tools.widgets as widgets'; -return L.view.extend({ +return view.extend({ formdata: { wol: {} }, callHostHints: rpc.declare({ @@ -82,7 +84,7 @@ return L.view.extend({ var map = document.querySelector('#maincontent .cbi-map'), data = this.formdata; - return L.dom.callClassMethod(map, 'save').then(function() { + return dom.callClassMethod(map, 'save').then(function() { if (!data.wol.mac) return alert(_('No target host specified!')); diff --git a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/keys.js b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/keys.js index 8bc79321f..44acaa22d 100644 --- a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/keys.js +++ b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/keys.js @@ -1,7 +1,8 @@ 'use strict'; +'require view'; 'require form'; -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/peers.js b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/peers.js index 62336a270..7d392901c 100644 --- a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/peers.js +++ b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/peers.js @@ -1,7 +1,8 @@ 'use strict'; +'require view'; 'require form'; -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/session_firewall.js b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/session_firewall.js index 4a91d5e02..45fe2207b 100644 --- a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/session_firewall.js +++ b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/session_firewall.js @@ -1,7 +1,8 @@ 'use strict'; +'require view'; 'require form'; -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/settings.js b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/settings.js index 52d79a47e..4278386f5 100644 --- a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/settings.js +++ b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/settings.js @@ -1,7 +1,8 @@ 'use strict'; +'require view'; 'require form'; -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/status.js b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/status.js index 3fb6c1f7f..35078a511 100644 --- a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/status.js +++ b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/status.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require fs'; 'require form'; @@ -65,7 +66,7 @@ function update_active_peers() { }); } -return L.view.extend({ +return view.extend({ load: function() { return Promise.all([ L.resolveDefault(fs.stat("/usr/sbin/yggdrasilctl"), null), diff --git a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/tunnel_routing.js b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/tunnel_routing.js index 77cfbc2dc..0b4ac6e51 100644 --- a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/tunnel_routing.js +++ b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/tunnel_routing.js @@ -1,7 +1,8 @@ 'use strict'; +'require view'; 'require form'; -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js index 81ea32d48..525526d62 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js @@ -1,4 +1,7 @@ 'use strict'; +'require view'; +'require dom'; +'require poll'; 'require rpc'; 'require uci'; 'require form'; @@ -123,7 +126,7 @@ function validateServerSpec(sid, s) { return true; } -return L.view.extend({ +return view.extend({ load: function() { return Promise.all([ callHostHints(), @@ -440,7 +443,7 @@ return L.view.extend({ var node = ipopt.map.findElement('id', ipopt.cbid(section_id)); if (node) - L.dom.callClassMethod(node, 'setValue', hosts[mac].ipv4); + dom.callClassMethod(node, 'setValue', hosts[mac].ipv4); }, this, ipopt, section_id)); return node; @@ -487,7 +490,7 @@ return L.view.extend({ o = s.taboption('leases', CBILease6Status, '__status6__'); return m.render().then(function(mapEl) { - L.Poll.add(function() { + poll.add(function() { return callDHCPLeases().then(function(leaseinfo) { var leases = Array.isArray(leaseinfo.dhcp_leases) ? leaseinfo.dhcp_leases : [], leases6 = Array.isArray(leaseinfo.dhcp6_leases) ? leaseinfo.dhcp6_leases : []; diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js index 24ab84ab9..a94cc6673 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js @@ -1,9 +1,11 @@ 'use strict'; +'require view'; +'require dom'; 'require fs'; 'require ui'; 'require uci'; -return L.view.extend({ +return view.extend({ handleCommand: function(exec, args) { var buttons = document.querySelectorAll('.diag-action > .cbi-button'); @@ -14,7 +16,7 @@ return L.view.extend({ var out = document.querySelector('.command-output'); out.style.display = ''; - L.dom.content(out, [ res.stdout || '', res.stderr || '' ]); + dom.content(out, [ res.stdout || '', res.stderr || '' ]); }).catch(function(err) { ui.addNotification(null, E('p', [ err ])) }).finally(function() { diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/hosts.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/hosts.js index 975ac2fec..cd0dacbf6 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/hosts.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/hosts.js @@ -1,8 +1,9 @@ 'use strict'; +'require view'; 'require rpc'; 'require form'; -return L.view.extend({ +return view.extend({ callHostHints: rpc.declare({ object: 'luci-rpc', method: 'getHostHints', diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js index 0e6e5a2e2..fb3969e9d 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js @@ -1,4 +1,7 @@ 'use strict'; +'require view'; +'require dom'; +'require poll'; 'require fs'; 'require ui'; 'require uci'; @@ -109,7 +112,7 @@ function render_status(node, ifc, with_device) { function render_modal_status(node, ifc) { var dev = ifc ? (ifc.getDevice() || ifc.getL3Device() || ifc.getL3Device()) : null; - L.dom.content(node, [ + dom.content(node, [ E('img', { 'src': L.resource('icons/%s%s.png').format(dev ? dev.getType() : 'ethernet', (dev && dev.isUp()) ? '' : '_disabled'), 'title': dev ? dev.getTypeI18n() : _('Not present') @@ -140,7 +143,7 @@ function render_ifacebox_status(node, ifc) { c.push(E('small', {}, ifc.isAlias() ? _('Alias of "%s"').format(ifc.isAlias()) : (dev ? dev.getName() : E('em', _('Not present'))))); - L.dom.content(node, c); + dom.content(node, c); return firewall.getZoneByNetwork(ifc.getName()).then(L.bind(function(zone) { this.style.backgroundColor = zone ? zone.getColor() : '#EEEEEE'; @@ -185,7 +188,7 @@ function iface_updown(up, id, ev, force) { 'class': 'cbi-button cbi-button-negative important', 'click': function(ev) { dsc.setAttribute('disconnect', ''); - L.dom.content(dsc, E('em', _('Interface is shutting down...'))); + dom.content(dsc, E('em', _('Interface is shutting down...'))); ui.hideModal(); } @@ -195,13 +198,13 @@ function iface_updown(up, id, ev, force) { } else { dsc.setAttribute('disconnect', ''); - L.dom.content(dsc, E('em', _('Interface is shutting down...'))); + dom.content(dsc, E('em', _('Interface is shutting down...'))); } }); } else { dsc.setAttribute(up ? 'reconnect' : 'disconnect', force ? 'force' : ''); - L.dom.content(dsc, E('em', up ? _('Interface is reconnecting...') : _('Interface is shutting down...'))); + dom.content(dsc, E('em', up ? _('Interface is reconnecting...') : _('Interface is shutting down...'))); } } @@ -224,7 +227,7 @@ function get_netmask(s, use_cfgvalue) { return mask; } -return L.view.extend({ +return view.extend({ poll_status: function(map, networks) { var resolveZone = null; @@ -245,10 +248,10 @@ return L.view.extend({ dynamic = ifc ? ifc.isDynamic() : false; if (dsc.hasAttribute('reconnect')) { - L.dom.content(dsc, E('em', _('Interface is starting...'))); + dom.content(dsc, E('em', _('Interface is starting...'))); } else if (dsc.hasAttribute('disconnect')) { - L.dom.content(dsc, E('em', _('Interface is stopping...'))); + dom.content(dsc, E('em', _('Interface is stopping...'))); } else if (ifc.getProtocol() || uci.get('network', ifc.getName()) == null) { render_status(dsc, ifc, false); @@ -258,18 +261,18 @@ return L.view.extend({ if (e) e.disabled = true; var link = L.url('admin/system/opkg') + '?query=luci-proto'; - L.dom.content(dsc, [ + dom.content(dsc, [ E('em', _('Unsupported protocol type.')), E('br'), E('a', { href: link }, _('Install protocol extensions...')) ]); } else { - L.dom.content(dsc, E('em', _('Interface not present or not connected yet.'))); + dom.content(dsc, E('em', _('Interface not present or not connected yet.'))); } if (stat) { var dev = ifc.getDevice(); - L.dom.content(stat, [ + dom.content(stat, [ E('img', { 'src': L.resource('icons/%s%s.png').format(dev ? dev.getType() : 'ethernet', (dev && dev.isUp()) ? '' : '_disabled'), 'title': dev ? dev.getTypeI18n() : _('Not present') @@ -336,7 +339,7 @@ return L.view.extend({ disabled = net ? !net.isUp() : true, dynamic = net ? net.isDynamic() : false; - L.dom.content(tdEl.lastChild, [ + dom.content(tdEl.lastChild, [ E('button', { 'class': 'cbi-button cbi-button-neutral reconnect', 'click': iface_updown.bind(this, true, section_id), @@ -979,7 +982,7 @@ return L.view.extend({ return m.render().then(L.bind(function(m, nodes) { - L.Poll.add(L.bind(function() { + poll.add(L.bind(function() { var section_ids = m.children[0].cfgsections(), tasks = []; diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/routes.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/routes.js index 4a002c252..58a151de0 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/routes.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/routes.js @@ -1,9 +1,10 @@ 'use strict'; +'require view'; 'require form'; 'require network'; 'require tools.widgets as widgets'; -return L.view.extend({ +return view.extend({ load: function() { return network.getDevices(); }, diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js index 63427f147..3133d2725 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js @@ -1,4 +1,7 @@ 'use strict'; +'require view'; +'require dom'; +'require poll'; 'require ui'; 'require rpc'; 'require uci'; @@ -67,13 +70,13 @@ function render_port_status(node, portstate) { return null; if (!portstate || !portstate.link) - L.dom.content(node, [ + dom.content(node, [ E('img', { src: L.resource('icons/port_down.png') }), E('br'), _('no link') ]); else - L.dom.content(node, [ + dom.content(node, [ E('img', { src: L.resource('icons/port_up.png') }), E('br'), '%d'.format(portstate.speed) + _('baseT'), @@ -112,7 +115,7 @@ var callSwconfigPortState = rpc.declare({ expect: { result: [] } }); -return L.view.extend({ +return view.extend({ load: function() { return network.getSwitchTopologies().then(function(topologies) { var tasks = []; @@ -365,7 +368,7 @@ return L.view.extend({ }); } - L.Poll.add(L.bind(update_port_status, m, topologies)); + poll.add(L.bind(update_port_status, m, topologies)); return m.render(); } diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index 0bc15c26a..35ef2ba03 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -1,4 +1,7 @@ 'use strict'; +'require view'; +'require dom'; +'require poll'; 'require fs'; 'require ui'; 'require rpc'; @@ -167,7 +170,7 @@ function render_modal_status(node, radioNet) { if (node == null) node = E('span', { 'class': 'ifacebadge large', 'data-network': radioNet.getName() }, [ E('small'), E('span') ]); - L.dom.content(node.firstElementChild, render_signal_badge( + dom.content(node.firstElementChild, render_signal_badge( disabled ? -1 : radioNet.getSignalPercent(), radioNet.getSignal(), noise, true, radioNet.getMode())); @@ -185,7 +188,7 @@ function render_modal_status(node, radioNet) { ], [ ' | ', E('br'), E('br'), E('br'), E('br'), E('br'), ' | ', E('br'), ' | ' ]); if (!is_assoc) - L.dom.append(node.lastElementChild, E('em', disabled ? _('Wireless is disabled') : _('Wireless is not associated'))); + dom.append(node.lastElementChild, E('em', disabled ? _('Wireless is disabled') : _('Wireless is not associated'))); return node; } @@ -216,7 +219,7 @@ function radio_restart(id, ev) { btn.disabled = true; dsc.setAttribute('restart', ''); - L.dom.content(dsc, E('em', _('Device is restarting…'))); + dom.content(dsc, E('em', _('Device is restarting…'))); } function network_updown(id, map, ev) { @@ -432,7 +435,7 @@ var CBIWifiFrequencyValue = form.Value.extend({ renderWidget: function(section_id, option_index, cfgvalue) { var elem = E('div'); - L.dom.content(elem, [ + dom.content(elem, [ E('label', { 'style': 'float:left; margin-right:3px' }, [ _('Mode'), E('br'), E('select', { @@ -520,7 +523,7 @@ var CBIWifiTxPowerValue = form.ListValue.extend({ var widget = form.ListValue.prototype.renderWidget.apply(this, [section_id, option_index, cfgvalue]); widget.firstElementChild.style.width = 'auto'; - L.dom.append(widget, E('span', [ + dom.append(widget, E('span', [ ' - ', _('Current power'), ': ', E('span', [ this.powerval != null ? '%d dBm'.format(this.powerval) : E('em', _('unknown')) ]), this.poweroff ? ' + %d dB offset = %s dBm'.format(this.poweroff, this.powerval != null ? this.powerval + this.poweroff : '?') : '' @@ -564,7 +567,7 @@ var CBIWifiCountryValue = form.Value.extend({ } }); -return L.view.extend({ +return view.extend({ poll_status: function(map, data) { var rows = map.querySelectorAll('.cbi-section-table-row[data-sid]'); @@ -578,16 +581,16 @@ return L.view.extend({ busy = btns[0].classList.contains('spinning') || btns[1].classList.contains('spinning') || btns[2].classList.contains('spinning'); if (radioDev) { - L.dom.content(badge, render_radio_badge(radioDev)); - L.dom.content(stat, render_radio_status(radioDev, data[2].filter(function(n) { return n.getWifiDeviceName() == radioDev.getName() }))); + dom.content(badge, render_radio_badge(radioDev)); + dom.content(stat, render_radio_status(radioDev, data[2].filter(function(n) { return n.getWifiDeviceName() == radioDev.getName() }))); } else { - L.dom.content(badge, render_network_badge(radioNet)); - L.dom.content(stat, render_network_status(radioNet)); + dom.content(badge, render_network_badge(radioNet)); + dom.content(stat, render_network_status(radioNet)); } if (stat.hasAttribute('restart')) - L.dom.content(stat, E('em', _('Device is restarting…'))); + dom.content(stat, E('em', _('Device is restarting…'))); btns[0].disabled = busy; btns[1].disabled = busy; @@ -645,7 +648,7 @@ return L.view.extend({ row.push(E('button', { 'class': 'cbi-button cbi-button-remove', 'click': L.bind(function(net, 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(); @@ -1676,8 +1679,8 @@ return L.view.extend({ this.pollFn = L.bind(this.handleScanRefresh, this, radioDev, {}, table, stop); - L.Poll.add(this.pollFn); - L.Poll.start(); + poll.add(this.pollFn); + poll.start(); }; s.handleScanRefresh = function(radioDev, scanCache, table, stop) { @@ -1743,12 +1746,12 @@ return L.view.extend({ var btn = ev.currentTarget; if (btn.getAttribute('data-state') == 'stop') { - L.Poll.remove(this.pollFn); + poll.remove(this.pollFn); btn.firstChild.data = _('Start refresh'); btn.setAttribute('data-state', 'start'); } else { - L.Poll.add(this.pollFn); + poll.add(this.pollFn); btn.firstChild.data = _('Stop refresh'); btn.setAttribute('data-state', 'stop'); btn.classList.add('spinning'); @@ -1757,14 +1760,14 @@ return L.view.extend({ }; s.handleScanAbort = function(ev) { - var md = L.dom.parent(ev.target, 'div[aria-modal="true"]'); + var md = dom.parent(ev.target, 'div[aria-modal="true"]'); if (md) { md.style.maxWidth = ''; md.style.maxHeight = ''; } ui.hideModal(); - L.Poll.remove(this.pollFn); + poll.remove(this.pollFn); this.pollFn = null; }; @@ -1984,7 +1987,7 @@ return L.view.extend({ }; return m.render().then(L.bind(function(m, nodes) { - L.Poll.add(L.bind(function() { + poll.add(L.bind(function() { var section_ids = m.children[0].cfgsections(), tasks = [ network.getHostHints(), network.getWifiDevices() ]; 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); diff --git a/modules/luci-mod-status/luasrc/view/admin_status/index.htm b/modules/luci-mod-status/luasrc/view/admin_status/index.htm index 958212a01..8e00564da 100644 --- a/modules/luci-mod-status/luasrc/view/admin_status/index.htm +++ b/modules/luci-mod-status/luasrc/view/admin_status/index.htm @@ -70,7 +70,7 @@ function renderBadge(icon, title) { diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/crontab.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/crontab.js index bd1eb6e51..147b9830f 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/crontab.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/crontab.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('/etc/crontabs/root'), ''); }, diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/dropbear.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/dropbear.js index 7a8b1428d..6ee801abc 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/dropbear.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/dropbear.js @@ -1,8 +1,9 @@ 'use strict'; +'require view'; 'require form'; 'require tools.widgets as widgets'; -return L.view.extend({ +return view.extend({ render: function() { var m, s, o; diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js index b1cc4d1a6..b058091f9 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js @@ -1,4 +1,6 @@ 'use strict'; +'require view'; +'require dom'; 'require form'; 'require rpc'; 'require fs'; @@ -60,7 +62,7 @@ function findStorageSize(procmtd, procpart) { var mapdata = { actions: {}, config: {} }; -return L.view.extend({ +return view.extend({ load: function() { var tasks = [ L.resolveDefault(fs.stat('/lib/upgrade/platform.sh'), {}), @@ -166,7 +168,7 @@ return L.view.extend({ }, handleBlock: function(hostname, ev) { - var mtdblock = L.dom.parent(ev.target, '.cbi-section').querySelector('[data-name="mtdselect"] select').value; + var mtdblock = dom.parent(ev.target, '.cbi-section').querySelector('[data-name="mtdselect"] select').value; var form = E('form', { 'method': 'post', 'action': L.env.cgi_base + '/cgi-download', diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/default-on.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/default-on.js index 6ccc70ac2..12a230d8a 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/default-on.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/default-on.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ trigger: _('default-on (kernel)'), kernel: true, addFormOptions(s){ diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/heartbeat.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/heartbeat.js index 7495843ba..760b92df9 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/heartbeat.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/heartbeat.js @@ -1,6 +1,7 @@ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ trigger: _('heartbeat (kernel)'), kernel: true, addFormOptions(s){ diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/netdev.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/netdev.js index dad631b53..203af0601 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/netdev.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/netdev.js @@ -1,8 +1,9 @@ 'use strict'; +'require baseclass'; 'require form'; 'require tools.widgets as widgets'; -return L.Class.extend({ +return baseclass.extend({ trigger: _("netdev (kernel)"), kernel: true, addFormOptions(s){ diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/none.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/none.js index 31fed5545..03806d5d2 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/none.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/none.js @@ -1,6 +1,7 @@ 'use strict'; +'require baseclass'; -return L.Class.extend({ +return baseclass.extend({ trigger: _('none (kernel)'), kernel: true, addFormOptions(s){ diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/timer.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/timer.js index 23ddd6d90..68ebf1d20 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/timer.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/timer.js @@ -1,7 +1,8 @@ 'use strict'; +'require baseclass'; 'require form'; -return L.Class.extend({ +return baseclass.extend({ trigger: _('timer (kernel)'), kernel: true, addFormOptions(s){ diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/leds.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/leds.js index 849ead952..9fe1bff55 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/leds.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/leds.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require uci'; 'require rpc'; 'require form'; @@ -10,7 +11,7 @@ var callLeds = rpc.declare({ expect: { '': {} } }); -return L.view.extend({ +return view.extend({ load: function() { return Promise.all([ callLeds(), diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/mounts.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/mounts.js index ec5d44cad..7ee91f5ae 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/mounts.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/mounts.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require fs'; 'require ui'; 'require uci'; @@ -69,7 +70,7 @@ function device_textvalue(devices, section_id) { } } -return L.view.extend({ +return view.extend({ handleDetect: function(m, ev) { return callBlockDetect() .then(L.bind(uci.unload, uci, 'fstab')) diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/password.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/password.js index c3d317062..2b79633ca 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/password.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/password.js @@ -1,4 +1,6 @@ 'use strict'; +'require view'; +'require dom'; 'require ui'; 'require form'; 'require rpc'; @@ -17,7 +19,7 @@ var callSetPassword = rpc.declare({ expect: { result: false } }); -return L.view.extend({ +return view.extend({ checkPassword: function(section_id, value) { var strength = document.querySelector('.cbi-value-description'), strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g"), @@ -67,7 +69,7 @@ return L.view.extend({ handleSave: function() { var map = document.querySelector('.cbi-map'); - return L.dom.callClassMethod(map, 'save').then(function() { + return dom.callClassMethod(map, 'save').then(function() { if (formData.password.pw1 == null || formData.password.pw1.length == 0) return; @@ -85,7 +87,7 @@ return L.view.extend({ formData.password.pw1 = null; formData.password.pw2 = null; - L.dom.callClassMethod(map, 'render'); + dom.callClassMethod(map, 'render'); }); }); }, diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/reboot.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/reboot.js index 3ed87f413..3b9f450fc 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/reboot.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/reboot.js @@ -1,9 +1,10 @@ 'use strict'; +'require view'; 'require fs'; 'require ui'; 'require uci'; -return L.view.extend({ +return view.extend({ load: function() { return uci.changes(); }, diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js index ce3bac961..487621daa 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require fs'; 'require ui'; @@ -213,7 +214,7 @@ function handleWindowDragDropIgnore(ev) { ev.preventDefault() } -return L.view.extend({ +return view.extend({ load: function() { return fs.lines('/etc/dropbear/authorized_keys').then(function(lines) { return lines.filter(function(line) { diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js index 587f867aa..146a991df 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js @@ -1,9 +1,10 @@ 'use strict'; +'require view'; 'require rpc'; 'require fs'; 'require ui'; -return L.view.extend({ +return view.extend({ callInitList: rpc.declare({ object: 'luci', method: 'getInitList', diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js index 8fe6b5754..ee97bd82f 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js @@ -1,4 +1,6 @@ 'use strict'; +'require view'; +'require poll'; 'require ui'; 'require uci'; 'require rpc'; @@ -74,7 +76,7 @@ CBILocalTime = form.DummyValue.extend({ }, }); -return L.view.extend({ +return view.extend({ load: function() { return Promise.all([ callInitList('sysntpd'), @@ -277,7 +279,7 @@ return L.view.extend({ } return m.render().then(function(mapEl) { - L.Poll.add(function() { + poll.add(function() { return callGetLocaltime().then(function(t) { mapEl.querySelector('#localtime').value = new Date(t * 1000).toLocaleString(); }); -- 2.25.1