Krolyxon
Commit f229361

Branches

Tags

Refs →

orion-rfindex.html

129 lines · 2.7 KB · HTML

1<!DOCTYPE html>
2<html>
3<head>
4 <meta charset="UTF-8">
5 <title>ORION-RF Installer</title>
6
7 <script
8 type="module"
9 src="https://unpkg.com/esp-web-tools@10/dist/web/install-button.js">
10 </script>
11
12 <style>
13 body {
14 font-family: sans-serif;
15 max-width: 700px;
16 margin: auto;
17 padding: 2rem;
18 }
19
20 .card {
21 border: 1px solid #ddd;
22 border-radius: 10px;
23 padding: 20px;
24 }
25
26 select {
27 width: 100%;
28 padding: 10px;
29 margin-bottom: 20px;
30 }
31 </style>
32</head>
33<body>
34
35<h1>ORION-RF Installer</h1>
36
37<div class="card">
38 <h2>Select Firmware Version</h2>
39
40 <select id="versionSelect"></select>
41
42 <div id="installer"></div>
43</div>
44
45<script>
46const BASE_URL =
47 "https://krolyxon.github.io/orion-rf";
48
49async function loadVersions() {
50 const response =
51 await fetch(`${BASE_URL}/versions.json`);
52
53 const versions =
54 await response.json();
55
56 const select =
57 document.getElementById("versionSelect");
58
59 select.innerHTML = "";
60
61 versions.forEach(version => {
62 const option =
63 document.createElement("option");
64
65 option.value = version;
66 option.textContent = version;
67
68 select.appendChild(option);
69 });
70
71 buildInstaller();
72}
73
74function buildInstaller() {
75 const version =
76 document.getElementById("versionSelect").value;
77
78 const manifest = {
79 name: "ORION-RF",
80 version: version,
81 builds: [
82 {
83 chipFamily: "ESP32-S3",
84 parts: [
85 {
86 path:
87 `${BASE_URL}/firmware/${version}/bootloader.bin`,
88 offset: 0
89 },
90 {
91 path:
92 `${BASE_URL}/firmware/${version}/partitions.bin`,
93 offset: 32768
94 },
95 {
96 path:
97 `${BASE_URL}/firmware/${version}/firmware.bin`,
98 offset: 65536
99 }
100 ]
101 }
102 ]
103 };
104
105 const blob =
106 new Blob(
107 [JSON.stringify(manifest)],
108 { type: "application/json" }
109 );
110
111 const manifestUrl =
112 URL.createObjectURL(blob);
113
114 document.getElementById("installer").innerHTML = `
115 <esp-web-install-button
116 manifest="${manifestUrl}">
117 </esp-web-install-button>
118 `;
119}
120
121document
122 .getElementById("versionSelect")
123 .addEventListener("change", buildInstaller);
124
125loadVersions();
126</script>
127
128</body>
129</html>