summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-system/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-04-03 10:00:06 +0200
committerJo-Philipp Wich <jo@mein.io>2020-04-03 10:00:06 +0200
commit3c4bc228a1f7b5731cf464f3f407c9ed9ace3cd2 (patch)
treed9ac0458c66dfa3c5d4922314df9d41499f578bc /modules/luci-mod-system/htdocs
parent1099aebdee29b8e5408688d0fd64d49e6ec4bd35 (diff)
treewide: import utility classes explicitly
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-system/htdocs')
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/crontab.js3
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/dropbear.js3
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js6
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/default-on.js3
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/heartbeat.js3
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/netdev.js3
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/none.js3
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/timer.js3
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/leds.js3
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/mounts.js3
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/password.js8
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/reboot.js3
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js3
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js3
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js6
15 files changed, 37 insertions, 19 deletions
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();
});