diff --git a/PrometheOSUtility/PrometheOSPacker/bundle/hddformat.html b/PrometheOSUtility/PrometheOSPacker/bundle/hddformat.html new file mode 100644 index 0000000..6ee36c8 --- /dev/null +++ b/PrometheOSUtility/PrometheOSPacker/bundle/hddformat.html @@ -0,0 +1 @@ +PrometheOS

PrometheOS: Format Drive...


Please Wait...


Copyright 2024 - Team Cerbios + Team Resurgent
\ No newline at end of file diff --git a/PrometheOSUtility/PrometheOSPacker/bundle/hddformat.js b/PrometheOSUtility/PrometheOSPacker/bundle/hddformat.js new file mode 100644 index 0000000..9c817c9 --- /dev/null +++ b/PrometheOSUtility/PrometheOSPacker/bundle/hddformat.js @@ -0,0 +1,63 @@ +let nonce = 0; +window.onload = function () { + init(); +} +function init() { + nonce = (Math.random() * 4294967295) - 2147483647; + const queryparams = new URLSearchParams(location.search); + const drive = parseInt(queryparams.get("drive")); + if ([0, 1].indexOf(drive) === -1) { + let content = document.getElementById("content"); + content.innerHTML = "Unknown drive"; + return; + } + querydrive(drive); +} +async function querydrive(drive) { + let content = document.getElementById("content"); + await fetch(`http://192.168.1.66/api/drive.json?${drive}&${nonce}`).catch(error => { + content.innerHTML = "Failed to connect."; + }).then(async response => { + const json = await response.json(); + let driveName = document.getElementById("drivename"); + switch (drive) { + case 0: driveName.innerHTML = "Primary"; break; + case 1: driveName.innerHTML = "Secondary"; break; + } + let contentBody = `