Krolyxon
Commit f229361

Branches

Tags

Refs →

orion-rff229361

add installer functionality

Author
krolyxon
Date
2026-06-08 23:19 +0530
Parent
8a4d103
Commit
f229361956e94a6a84152a042280e5c9f9301061

+123 −6

1 file changed

  1. M index.html +123 −6
M index.html View
@@ -1,12 +1,129 @@
11 <!DOCTYPE html>
22 <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>
333 <body>
4− <h1>ORION-RF Firmware Host</h1>
534
6− <ul>
7− <li><a href="firmware/v0.1.0/firmware.bin">firmware.bin</a></li>
8− <li><a href="firmware/v0.1.0/bootloader.bin">bootloader.bin</a></li>
9− <li><a href="firmware/v0.1.0/partitions.bin">partitions.bin</a></li>
10− </ul>
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>
46+const BASE_URL =
47+ "https://krolyxon.github.io/orion-rf";
48+
49+async 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+
74+function 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+
121+document
122+ .getElementById("versionSelect")
123+ .addEventListener("change", buildInstaller);
124+
125+loadVersions();
126+</script>
127+
11128 </body>
12129 </html>