luci-app-attendedsysupgrade: improve ux during install and reboot

During the sysupgrade image installation and reboot process, it
is possible for LuCI to reconnect before the device is rebooted.
This leads to confusion and possible danger of changes being made
that will damage the device.

We set expectations as to what will happen during the installation
process with better wording in the spin dialog, and also "lock up"
the interface for 10s, allowing sysupgrade to do its job and avoid
reconnecting too early

Link: https://forum.openwrt.org/t/luci-attended-sysupgrade-support-thread/230552/268
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
This commit is contained in:
Eric Fahlgren
2025-10-28 09:07:03 -07:00
committed by Paul Donald
parent f52d047e2f
commit 3dced05aa2

View File

@@ -476,27 +476,26 @@ return view.extend({
.then((response) => { .then((response) => {
if (response.sha256sum != sha256) { if (response.sha256sum != sha256) {
ui.showModal(_('Wrong checksum'), [ ui.showModal(_('Wrong checksum'), [
E( E('p', _('Error during download of firmware. Please try again')),
'p',
_('Error during download of firmware. Please try again')
),
E('div', { class: 'btn', click: ui.hideModal }, _('Close')), E('div', { class: 'btn', click: ui.hideModal }, _('Close')),
]); ]);
} else { } else {
ui.showModal(_('Installing...'), [ ui.showModal(_('Installing...'), [
E( E('div', { class: 'spinning' }, [
'p', E('p', _('Installing the sysupgrade image...')),
{ class: 'spinning' }, E('p',
_('Installing the sysupgrade. Do not unpower device!') _('Once the image is written, the system will reboot.')
), + ' ' +
_('This should take at least a minute, so please wait for the login screen.')
),
E('b', _('While you are waiting, do not unpower device!')),
]),
]); ]);
L.resolveDefault(callUpgradeStart(keep), {}).then((response) => { L.resolveDefault(callUpgradeStart(keep), {}).then((response) => {
if (keep) { // Wait 10 seconds before we try to reconnect...
ui.awaitReconnect(window.location.host); let hosts = keep ? [] : ['192.168.1.1', 'openwrt.lan'];
} else { setTimeout(() => { ui.awaitReconnect(...hosts); }, 10000);
ui.awaitReconnect('192.168.1.1', 'openwrt.lan');
}
}); });
} }
}); });