3ed87f413fba700a9985078ba9e1050d01e16272
11 render: function(changes
) {
14 E('p', {}, _('Reboots the operating system of your device'))
17 for (var config
in (changes
|| {})) {
18 body
.appendChild(E('p', { 'class': 'alert-message warning' },
19 _('Warning: There are unsaved changes that will get lost on reboot!')));
23 body
.appendChild(E('hr'));
24 body
.appendChild(E('button', {
25 'class': 'cbi-button cbi-button-action important',
26 'click': ui
.createHandlerFn(this, 'handleReboot')
27 }, _('Perform reboot')));
32 handleReboot: function(ev
) {
33 return fs
.exec('/sbin/reboot').then(function(res
) {
35 L
.ui
.addNotification(null, E('p', _('The reboot command failed with code %d').format(res
.code
)));
36 L
.raise('Error', 'Reboot failed');
39 L
.ui
.showModal(_('Rebooting…'), [
40 E('p', { 'class': 'spinning' }, _('Waiting for device...'))
43 window
.setTimeout(function() {
44 L
.ui
.showModal(_('Rebooting…'), [
45 E('p', { 'class': 'spinning alert-message warning' },
46 _('Device unreachable! Still waiting for device...'))
50 L
.ui
.awaitReconnect();
52 .catch(function(e
) { L
.ui
.addNotification(null, E('p', e
.message
)) });
55 handleSaveApply
: null,