Skip to content

Commit 2c63669

Browse files
BigfootACAkdrag0n
authored andcommitted
demo: Add boot image
1 parent 6055967 commit 2c63669

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

demo/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@
2727

2828
<hr />
2929

30+
<div>
31+
<form class="boot-form">
32+
<label for="boot-file">Boot image:</label>
33+
<input type="file" name="boot-file" class="boot-file" />
34+
<input type="submit" value="Boot" />
35+
</form>
36+
</div>
37+
38+
<hr />
39+
3040
<div>
3141
<form class="flash-form">
3242
<label for="flash-file">Flash image:</label>

demo/ui.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ async function sendFormCommand(event) {
3737
inputField.value = "";
3838
}
3939

40+
async function bootFormFile(event) {
41+
event.preventDefault();
42+
43+
let fileField = document.querySelector(".boot-file");
44+
let file = fileField.files[0];
45+
await device.bootBlob(file);
46+
fileField.value = "";
47+
}
48+
4049
async function flashFormFile(event) {
4150
event.preventDefault();
4251

@@ -124,6 +133,7 @@ document
124133
document
125134
.querySelector(".connect-button")
126135
.addEventListener("click", connectDevice);
136+
document.querySelector(".boot-form").addEventListener("submit", bootFormFile);
127137
document.querySelector(".flash-form").addEventListener("submit", flashFormFile);
128138
document
129139
.querySelector(".download-zip-button")

0 commit comments

Comments
 (0)