From 3c4bc228a1f7b5731cf464f3f407c9ed9ace3cd2 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 3 Apr 2020 10:00:06 +0200 Subject: treewide: import utility classes explicitly Signed-off-by: Jo-Philipp Wich --- .../htdocs/luci-static/resources/shadowsocks-libev.js | 3 ++- .../luci-static/resources/view/shadowsocks-libev/instances.js | 6 ++++-- .../htdocs/luci-static/resources/view/shadowsocks-libev/rules.js | 3 ++- .../htdocs/luci-static/resources/view/shadowsocks-libev/servers.js | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) (limited to 'applications/luci-app-shadowsocks-libev/htdocs/luci-static/resources') 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 3d111d5791..ef93a1c754 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 27a2b950c2..9a591d5962 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 798237adbd..4cb653e57e 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 5951e92e51..57756b83e6 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; -- cgit v1.2.3