Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PrometheOSUtility/PrometheOSPacker/bundle/hddformat.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html lang=en data-theme=dark><head><meta charset=utf-8 /><meta name=viewport content="width=device-width, initial-scale=1, shrink-to-fit=no" /><title>PrometheOS</title><link rel=icon type=image/x-icon href=favicon.ico /><link href=pico.css rel=stylesheet /></head><body><main class=container><form id=formatform><h2>PrometheOS: Format <span id=drivename></span> Drive...</h2><br /><div id=content><span>Please Wait...</span></div><br /><div class=grid><a role=button class=secondary href=hddformat_select.html>Back</a></div><br /><div><b>Copyright 2024 - Team Cerbios + Team Resurgent</b></div></form></main><script src=hddformat.js></script></body></html>
63 changes: 63 additions & 0 deletions PrometheOSUtility/PrometheOSPacker/bundle/hddformat.js
Original file line number Diff line number Diff line change
@@ -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 = "<span>Unknown drive</span>";
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 = `<label for="model">Model:</span><div id="model">${json.model}</div><br /><label for="serial"><b>Serial:</b></label><div id="serial">${json.serial}</div><br /><hr /><input type="hidden" name="drive" value="${drive}"><input type="hidden" name="nonce" value="${nonce}"><div class="grid"><a id="confirm" role="button" href="javascript:void(0)" onclick="veryConfirm()">Please Confirm...</a></div>`;
content.innerHTML = contentBody;
});
}
async function veryConfirm() {
const veryConfirm = confirm("Confirm again");
if (!veryConfirm) {
return;
}
const form = document.getElementById("formatform");
const confirmButton = document.getElementById("confirm");
confirmButton.innerHTML = "Please wait...";
confirmButton.setAttribute("disabled", true);
confirmButton.setAttribute("onclick", "javascript:void(0)");
const data = new FormData(form);
await fetch("http://192.168.1.66/api/formatdrive", {
method: 'POST',
body: data
}).then(async response => {
if (response.status == 200) {
const json = await response.json();
switch (json.result) {
case 0: confirmButton.innerHTML = "Unknown"; break;
case 1: confirmButton.innerHTML = "Done"; break;
case 2: confirmButton.innerHTML = "Failed"; break;
}
} else {
confirmButton.innerHTML = "Failed";
}
setTimeout(() => {
init();
}, 2000);

}).catch(() => {
confirmButton.innerHTML = "Failed";
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html lang=en data-theme=dark><head><meta charset=utf-8 /><meta name=viewport content="width=device-width, initial-scale=1, shrink-to-fit=no" /><title>PrometheOS</title><link rel=icon type=image/x-icon href=favicon.ico /><link href=pico.css rel=stylesheet /></head><body><main class=container><form><h2>PrometheOS: Select Drive</h2><br /><div id=content><span>Please Wait...</span></div><br /><div class=grid><a role=button class=secondary href=utilities.html>Back</a></div><br /><div><b>Copyright 2024 - Team Cerbios + Team Resurgent</b></div></form></main><script src=hddformat_select.js></script></body></html>
20 changes: 20 additions & 0 deletions PrometheOSUtility/PrometheOSPacker/bundle/hddformat_select.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
window.onload = function () {
listdrives();
}
async function listdrives() {
await fetch("http://192.168.1.66/api/drives.json").catch(error => {
let content = document.getElementById("content");
content.innerHTML = "Failed to connect.";
}).then(async response => {
const json = await response.json();
let contentBody = "";
if (json.primaryDrive) {
contentBody += `<div class="grid"><a role="button" href="hddformat.html?drive=0">Format Drive Primary</a></div><br />`;
}
if (json.secondaryDrive) {
contentBody += `<div class="grid"><a role="button" href="hddformat.html?drive=1">Format Drive Secondary</a></div><br />`;
}
let content = document.getElementById("content");
content.outerHTML = contentBody;
});
}
1 change: 1 addition & 0 deletions PrometheOSUtility/PrometheOSPacker/bundle/hddlock.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html lang=en data-theme=dark><head><meta charset=utf-8 /><meta name=viewport content="width=device-width, initial-scale=1, shrink-to-fit=no" /><title>PrometheOS</title><link rel=icon type=image/x-icon href=favicon.ico /><link href=pico.css rel=stylesheet /></head><body><main class=container><form id=lockform><h2>PrometheOS: Utilities</h2><br /><div id=content><span>Please Wait...</span></div><br /><div class=grid><a role=button class=secondary href=utilities.html>Back</a></div><br /><div><b>Copyright 2024 - Team Cerbios + Team Resurgent</b></div></form></main><script src=hddlock.js></script></body></html>
50 changes: 50 additions & 0 deletions PrometheOSUtility/PrometheOSPacker/bundle/hddlock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
let nonce = 0;
window.onload = function () {
querydrive();
}
async function querydrive() {
nonce = (Math.random() * 4294967295) - 2147483647;
let content = document.getElementById("content");
await fetch(`http://192.168.1.66/api/drive.json?0&${nonce}`).catch(error => {
content.innerHTML = "Failed to connect.";
}).then(async response => {
const json = await response.json();
const lockStatus = json.locked ? "Locked" : "Unlocked";
const buttonLabel = json.locked ? "Unlock" : "Lock";
let contentBody = `<label for="model">Model:</span><div id="model">${json.model}</div><br /><label for="serial"><b>Serial:</b></label><div id="serial">${json.serial}</div><br /><label for="status"><b>Status:</b></label><div id="status">${lockStatus}</div><br /><hr /><div class="grid"><a id="locktoggle" role="button" href="javascript:void(0)" onclick="setLocked(${!json.locked})">${buttonLabel}</a></div>`;
content.innerHTML = contentBody;
});
}
async function setLocked(toStatus) {
const button = document.getElementById("locktoggle")
button.setAttribute("disabled", true);
button.setAttribute("onclick", "javascript:void(0)");
if (toStatus) {
button.innerHTML = "Locking...";
} else {
button.innerHTML = "Unlocking...";
}
await fetch(`http://192.168.1.66/api/hddlockunlock?${toStatus ? 1 : 0}&${nonce}`).then(async response => {
const json = await response.json();
switch (json.status) {
case 0: button.innerHTML = "No result"; break;
case 1: button.innerHTML = "Unlocked"; break;
case 2: button.innerHTML = "VSC Unlocked"; break;
case 3: button.innerHTML = "Failed to unlock HDD"; break;
case 4: button.innerHTML = "Already unlocked"; break;
case 5: button.innerHTML = "Locked"; break;
case 6: button.innerHTML = "Failed to lock HDD"; break;
case 7: button.innerHTML = "Already locked"; break;
case 8: button.innerHTML = "Locking not supported"; break;
case 9: button.innerHTML = "Unable to decrypt EEPROM"; break;
case 10: button.innerHTML = "Unlocking..."; break;
case 11: button.innerHTML = "VSC Unlocking..."; break;
case 12: button.innerHTML = "Locking..."; break;
}
setTimeout(() => {
querydrive();
}, 2000);
}).catch(() => {
button.innerHTML = "Failed";
})
}
2 changes: 1 addition & 1 deletion PrometheOSUtility/PrometheOSPacker/bundle/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang=en data-theme=dark><head><meta charset=utf-8 /><meta name=viewport content="width=device-width, initial-scale=1, shrink-to-fit=no" /><title>PrometheOS</title><link rel=icon type=image/x-icon href=favicon.ico /><link href=pico.css rel=stylesheet /></head><body><main class=container><form><h2>PrometheOS</h2><div class=grid><a role=button href=launch.html>Launch BIOS</a></div><br /><div class=grid><a role=button href=remove.html>Remove BIOS</a></div><br /><div class=grid><a role=button href=flash.html>Flash BIOS</a></div><br /><div class=grid><a role=button href=downloads.html>Downloads</a></div><br /><div class=grid><a role=button href=cerbiosini.html>Cerbios INI</a></div><br /><div class=grid><a role=button href=javascript:void(0) onclick=screenshot()>Take Screenshot</a></div><br /><div class=grid><a role=button href=remoteview.html>Remote View</a></div><br /><div class=grid><a role=button href=javascript:void(0) onclick=reboot()>Reboot</a></div><br /><div class=grid><a role=button href=javascript:void(0) onclick=shutdown()>Shutdown</a></div><br /><div><b>Copyright 2024 - Team Cerbios + Team Resurgent</b></div></form></main><script src=index.js></script></body></html>
<!DOCTYPE html><html lang=en data-theme=dark><head><meta charset=utf-8 /><meta name=viewport content="width=device-width, initial-scale=1, shrink-to-fit=no" /><title>PrometheOS</title><link rel=icon type=image/x-icon href=favicon.ico /><link href=pico.css rel=stylesheet /></head><body><main class=container><form><h2>PrometheOS</h2><div class=grid><a role=button href=launch.html>Launch BIOS</a></div><br /><div class=grid><a role=button href=remove.html>Remove BIOS</a></div><br /><div class=grid><a role=button href=flash.html>Flash BIOS</a></div><br /><div class=grid><a role=button href=downloads.html>Downloads</a></div><br /><div class=grid><a role=button href=cerbiosini.html>Cerbios INI</a></div><br /><div class=grid><a role=button href=utilities.html>Utilities</a></div><br /><div class=grid><a role=button href=javascript:void(0) onclick=screenshot()>Take Screenshot</a></div><br /><div class=grid><a role=button href=remoteview.html>Remote View</a></div><br /><div class=grid><a role=button href=javascript:void(0) onclick=reboot()>Reboot</a></div><br /><div class=grid><a role=button href=javascript:void(0) onclick=shutdown()>Shutdown</a></div><br /><div><b>Copyright 2024 - Team Cerbios + Team Resurgent</b></div></form></main><script src=index.js></script></body></html>
1 change: 1 addition & 0 deletions PrometheOSUtility/PrometheOSPacker/bundle/utilities.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html lang=en data-theme=dark><head><meta charset=utf-8 /><meta name=viewport content="width=device-width, initial-scale=1, shrink-to-fit=no" /><title>PrometheOS</title><link rel=icon type=image/x-icon href=favicon.ico /><link href=pico.css rel=stylesheet /></head><body><main class=container><form><h2>PrometheOS: Utilities</h2><br /><div class=grid><a role=button href=hddlock.html>HDD Lock / Unlock</a></div><br /><div class=grid><a role=button href=hddformat_select.html>Format Drive</a></div><br /><div class=grid><a role=button class=secondary href=index.html>Back</a></div><br /><div><b>Copyright 2024 - Team Cerbios + Team Resurgent</b></div></form></main></body></html>
30 changes: 30 additions & 0 deletions PrometheOSUtility/PrometheOSWeb/wwwroot/hddformat.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>PrometheOS</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link href="pico.css" rel="stylesheet" />
</head>
<body>
<main class="container">
<form id="formatform">
<h2>PrometheOS: Format <span id="drivename"></span> Drive...</h2>
<br />
<div id="content">
<span>Please Wait...</span>
</div>
<br />
<div class="grid">
<a role="button" class="secondary" href="hddformat_select.html">Back</a>
</div>
<br />
<div>
<b>Copyright 2024 - Team Cerbios + Team Resurgent</b>
</div>
</form>
</main>
<script src="hddformat.js"></script>
</body>
</html>
63 changes: 63 additions & 0 deletions PrometheOSUtility/PrometheOSWeb/wwwroot/hddformat.js
Original file line number Diff line number Diff line change
@@ -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 = "<span>Unknown drive</span>";
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 = `<label for="model">Model:</span><div id="model">${json.model}</div><br /><label for="serial"><b>Serial:</b></label><div id="serial">${json.serial}</div><br /><hr /><input type="hidden" name="drive" value="${drive}"><input type="hidden" name="nonce" value="${nonce}"><div class="grid"><a id="confirm" role="button" href="javascript:void(0)" onclick="veryConfirm()">Please Confirm...</a></div>`;
content.innerHTML = contentBody;
});
}
async function veryConfirm() {
const veryConfirm = confirm("Confirm again");
if (!veryConfirm) {
return;
}
const form = document.getElementById("formatform");
const confirmButton = document.getElementById("confirm");
confirmButton.innerHTML = "Please wait...";
confirmButton.setAttribute("disabled", true);
confirmButton.setAttribute("onclick", "javascript:void(0)");
const data = new FormData(form);
await fetch("http://192.168.1.66/api/formatdrive", {
method: 'POST',
body: data
}).then(async response => {
if (response.status == 200) {
const json = await response.json();
switch (json.result) {
case 0: confirmButton.innerHTML = "Unknown"; break;
case 1: confirmButton.innerHTML = "Done"; break;
case 2: confirmButton.innerHTML = "Failed"; break;
}
} else {
confirmButton.innerHTML = "Failed";
}
setTimeout(() => {
init();
}, 2000);

}).catch(() => {
confirmButton.innerHTML = "Failed";
});
}
30 changes: 30 additions & 0 deletions PrometheOSUtility/PrometheOSWeb/wwwroot/hddformat_select.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>PrometheOS</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link href="pico.css" rel="stylesheet" />
</head>
<body>
<main class="container">
<form>
<h2>PrometheOS: Select Drive</h2>
<br />
<div id="content">
<span>Please Wait...</span>
</div>
<br />
<div class="grid">
<a role="button" class="secondary" href="utilities.html">Back</a>
</div>
<br />
<div>
<b>Copyright 2024 - Team Cerbios + Team Resurgent</b>
</div>
</form>
</main>
<script src="hddformat_select.js"></script>
</body>
</html>
20 changes: 20 additions & 0 deletions PrometheOSUtility/PrometheOSWeb/wwwroot/hddformat_select.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
window.onload = function () {
listdrives();
}
async function listdrives() {
await fetch("http://192.168.1.66/api/drives.json").catch(error => {
let content = document.getElementById("content");
content.innerHTML = "Failed to connect.";
}).then(async response => {
const json = await response.json();
let contentBody = "";
if (json.primaryDrive) {
contentBody += `<div class="grid"><a role="button" href="hddformat.html?drive=0">Format Drive Primary</a></div><br />`;
}
if (json.secondaryDrive) {
contentBody += `<div class="grid"><a role="button" href="hddformat.html?drive=1">Format Drive Secondary</a></div><br />`;
}
let content = document.getElementById("content");
content.outerHTML = contentBody;
});
}
30 changes: 30 additions & 0 deletions PrometheOSUtility/PrometheOSWeb/wwwroot/hddlock.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>PrometheOS</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link href="pico.css" rel="stylesheet" />
</head>
<body>
<main class="container">
<form id="lockform">
<h2>PrometheOS: Utilities</h2>
<br />
<div id="content">
<span>Please Wait...</span>
</div>
<br />
<div class="grid">
<a role="button" class="secondary" href="utilities.html">Back</a>
</div>
<br />
<div>
<b>Copyright 2024 - Team Cerbios + Team Resurgent</b>
</div>
</form>
</main>
<script src="hddlock.js"></script>
</body>
</html>
50 changes: 50 additions & 0 deletions PrometheOSUtility/PrometheOSWeb/wwwroot/hddlock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
let nonce = 0;
window.onload = function () {
querydrive();
}
async function querydrive() {
nonce = (Math.random() * 4294967295) - 2147483647;
let content = document.getElementById("content");
await fetch(`http://192.168.1.66/api/drive.json?0&${nonce}`).catch(error => {
content.innerHTML = "Failed to connect.";
}).then(async response => {
const json = await response.json();
const lockStatus = json.locked ? "Locked" : "Unlocked";
const buttonLabel = json.locked ? "Unlock" : "Lock";
let contentBody = `<label for="model">Model:</span><div id="model">${json.model}</div><br /><label for="serial"><b>Serial:</b></label><div id="serial">${json.serial}</div><br /><label for="status"><b>Status:</b></label><div id="status">${lockStatus}</div><br /><hr /><div class="grid"><a id="locktoggle" role="button" href="javascript:void(0)" onclick="setLocked(${!json.locked})">${buttonLabel}</a></div>`;
content.innerHTML = contentBody;
});
}
async function setLocked(toStatus) {
const button = document.getElementById("locktoggle")
button.setAttribute("disabled", true);
button.setAttribute("onclick", "javascript:void(0)");
if (toStatus) {
button.innerHTML = "Locking...";
} else {
button.innerHTML = "Unlocking...";
}
await fetch(`http://192.168.1.66/api/hddlockunlock?${toStatus ? 1 : 0}&${nonce}`).then(async response => {
const json = await response.json();
switch (json.status) {
case 0: button.innerHTML = "No result"; break;
case 1: button.innerHTML = "Unlocked"; break;
case 2: button.innerHTML = "VSC Unlocked"; break;
case 3: button.innerHTML = "Failed to unlock HDD"; break;
case 4: button.innerHTML = "Already unlocked"; break;
case 5: button.innerHTML = "Locked"; break;
case 6: button.innerHTML = "Failed to lock HDD"; break;
case 7: button.innerHTML = "Already locked"; break;
case 8: button.innerHTML = "Locking not supported"; break;
case 9: button.innerHTML = "Unable to decrypt EEPROM"; break;
case 10: button.innerHTML = "Unlocking..."; break;
case 11: button.innerHTML = "VSC Unlocking..."; break;
case 12: button.innerHTML = "Locking..."; break;
}
setTimeout(() => {
querydrive();
}, 2000);
}).catch(() => {
button.innerHTML = "Failed";
})
}
Loading