7 var callReboot
= rpc
.declare({
18 render: function(changes
) {
21 E('p', {}, _('Reboots the operating system of your device'))
24 for (var config
in (changes
|| {})) {
25 body
.appendChild(E('p', { 'class': 'alert-message warning' },
26 _('Warning: There are unsaved changes that will get lost on reboot!')));
30 body
.appendChild(E('hr'));
31 body
.appendChild(E('button', {
32 'class': 'cbi-button cbi-button-action important',
33 'click': ui
.createHandlerFn(this, 'handleReboot')
34 }, _('Perform reboot')));
39 handleReboot: function(ev
) {
40 return callReboot().then(function(res
) {
42 L
.ui
.addNotification(null, E('p', _('The reboot command failed with code %d').format(res
)));
43 L
.raise('Error', 'Reboot failed');
46 L
.ui
.showModal(_('Rebooting…'), [
47 E('p', { 'class': 'spinning' }, _('Waiting for device...'))
50 window
.setTimeout(function() {
51 L
.ui
.showModal(_('Rebooting…'), [
52 E('p', { 'class': 'spinning alert-message warning' },
53 _('Device unreachable! Still waiting for device...'))
57 L
.ui
.awaitReconnect();
59 .catch(function(e
) { L
.ui
.addNotification(null, E('p', e
.message
)) });
62 handleSaveApply
: null,