mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-13 15:37:03 +00:00
Improved feedback for upgrade error
This commit is contained in:
parent
a30cd76354
commit
9efc19090e
18
lib/SvelteUi/app/dist/index.js
vendored
18
lib/SvelteUi/app/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -173,6 +173,24 @@ export function priceError(err) {
|
||||
return "";
|
||||
}
|
||||
|
||||
export function httpError(err) {
|
||||
switch(err) {
|
||||
case 255: return "Unable to start upgrade";
|
||||
case -1: return "Connection refused";
|
||||
case -2: return "Failed to send headers";
|
||||
case -3: return "Failed to send payload";
|
||||
case -4: return "Not connected";
|
||||
case -5: return "Connection lost";
|
||||
case -6: return "No stream";
|
||||
case -7: return "Not a HTTP server";
|
||||
case -8: return "Not enough memory";
|
||||
case -9: return "Encoding error";
|
||||
case -10: return "Stream write";
|
||||
case -11: return "Read timeout";
|
||||
}
|
||||
return "Unknown " + err;
|
||||
}
|
||||
|
||||
export function isBusPowered(boardType) {
|
||||
switch(boardType) {
|
||||
case 2:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import { metertype, boardtype, isBusPowered, getResetReason } from './Helpers.js';
|
||||
import { metertype, boardtype, isBusPowered, getResetReason, httpError } from './Helpers.js';
|
||||
import { getSysinfo, gitHubReleaseStore, sysinfoStore } from './DataStores.js';
|
||||
import { upgrade, getNextVersion, upgradeWarningText } from './UpgradeHelper';
|
||||
import DownloadIcon from './DownloadIcon.svelte';
|
||||
@ -157,7 +157,7 @@
|
||||
</div>
|
||||
{#if sysinfo.upgrade.t && sysinfo.upgrade.t != sysinfo.version}
|
||||
<div class="my-2">
|
||||
<div class="bd-yellow">Previous upgrade attempt ({sysinfo.upgrade.t}) does not match current version ({sysinfo.version}) [{sysinfo.upgrade.x}/{sysinfo.upgrade.e}]</div>
|
||||
<div class="bd-yellow">Previous upgrade attempt from {sysinfo.upgrade.f} to {sysinfo.upgrade.t} failed. {httpError(sysinfo.upgrade.e)}</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if nextVersion}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user