8 return L
.resolveDefault(fs
.read('/etc/crontabs/root'), '');
11 handleSave: function(ev
) {
12 var value
= (document
.querySelector('textarea').value
|| '').trim().replace(/\r\n/g, '\n') + '\n';
14 return fs
.write('/etc/crontabs/root', value
).then(function(rc
) {
15 document
.querySelector('textarea').value
= value
;
16 ui
.addNotification(null, E('p', _('Contents have been saved.')), 'info');
17 }).catch(function(e
) {
18 ui
.addNotification(null, E('p', _('Unable to save contents: %s').format(e
.message
)));
22 render: function(crontab
) {
24 E('h2', _('Scheduled Tasks')),
25 E('p', { 'class': 'cbi-section-descr' },
26 _('This is the system crontab in which scheduled tasks can be defined.') +
27 _('<br/>Note: you need to manually restart the cron service if the crontab file was empty before editing.')),
28 E('p', {}, E('textarea', { 'style': 'width:100%', 'rows': 10 }, [ crontab
!= null ? crontab
: '' ]))
32 handleSaveApply
: null,