fix: firmware updates

This commit is contained in:
2024-11-08 15:42:58 +01:00
parent 3659b80e41
commit 232045964c
3 changed files with 31 additions and 12 deletions

View File

@@ -513,11 +513,11 @@ export class CharaDevice {
const writer2 = this.port.writable!.getWriter(); const writer2 = this.port.writable!.getWriter();
try { try {
await writer2.write(new TextEncoder().encode(`RST REBOOT\r\n`)); await writer2.write(new TextEncoder().encode(`RST RESTART\r\n`));
serialLog.update((it) => { serialLog.update((it) => {
it.push({ it.push({
type: "input", type: "input",
value: "RST REBOOT", value: "RST RESTART",
}); });
return it; return it;
}); });

View File

@@ -2,7 +2,7 @@
let { children } = $props(); let { children } = $props();
</script> </script>
<h1><a href="/ccos">Firmware Updates</a></h1> <h1><a href="/firmware">Firmware Updates</a></h1>
{@render children()} {@render children()}

View File

@@ -104,14 +104,16 @@
} }
</script> </script>
<div> <div class="container">
<h2> <h2>
Update <em <a class="inline-link" href="/ccos">CCOS</a> /
class="device" <a
href="/ccos/{data.device}"
class="device inline-link"
class:correct-device={isCorrectDevice === true} class:correct-device={isCorrectDevice === true}
class:incorrect-device={isCorrectDevice === false}>{data.device}</em class:incorrect-device={isCorrectDevice === false}>{data.device}</a
> >
to <em class="version">{data.version}</em> / <em class="version">{data.version}</em>
</h2> </h2>
{#if data.ota && !data.device.endsWith("m0")} {#if data.ota && !data.device.endsWith("m0")}
@@ -127,8 +129,14 @@
> >
{#if $serialPort && isCorrectDevice} {#if $serialPort && isCorrectDevice}
<div transition:slide> <div transition:slide>
Your device is ready and compatible. Click the button to perform the Your
update. <b
>{$serialPort.company}
{$serialPort.device}
{$serialPort.chipset}</b
>
will be updated from <b class="version">{$serialPort.version}</b> to
<b class="version">{data.version}</b>
</div> </div>
{:else if $serialPort && isCorrectDevice === false} {:else if $serialPort && isCorrectDevice === false}
<div class="error" transition:slide> <div class="error" transition:slide>
@@ -147,8 +155,6 @@
{/if} {/if}
</section> </section>
<hr />
<h3>Manual Update</h3> <h3>Manual Update</h3>
{/if} {/if}
@@ -229,6 +235,10 @@
transition: color 200ms ease; transition: color 200ms ease;
} }
h3 {
margin-block-start: 4em;
}
.primary { .primary {
color: var(--md-sys-color-primary); color: var(--md-sys-color-primary);
} }
@@ -237,6 +247,10 @@
color: var(--md-sys-color-error); color: var(--md-sys-color-error);
} }
.container {
width: calc(min(100%, 16cm));
}
@keyframes rotate { @keyframes rotate {
0% { 0% {
transform: rotate(120deg); transform: rotate(120deg);
@@ -375,6 +389,11 @@
opacity: 0.6; opacity: 0.6;
} }
.inline-link {
display: inline;
padding: 0;
}
.correct-device { .correct-device {
color: var(--md-sys-color-primary); color: var(--md-sys-color-primary);
opacity: 1; opacity: 1;