From 6b43c51ae2bc32eca15beda8188c3a779c74c420 Mon Sep 17 00:00:00 2001
From: turai <1094872+turai@users.noreply.github.com>
Date: Tue, 26 Aug 2025 19:08:01 +0200
Subject: [PATCH 1/3] Expose HDD locking on web
---
.../PrometheOSWeb/wwwroot/hddlock.html | 30 +
.../PrometheOSWeb/wwwroot/hddlock.js | 50 +
.../PrometheOSWeb/wwwroot/index.html | 4 +
.../PrometheOSWeb/wwwroot/utilities.html | 29 +
.../PrometheOSXbe/PrometheOSXbe.vcproj | 5143 +++++++++--------
PrometheOSXbe/PrometheOSXbe/main.cpp | 77 +
PrometheOSXbe/PrometheOSXbe/resources.h | 3 +
7 files changed, 2775 insertions(+), 2561 deletions(-)
create mode 100644 PrometheOSUtility/PrometheOSWeb/wwwroot/hddlock.html
create mode 100644 PrometheOSUtility/PrometheOSWeb/wwwroot/hddlock.js
create mode 100644 PrometheOSUtility/PrometheOSWeb/wwwroot/utilities.html
diff --git a/PrometheOSUtility/PrometheOSWeb/wwwroot/hddlock.html b/PrometheOSUtility/PrometheOSWeb/wwwroot/hddlock.html
new file mode 100644
index 0000000..5b7525e
--- /dev/null
+++ b/PrometheOSUtility/PrometheOSWeb/wwwroot/hddlock.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+ PrometheOS
+
+
+
+
+
+
+
+
+
+
diff --git a/PrometheOSUtility/PrometheOSWeb/wwwroot/hddlock.js b/PrometheOSUtility/PrometheOSWeb/wwwroot/hddlock.js
new file mode 100644
index 0000000..4eb7171
--- /dev/null
+++ b/PrometheOSUtility/PrometheOSWeb/wwwroot/hddlock.js
@@ -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 = `