var isReadonlyView = !L.hasViewPermission() || null;
return view.extend({
- callInitList: rpc.declare({
- object: 'luci',
- method: 'getInitList',
+ callRcList: rpc.declare({
+ object: 'rc',
+ method: 'list',
expect: { '': {} }
}),
- callInitAction: rpc.declare({
- object: 'luci',
- method: 'setInitAction',
+ callRcInit: rpc.declare({
+ object: 'rc',
+ method: 'init',
params: [ 'name', 'action' ],
- expect: { result: false }
}),
load: function() {
return Promise.all([
L.resolveDefault(fs.read('/etc/rc.local'), ''),
- this.callInitList()
+ this.callRcList()
]);
},
handleAction: function(name, action, ev) {
- return this.callInitAction(name, action).then(function(success) {
- if (success != true)
+ return this.callRcInit(name, action).then(function(ret) {
+ if (ret)
throw _('Command failed');
return true;
]);
for (var init in initList)
- if (initList[init].index < 100)
+ if (initList[init].start < 100)
list.push(Object.assign({ name: init }, initList[init]));
list.sort(function(a, b) {
- if (a.index != b.index)
- return a.index - b.index
+ if (a.start != b.start)
+ return a.start - b.start
return a.name > b.name;
});
for (var i = 0; i < list.length; i++) {
rows.push([
- '%02d'.format(list[i].index),
+ '%02d'.format(list[i].start),
list[i].name,
E('div', [
this.renderEnableDisable(list[i]),
'require form';
'require tools.widgets as widgets';
-var callInitList, callInitAction, callTimezone,
+var callRcList, callRcInit, callTimezone,
callGetLocaltime, callSetLocaltime, CBILocalTime;
-callInitList = rpc.declare({
- object: 'luci',
- method: 'getInitList',
+callRcList = rpc.declare({
+ object: 'rc',
+ method: 'list',
params: [ 'name' ],
expect: { '': {} },
filter: function(res) {
}
});
-callInitAction = rpc.declare({
- object: 'luci',
- method: 'setInitAction',
+callRcInit = rpc.declare({
+ object: 'rc',
+ method: 'init',
params: [ 'name', 'action' ],
expect: { result: false }
});
this.ntpd_support ? E('button', {
'class': 'cbi-button cbi-button-apply',
'click': ui.createHandlerFn(this, function() {
- return callInitAction('sysntpd', 'restart');
+ return callRcInit('sysntpd', 'restart');
}),
'disabled': (this.readonly != null) ? this.readonly : this.map.readonly
}, _('Sync with NTP-Server')) : ''
return view.extend({
load: function() {
return Promise.all([
- callInitList('sysntpd'),
+ callRcList('sysntpd'),
callTimezone(),
callGetLocaltime(),
uci.load('luci'),
else
uci.unset('system', 'ntp', 'enabled');
- return callInitAction('sysntpd', 'enable');
+ return callRcInit('sysntpd', 'enable');
};
o.load = function(section_id) {
return (ntpd_enabled == 1 &&
"description": "Grant access to system configuration",
"read": {
"ubus": {
- "luci": [ "getInitList", "getLEDs", "getTimezones", "getUSBDevices" ],
+ "luci": [ "getLEDs", "getTimezones", "getUSBDevices" ],
+ "rc": [ "list" ],
"system": [ "info" ]
},
"uci": [ "luci", "system" ]
},
"write": {
"ubus": {
- "luci": [ "setInitAction", "setLocaltime", "setPassword" ]
+ "luci": [ "setLocaltime", "setPassword" ],
+ "rc": [ "init" ],
},
"uci": [ "luci", "system" ]
}
},
"ubus": {
"file": [ "read" ],
- "luci": [ "getInitList" ]
+ "rc": [ "list" ]
}
},
"write": {
},
"ubus": {
"file": [ "write" ],
- "luci": [ "setInitAction" ]
+ "rc": [ "init" ]
}
}
},