summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-11-03 21:54:40 +0100
committerJo-Philipp Wich <jo@mein.io>2019-11-03 21:55:50 +0100
commit86f492173d1daab8b75e4d4bd70ba06872ea70fa (patch)
tree3a64f76424681b0a0bb613c6966079a530ffd057 /modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js
parentb2a46e131b778ae14156676de8daf8231ab8e151 (diff)
treewide: require ui.js explicitly
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js')
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js19
1 files changed, 10 insertions, 9 deletions
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 07eede2f07..560282de77 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,6 +1,7 @@
'use strict';
'require rpc';
'require fs';
+'require ui';
return L.view.extend({
callInitList: rpc.declare({
@@ -30,7 +31,7 @@ return L.view.extend({
return true;
}).catch(function(e) {
- L.ui.addNotification(null, E('p', _('Failed to execute "/etc/init.d/%s %s" action: %s').format(name, action, e)));
+ ui.addNotification(null, E('p', _('Failed to execute "/etc/init.d/%s %s" action: %s').format(name, action, e)));
});
},
@@ -48,16 +49,16 @@ return L.view.extend({
return fs.write('/etc/rc.local', value).then(function() {
document.querySelector('textarea').value = value;
- L.ui.addNotification(null, E('p', _('Contents have been saved.')), 'info');
+ ui.addNotification(null, E('p', _('Contents have been saved.')), 'info');
}).catch(function(e) {
- L.ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
+ ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
});
},
renderEnableDisable: function(init) {
return E('button', {
class: 'btn cbi-button-%s'.format(init.enabled ? 'positive' : 'negative'),
- click: L.ui.createHandlerFn(this, 'handleEnableDisable', init.name, init.enabled)
+ click: ui.createHandlerFn(this, 'handleEnableDisable', init.name, init.enabled)
}, init.enabled ? _('Enabled') : _('Disabled'));
},
@@ -93,9 +94,9 @@ return L.view.extend({
'%02d'.format(list[i].index),
list[i].name,
this.renderEnableDisable(list[i]),
- E('button', { 'class': 'btn cbi-button-action', 'click': L.ui.createHandlerFn(this, 'handleAction', list[i].name, 'start') }, _('Start')),
- E('button', { 'class': 'btn cbi-button-action', 'click': L.ui.createHandlerFn(this, 'handleAction', list[i].name, 'restart') }, _('Restart')),
- E('button', { 'class': 'btn cbi-button-action', 'click': L.ui.createHandlerFn(this, 'handleAction', list[i].name, 'stop') }, _('Stop'))
+ E('button', { 'class': 'btn cbi-button-action', 'click': ui.createHandlerFn(this, 'handleAction', list[i].name, 'start') }, _('Start')),
+ E('button', { 'class': 'btn cbi-button-action', 'click': ui.createHandlerFn(this, 'handleAction', list[i].name, 'restart') }, _('Restart')),
+ E('button', { 'class': 'btn cbi-button-action', 'click': ui.createHandlerFn(this, 'handleAction', list[i].name, 'stop') }, _('Stop'))
]);
}
@@ -114,14 +115,14 @@ return L.view.extend({
E('div', { 'class': 'cbi-page-actions' }, [
E('button', {
'class': 'btn cbi-button-save',
- 'click': L.ui.createHandlerFn(this, 'handleRcLocalSave')
+ 'click': ui.createHandlerFn(this, 'handleRcLocalSave')
}, _('Save'))
])
])
])
]);
- L.ui.tabs.initTabGroup(view.lastElementChild.childNodes);
+ ui.tabs.initTabGroup(view.lastElementChild.childNodes);
return view;
},