diff options
Diffstat (limited to 'modules/luci-mod-system')
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 bd1eb6e51a..147b9830f0 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 7a8b1428d5..6ee801abc2 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 b1cc4d1a6f..b058091f94 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 6ccc70ac27..12a230d8a3 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 7495843baa..760b92df99 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 dad631b533..203af06015 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 31fed55458..03806d5d24 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 23ddd6d906..68ebf1d206 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 849ead9528..9fe1bff55e 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 ec5d44cad0..7ee91f5aec 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 c3d317062f..2b79633cac 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 3ed87f413f..3b9f450fcd 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 ce3bac9612..487621daa3 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 587f867aa6..146a991dfc 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 8fe6b57545..ee97bd82f9 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(); }); |