Download jericho/static/main.js from Jarilo-Project/Jericho: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/Jarilo-Project/Jericho/resolve/main/jericho/static/main.js
- Command line
-
hf download hf://Jarilo-Project/Jericho/jericho/static/main.js
-
curl -L -o main.js https://huggingface.co/Jarilo-Project/Jericho/resolve/main/jericho/static/main.js
1.24 kB
| let antennasEnabled = true; | |
| async function updateAntennasState(enabled) { | |
| try { | |
| const resp = await fetch("/antennas", { | |
| method: "POST", | |
| headers: { "Content-Type": "application/json" }, | |
| body: JSON.stringify({ enabled }), | |
| }); | |
| const data = await resp.json(); | |
| antennasEnabled = data.antennas_enabled; | |
| updateUI(); | |
| } catch (e) { | |
| document.getElementById("status").textContent = "Backend error"; | |
| } | |
| } | |
| async function playSound() { | |
| try { | |
| await fetch("/play_sound", { method: "POST" }); | |
| } catch (e) { | |
| console.error("Error triggering sound:", e); | |
| } | |
| } | |
| function updateUI() { | |
| const checkbox = document.getElementById("antenna-checkbox"); | |
| const status = document.getElementById("status"); | |
| checkbox.checked = antennasEnabled; | |
| if (antennasEnabled) { | |
| status.textContent = "Antennas status: running"; | |
| } else { | |
| status.textContent = "Antennas status: stopped"; | |
| } | |
| } | |
| document.getElementById("antenna-checkbox").addEventListener("change", (e) => { | |
| updateAntennasState(e.target.checked); | |
| }); | |
| document.getElementById("sound-btn").addEventListener("click", () => { | |
| playSound(); | |
| }); | |
| updateUI(); |