diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-11-01 12:42:48 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-11-01 12:42:48 +0100 |
commit | 7d843964711e9e26ff2c6fb97b340afd4a68b179 (patch) | |
tree | d3d475bf43541786441d4098c8b61394cdab1f80 | |
parent | b4861da8860576f2ceda20384b896288b989b52a (diff) |
luci-mod-system: flash.js: fix flash erase modal
The firstboot rpc call might not return, therefor do not wait on promise
fullfillment but display modal dialog right away.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js index e139ba661..43840f407 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js @@ -89,16 +89,14 @@ return L.view.extend({ if (!confirm(_('Do you really want to erase all settings?'))) return; - return fs.exec('/sbin/firstboot', [ '-r', '-y' ]).then(function(res) { - if (res.code != 0) - return L.ui.addNotification(null, E('p', _('The firstboot command failed with code %d').format(res.code))); + L.ui.showModal(_('Erasing...'), [ + E('p', { 'class': 'spinning' }, _('The system is erasing the configuration partition now and will reboot itself when finished.')) + ]); - L.ui.showModal(_('Erasing...'), [ - E('p', { 'class': 'spinning' }, _('The system is erasing the configuration partition now and will reboot itself when finished.')) - ]); + /* Currently the sysupgrade rpc call will not return, hence no promise handling */ + fs.exec('/sbin/firstboot', [ '-r', '-y' ]); - L.ui.awaitReconnect('192.168.1.1', 'openwrt.lan'); - }).catch(function(e) { L.ui.addNotification(null, E('p', e.message)) }); + L.ui.awaitReconnect('192.168.1.1', 'openwrt.lan'); }, handleRestore: function(ev) { |