Upload
This commit is contained in:
commit
08fddcd73e
364 changed files with 111462 additions and 0 deletions
|
@ -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: Cerbios INI</h2><div><span id=content>Please Wait...</span></div><br /><div class=grid><a role=button href=javascript:void(0) onclick=setCerbiosIni()>Save</a> <a role=button class=secondary href=index.html>Back</a></div><br /><div><b>Copyright 2024 - Team Cerbios + Team Resurgent</b></div></form></main><script src=cerbiosini.js></script></body></html>
|
|
@ -0,0 +1,61 @@
|
|||
window.onload = function () {
|
||||
getCerbiosIni();
|
||||
};
|
||||
|
||||
async function getCerbiosIni()
|
||||
{
|
||||
await fetch("http://192.168.1.66/api/cerbiosini").then(async response => {
|
||||
|
||||
const reader = response.body.getReader();
|
||||
const decoder = new TextDecoder("utf-8");
|
||||
|
||||
let body = '';
|
||||
|
||||
while (true)
|
||||
{
|
||||
const { done, value } = await reader.read();
|
||||
if (done)
|
||||
{
|
||||
break;
|
||||
}
|
||||
const chunk = decoder.decode(value, { stream: true });
|
||||
body += chunk;
|
||||
}
|
||||
|
||||
let contentBody = "";
|
||||
contentBody += "<p><div class=\"grid\"><textarea rows=\"40\" cols=\"80\" spellcheck=\"false\" id=\"cerbiosini\">" + body + "</textarea></div></p>";
|
||||
let content = document.getElementById("content");
|
||||
content.innerHTML = contentBody;
|
||||
|
||||
}).catch(error => {
|
||||
|
||||
let content = document.getElementById("content");
|
||||
content.innerHTML = "Failed to connect."
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async function setCerbiosIni()
|
||||
{
|
||||
let content = document.getElementById("cerbiosini");
|
||||
|
||||
var data = new FormData();
|
||||
data.append('body', content.innerText);
|
||||
await fetch("http://192.168.1.66/api/cerbiosini", {
|
||||
method: 'POST',
|
||||
body: data
|
||||
}).then(response => {
|
||||
if (response.status == 200) {
|
||||
window.location.href = "/index.html";
|
||||
} else {
|
||||
uploadFailure();
|
||||
}
|
||||
}).catch(() => {
|
||||
uploadFailure()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function uploadFailure() {
|
||||
alert("Upload failed.");
|
||||
}
|
|
@ -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: Download BIOS</h2><div><span id=content>Please Wait...</span></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><script src=download.js></script></body></html>
|
|
@ -0,0 +1,37 @@
|
|||
window.onload = function () {
|
||||
getBankInfo();
|
||||
};
|
||||
|
||||
async function getBankInfo() {
|
||||
await fetch("http://192.168.1.66/api/bankinfo.json").then(async response => {
|
||||
|
||||
const json = await response.json();
|
||||
|
||||
let contentBody = "";
|
||||
for (let i = 0; i < json.length; i++) {
|
||||
if (json[i].slots > 0) {
|
||||
contentBody += "<p><div class=\"grid\"><a role=\"button\" href=\"javascript:void(0)\" onclick=\"downloadBank(" + json[i].id + ", '" + json[i].name + ".bin')\">" + json[i].name + "</a></div></p>";
|
||||
}
|
||||
}
|
||||
let content = document.getElementById("content");
|
||||
content.innerHTML = contentBody == "" ? "No items found." : contentBody;
|
||||
}).catch(error => {
|
||||
let content = document.getElementById("content");
|
||||
content.innerHTML = "Failed to connect."
|
||||
});
|
||||
}
|
||||
|
||||
async function downloadBank(id, name)
|
||||
{
|
||||
await fetch("http://192.168.1.66/api/downloadbank?" + id).catch(error => {
|
||||
content.innerHTML = "Failed to connect."
|
||||
}).then(response => response.blob()).then(blob => {
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
var a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = name;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
});
|
||||
}
|
|
@ -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</h2><div class=grid><a role=button href=download.html>Download BIOS</a></div><br /><div class=grid><a role=button href=javascript:void(0) onclick=downloadEeprom()>Download EEPROM</a></div><br /><div class=grid><a role=button href=javascript:void(0) onclick=downloadPrometheOS()>Download PrometheOS</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><script src=downloads.js></script></body></html>
|
|
@ -0,0 +1 @@
|
|||
async function downloadEeprom(){await fetch("http://192.168.1.66/api/downloadeeprom").catch(()=>{content.innerHTML="Failed to connect."}).then(n=>n.blob()).then(n=>{var i=window.URL.createObjectURL(n),t=document.createElement("a");t.href=i;t.download="EEPROM.bin";document.body.appendChild(t);t.click();t.remove()})}async function downloadPrometheOS(){await fetch("http://192.168.1.66/api/downloadprom").catch(()=>{content.innerHTML="Failed to connect."}).then(n=>n.blob()).then(n=>{var i=window.URL.createObjectURL(n),t=document.createElement("a");t.href=i;t.download="PrometheOS.bin";document.body.appendChild(t);t.click();t.remove()})}
|
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
|
@ -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 /><link href=main.css rel=stylesheet /></head><body><main class=container><form><h2>PrometheOS: Flash BIOS</h2><label for=file><b>File:</b></label><input type=file id=file onchange=refreshFileInfo() /><br /> <label for=name><b>Name:</b></label><input class=form-control type=text maxlength=40 id=name /><br /> <label for=slotsNeeded><b>Needed Slots:</b></label> <div id=slotsNeeded>NA</div><br /><label for=freeSlots><b>Free Slots:</b></label> <div id=freeSlots>0</div><br /><label for=ledColorButtons><b>LED Color:</b> <span id=ledColor>Off</span></label><div id=ledColorButtons><div class=grid> <button type=button class=btn-ledoff onclick=setLedColor(0)>Off</button> <button type=button class=btn-ledred onclick=setLedColor(1)>Red</button> <button type=button class=btn-ledgreen onclick=setLedColor(2)>Green</button> <button type=button class=btn-ledyellow onclick=setLedColor(3)>Yellow</button></div><div class=grid><button type=button class=btn-ledblue onclick=setLedColor(4)>Blue</button> <button type=button class=btn-ledpurple onclick=setLedColor(5)>Purple</button> <button type=button class=btn-ledturquoise onclick=setLedColor(6)>Turquoise</button> <button type=button class=btn-ledwhite onclick=setLedColor(7)>White</button></div></div><hr /><br /><div class=grid><a role=button disabled id=upload href=javascript:void(0) onclick=upload()>Upload</a> <a role=button class=secondary href=index.html>Back</a></div><br /><div><b>Copyright 2024 - Team Cerbios + Team Resurgent</b></div></form></main><script src=flash.js></script></body></html>
|
|
@ -0,0 +1,129 @@
|
|||
let ledColorState = 0;
|
||||
|
||||
window.onload = function () {
|
||||
refreshFileInfo();
|
||||
};
|
||||
|
||||
function getFileSize()
|
||||
{
|
||||
const file = document.getElementById("file");
|
||||
if (file.value == "") {
|
||||
return -1;
|
||||
}
|
||||
const fileSize = file.files[0].size;
|
||||
if (fileSize == 0) {
|
||||
return -1;
|
||||
} else if (fileSize % (256 * 1024) != 0) {
|
||||
return -1;
|
||||
} else if (fileSize > (1024 * 1024)) {
|
||||
return -1;
|
||||
}
|
||||
return fileSize;
|
||||
}
|
||||
|
||||
async function refreshFileInfo()
|
||||
{
|
||||
const file = document.getElementById("file");
|
||||
if (file.value != "") {
|
||||
const name = document.getElementById("name");
|
||||
name.value = file.files[0].name.substring(0, 40);
|
||||
}
|
||||
|
||||
await fetch("http://192.168.1.66/api/freeslots.json").then(async response => {
|
||||
|
||||
const json = await response.json();
|
||||
const freeSlots = document.getElementById("freeSlots");
|
||||
freeSlots.textContent = json["freeslots"];
|
||||
|
||||
const upload = document.getElementById("upload");
|
||||
const slotsNeeeded = document.getElementById("slotsNeeded");
|
||||
const fileSize = getFileSize();
|
||||
|
||||
if (fileSize < 0) {
|
||||
upload.setAttribute("disabled", "disabled");
|
||||
slotsNeeeded.textContent = "NA";
|
||||
}
|
||||
else
|
||||
{
|
||||
const slotsNeededValue = fileSize / (256 * 1024);
|
||||
slotsNeeeded.textContent = slotsNeededValue;
|
||||
if (slotsNeededValue > json["freeslots"]) {
|
||||
upload.setAttribute("disabled", "disabled");
|
||||
} else {
|
||||
upload.removeAttribute("disabled");
|
||||
}
|
||||
}
|
||||
|
||||
}).catch(error => {
|
||||
//
|
||||
});
|
||||
}
|
||||
|
||||
function setLedColor(ledColor)
|
||||
{
|
||||
ledColorState = ledColor;
|
||||
|
||||
let ledColorText = document.getElementById("ledColor");
|
||||
switch (ledColor) {
|
||||
case 1:
|
||||
ledColorText.textContent = "Red";
|
||||
break;
|
||||
case 2:
|
||||
ledColorText.textContent = "Green";
|
||||
break;
|
||||
case 3:
|
||||
ledColorText.textContent = "Yellow";
|
||||
break;
|
||||
case 4:
|
||||
ledColorText.textContent = "Blue";
|
||||
break;
|
||||
case 5:
|
||||
ledColorText.textContent = "Purple";
|
||||
break;
|
||||
case 6:
|
||||
ledColorText.textContent = "Turquoise";
|
||||
break;
|
||||
case 7:
|
||||
ledColorText.textContent = "White";
|
||||
break;
|
||||
default:
|
||||
ledColorText.textContent = "Off";
|
||||
}
|
||||
}
|
||||
|
||||
async function upload()
|
||||
{
|
||||
const upload = document.getElementById("upload");
|
||||
upload.setAttribute("disabled", "disabled");
|
||||
const file = document.getElementById("file");
|
||||
file.setAttribute("disabled", "disabled");
|
||||
|
||||
const name = document.getElementById("name");
|
||||
|
||||
var data = new FormData();
|
||||
data.append('file', file.files[0]);
|
||||
data.append('body', "{\"ledColor\":" + ledColorState + ",\"bankName\":\"" + name.value + "\"}");
|
||||
await fetch("http://192.168.1.66/api/upload", {
|
||||
method: 'POST',
|
||||
body: data
|
||||
}).then(response => {
|
||||
if (response.status == 200) {
|
||||
window.location.href = "/index.html";
|
||||
} else {
|
||||
uploadFailure();
|
||||
}
|
||||
}).catch(() => {
|
||||
uploadFailure()
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
function uploadFailure()
|
||||
{
|
||||
alert("Upload failed.");
|
||||
let upload = document.getElementById("upload");
|
||||
upload.removeAttribute("disabled");
|
||||
let file = document.getElementById("file");
|
||||
file.removeAttribute("disabled");
|
||||
}
|
|
@ -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</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>
|
|
@ -0,0 +1 @@
|
|||
async function screenshot(){await fetch("http://192.168.1.66/api/screenshot").catch(()=>{content.innerHTML="Failed to connect."}).then(n=>n.blob()).then(n=>{var i=window.URL.createObjectURL(n),t=document.createElement("a");t.href=i;t.download="screenshot.png";document.body.appendChild(t);t.click();t.remove()})}async function reboot(){await fetch("http://192.168.1.66/api/reboot")}async function shutdown(){await fetch("http://192.168.1.66/api/shutdown")}
|
|
@ -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: Launch BIOS</h2><div><span id=content>Please Wait...</span></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><script src=launch.js></script></body></html>
|
|
@ -0,0 +1,53 @@
|
|||
window.onload = function () {
|
||||
getBankInfo();
|
||||
};
|
||||
|
||||
async function getBankInfo() {
|
||||
await fetch("http://192.168.1.66/api/bankinfo.json").then(async response => {
|
||||
|
||||
const json = await response.json();
|
||||
|
||||
let contentBody = "";
|
||||
for (let i = 0; i < json.length; i++) {
|
||||
if (json[i].slots > 0) {
|
||||
contentBody += "<p><div class=\"grid\"><a role=\"button\" href=\"javascript:void(0)\" onclick=\"launchBank(" + json[i].id + ")\">" + json[i].name + "</a></div></p>";
|
||||
}
|
||||
}
|
||||
contentBody += "<p><div class=\"grid\"><a role=\"button\" href=\"javascript:void(0)\" onclick=\"launchTsop()\">TSOP</a></div></p>";
|
||||
|
||||
let content = document.getElementById("content");
|
||||
content.innerHTML = contentBody;
|
||||
}).catch(error => {
|
||||
let content = document.getElementById("content");
|
||||
content.innerHTML = "Failed to connect."
|
||||
});
|
||||
}
|
||||
|
||||
async function launchBank(id)
|
||||
{
|
||||
await fetch("http://192.168.1.66/api/launchbank?" + id).catch(error => {
|
||||
content.innerHTML = "Failed to connect."
|
||||
}).then(response => {
|
||||
if (response.status == 200) {
|
||||
let content = document.getElementById("content");
|
||||
content.innerHTML = "Launching..."
|
||||
} else {
|
||||
let content = document.getElementById("content");
|
||||
content.innerHTML = "Failed to launch."
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function launchTsop() {
|
||||
await fetch("http://192.168.1.66/api/launchtsop").catch(error => {
|
||||
content.innerHTML = "Failed to connect."
|
||||
}).then(response => {
|
||||
if (response.status == 200) {
|
||||
let content = document.getElementById("content");
|
||||
content.innerHTML = "Launching..."
|
||||
} else {
|
||||
let content = document.getElementById("content");
|
||||
content.innerHTML = "Failed to launch."
|
||||
}
|
||||
});
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
.btn-ledoff{color:#fff;background-color:#404040;border-color:#000}.btn-ledoff:hover,.btn-ledoff:focus,.btn-ledoff:active,.btn-ledoff.active{color:#fff;background-color:#202020;border-color:#000}.btn-ledred{color:#000;background-color:#aa0a00;border-color:#000}.btn-ledred:hover,.btn-ledred:focus,.btn-ledred:active,.btn-ledred.active{color:#000;background-color:#d40c00;border-color:#000}.btn-ledgreen{color:#000;background-color:#289a23;border-color:#000}.btn-ledgreen:hover,.btn-ledgreen:focus,.btn-ledgreen:active,.btn-ledgreen.active{color:#000;background-color:#32c12c;border-color:#000}.btn-ledyellow{color:#000;background-color:#cca400;border-color:#000}.btn-ledyellow:hover,.btn-ledyellow:focus,.btn-ledyellow:active,.btn-ledyellow.active{color:#000;background-color:#ffcd00;border-color:#000}.btn-ledblue{color:#000;background-color:#4358cc;border-color:#000}.btn-ledblue:hover,.btn-ledblue:focus,.btn-ledblue:active,.btn-ledblue.active{color:#fff;background-color:#526eff;border-color:#000}.btn-ledpurple{color:#000;background-color:#663fa1;border-color:#000}.btn-ledpurple:hover,.btn-ledpurple:focus,.btn-ledpurple:active,.btn-ledpurple.active{color:#000;background-color:#7f4fc9;border-color:#000}.btn-ledturquoise{color:#000;background-color:#0096ae;border-color:#000}.btn-ledturquoise:hover,.btn-ledturquoise:focus,.btn-ledturquoise:active,.btn-ledturquoise.active{color:#000;background-color:#00bcd9;border-color:#000}.btn-ledwhite{color:#000;background-color:#c0c0c0;border-color:#000}.btn-ledwhite:hover,.btn-ledwhite:focus,.btn-ledwhite:active,.btn-ledwhite.active{color:#000;background-color:#f0f0f0;border-color:#000}
|
File diff suppressed because it is too large
Load diff
|
@ -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: Remote View</h2><div><span id=content>Please Wait...</span></div><br /><div class=grid><a role=button href=javascript:void(0) onclick=screenshot()>Refresh View</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><script src=remoteview.js></script></body></html>
|
|
@ -0,0 +1 @@
|
|||
async function screenshot(){await fetch("http://192.168.1.66/api/screenshot").catch(()=>{content.innerHTML="Failed to connect."}).then(n=>n.blob()).then(n=>{var r=window.URL.createObjectURL(n),t=document.createElement("img");t.src=r;t.alt="Screenshot";t.style="max-width: 100%; height: auto";const i=document.getElementById("content");i.innerHTML="";i.appendChild(t)})}window.onload=function(){screenshot()};
|
|
@ -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: Remove BIOS</h2><div><span id=content>Please Wait...</span></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><script src=remove.js></script></body></html>
|
|
@ -0,0 +1,35 @@
|
|||
window.onload = function () {
|
||||
getBankInfo();
|
||||
};
|
||||
|
||||
async function getBankInfo()
|
||||
{
|
||||
await fetch("http://192.168.1.66/api/bankinfo.json").then(async response => {
|
||||
|
||||
const json = await response.json();
|
||||
|
||||
let contentBody = "";
|
||||
for (let i = 0; i < json.length; i++) {
|
||||
if (json[i].slots > 0) {
|
||||
contentBody += "<p><div class=\"grid\"><a role=\"button\" href=\"javascript:void(0)\" onclick=\"removeBank(" + json[i].id + ")\">" + json[i].name + "</a></div></p>";
|
||||
}
|
||||
}
|
||||
let content = document.getElementById("content");
|
||||
content.innerHTML = contentBody == "" ? "No items found." : contentBody;
|
||||
|
||||
}).catch(error => {
|
||||
|
||||
let content = document.getElementById("content");
|
||||
content.innerHTML = "Failed to connect."
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async function removeBank(id)
|
||||
{
|
||||
await fetch("http://192.168.1.66/api/removebank?" + id).then(() => {
|
||||
getBankInfo();
|
||||
}).catch(error => {
|
||||
content.innerHTML = "Failed to connect."
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue