diff options
Diffstat (limited to 'index.html')
| -rw-r--r-- | index.html | 129 |
1 files changed, 123 insertions, 6 deletions
@@ -1,12 +1,129 @@ <!DOCTYPE html> <html> +<head> + <meta charset="UTF-8"> + <title>ORION-RF Installer</title> + + <script + type="module" + src="https://unpkg.com/esp-web-tools@10/dist/web/install-button.js"> + </script> + + <style> + body { + font-family: sans-serif; + max-width: 700px; + margin: auto; + padding: 2rem; + } + + .card { + border: 1px solid #ddd; + border-radius: 10px; + padding: 20px; + } + + select { + width: 100%; + padding: 10px; + margin-bottom: 20px; + } + </style> +</head> <body> - <h1>ORION-RF Firmware Host</h1> - <ul> - <li><a href="firmware/v0.1.0/firmware.bin">firmware.bin</a></li> - <li><a href="firmware/v0.1.0/bootloader.bin">bootloader.bin</a></li> - <li><a href="firmware/v0.1.0/partitions.bin">partitions.bin</a></li> - </ul> +<h1>ORION-RF Installer</h1> + +<div class="card"> + <h2>Select Firmware Version</h2> + + <select id="versionSelect"></select> + + <div id="installer"></div> +</div> + +<script> +const BASE_URL = + "https://krolyxon.github.io/orion-rf"; + +async function loadVersions() { + const response = + await fetch(`${BASE_URL}/versions.json`); + + const versions = + await response.json(); + + const select = + document.getElementById("versionSelect"); + + select.innerHTML = ""; + + versions.forEach(version => { + const option = + document.createElement("option"); + + option.value = version; + option.textContent = version; + + select.appendChild(option); + }); + + buildInstaller(); +} + +function buildInstaller() { + const version = + document.getElementById("versionSelect").value; + + const manifest = { + name: "ORION-RF", + version: version, + builds: [ + { + chipFamily: "ESP32-S3", + parts: [ + { + path: + `${BASE_URL}/firmware/${version}/bootloader.bin`, + offset: 0 + }, + { + path: + `${BASE_URL}/firmware/${version}/partitions.bin`, + offset: 32768 + }, + { + path: + `${BASE_URL}/firmware/${version}/firmware.bin`, + offset: 65536 + } + ] + } + ] + }; + + const blob = + new Blob( + [JSON.stringify(manifest)], + { type: "application/json" } + ); + + const manifestUrl = + URL.createObjectURL(blob); + + document.getElementById("installer").innerHTML = ` + <esp-web-install-button + manifest="${manifestUrl}"> + </esp-web-install-button> + `; +} + +document + .getElementById("versionSelect") + .addEventListener("change", buildInstaller); + +loadVersions(); +</script> + </body> </html> |
