diff --git a/ui/general/assets/drone-icon.svg b/ui/general/assets/icons/drone-icon.svg similarity index 100% rename from ui/general/assets/drone-icon.svg rename to ui/general/assets/icons/drone-icon.svg diff --git a/ui/general/health.html b/ui/general/health.html index ed9a7f0..e474b52 100644 --- a/ui/general/health.html +++ b/ui/general/health.html @@ -23,13 +23,21 @@
- Select a Drone for Inspection + Select a Drone for Inspection
- - +
diff --git a/ui/general/health.js b/ui/general/health.js index 8f3dacd..b754384 100644 --- a/ui/general/health.js +++ b/ui/general/health.js @@ -1,9 +1,40 @@ // Elements +const drone = document.getElementById("drone"); + +const drones = [ + // 2.4 GHz Channels + ["1", "mu1"], ["2", "mu2"], ["3", "mu3"], + ["4", "mu4"], ["5", "mu5"], ["6", "mu6"] +] // Load initial settings document.onload = initPage(); // Function to initialize the page function initPage() { + +} + +function successReadFile(content) { + try { + // Drone selection + const currentDrone = getValueByKey(content, "common", "drone"); + + addDropDown(drone, drones, currentDrone); + } catch (e) { + failureReadFile(e); + } +} + +// Restart wifibroadcast service +function restartDroneDisplayService() { + cockpit.spawn(["systemctl", "restart", "dronedisplay@drone"], { superuser: "require" }) + .then(() => { + displaySuccess("dronedisplay@drone service restarted."); + }) + .catch((error) => { + console.error("Failed to restart dronedisplay@drone service:", error); + displayFail("Failed to restart dronedisplay@drone service: " + error); + }); }