]);
} else {
displayStatus('warning spinning', E('p', _('Installing the sysupgrade. Do not unpower device!')));
- L.resolveDefault(callUpgradeStart(keep), {}).then(response => {
- if (keep) {
- ui.awaitReconnect(window.location.host);
- } else {
- ui.awaitReconnect('192.168.1.1', 'openwrt.lan');
- }
- });
+ L.resolveDefault(callUpgradeStart(keep), {}).then(response => {
+ if (keep) {
+ ui.awaitReconnect(window.location.host);
+ } else {
+ ui.awaitReconnect('192.168.1.1', 'openwrt.lan');
+ }
+ });
}
});
});
var advanced_mode = uci.get_first('attendedsysupgrade', 'client', 'advanced_mode') || 0;
var candidates = [];
- fetch(server_url + "/api/latest")
+ request.get(server_url + "/api/latest", {
+ timeout: 8000
+ })
.then(response => response.json())
.then(response => {
if (current_version == "SNAPSHOT") {
])
]);
}
+ })
+ .catch(error => {
+ ui.showModal(_('Error connecting to upgrade server'), [
+ E('p', {}, _('Could not reach API at "%s". Please try again later.'.format(server_url))),
+ E('pre', {}, error),
+ E('div', {
+ 'class': 'right'
+ }, [
+ E('div', {
+ 'class': 'btn',
+ 'click': ui.hideModal
+ }, _('Close'))
+ ])
+ ]);
});
}