diff --git a/app.js b/app.js
index 696d290..ae5fa68 100644
--- a/app.js
+++ b/app.js
@@ -14,6 +14,9 @@ const orgRoamBtn = document.getElementById("orgRoamBtn");
const orgRoamResult = document.getElementById("orgRoamResult");
const orgRoamLogs = document.getElementById("orgRoamLogs");
+const orgRoamBtn2 = document.getElementById("orgRoamBtn2");
+
+let emacsEventSource = null;
let webEventSource = null;
let roamEventSource = null;
@@ -190,6 +193,73 @@ async function pollRoamStatus() {
}, 2000);
}
+/* =========================================
+ORG ROAM BUILD 2 (EXAMPLE OF SECOND BUILD BUTTON)
+========================================= */
+
+async function rerunEmacs() {
+
+ if (!confirm("Rerun Emacs now?")) return;
+
+ orgRoamBtn2.disabled = true;
+ orgRoamResult.textContent = "π Running Emacs...";
+ roamDot.className = "dot yellow";
+ orgRoamLogs.textContent = "";
+
+ try {
+
+ const res = await fetch("/api/rerun-emacs", { method: "POST" });
+ if (!res.ok) throw new Error();
+
+ closeStream(emacsEventSource);
+
+ startLogStream("/api/rerun-emacs/logs", orgRoamLogs, src => emacsEventSource = src);
+
+ pollEmacsStatus();
+
+ } catch {
+
+ orgRoamResult.textContent = "β Could not start Emacs";
+ orgRoamBtn2.disabled = false;
+ roamDot.className = "dot red";
+
+ }
+
+}
+async function pollEmacsStatus() {
+
+ const interval = setInterval(async () => {
+
+ const res = await fetch("/api/rerun-emacs/status");
+ const status = await res.json();
+
+ if (!status.running) {
+
+ clearInterval(interval);
+ closeStream(emacsEventSource);
+
+ orgRoamBtn2.disabled = false;
+
+ if (status.lastExitCode === 0 || status.lastExitCode === 124) {
+
+ orgRoamResult.textContent = "β
Emacs completed";
+ roamDot.className = "dot green";
+
+ } else {
+
+ orgRoamResult.textContent =
+ "β Emacs finished with issue (code " + status.lastExitCode + ")";
+
+ roamDot.className = "dot red";
+
+ }
+
+ }
+
+ }, 2000);
+
+}
+
/* =========================================
DAILY MESSAGE
========================================= */
@@ -250,3 +320,4 @@ startCountdown();
fetchHealth();
buildBtn.addEventListener("click", runWebBuild);
orgRoamBtn.addEventListener("click", runOrgRoamBuild);
+orgRoamBtn2.addEventListener("click", rerunEmacs);
diff --git a/index.html b/index.html
index 7333bab..e61c8a6 100644
--- a/index.html
+++ b/index.html
@@ -2,126 +2,869 @@
+
Home Server Control
-
+
+
+
-
+
+
+
- π Home Server Control
-
-
-
+
-
π Quick Links
-
-
-
-
-
- π’ All Systems Running Normally
+
+
-
-
-
- Server
-
-
-
- Website
-
-
-
-
Org Notes
-
+
+
+
+
All Systems Running Normally
+
+
+
+
-
-
- π‘ Server Status
-
- Health:
- Checking...
-
-
-
+
+
Personal
-
-
- π Website
+
-
- π€ Waiting for action
+
-
+
+ Services
-
-
+
-
-
- π Knowledge Base
+
+ Monitoring
-
- π€ Waiting for action
+
+
-
+
+
-
-
+
+
Ping History (30 checks)β
+
+
+
+
-
+
+ Actions
-
+
+
+
+
+
+
+
+
π€ Waiting for action
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
β‘ Emacs
+
β
+
βΆ Notes
+
+
+
π€ Waiting for action
+
+
+
+
+
+
+
+
+
+
+
Confirm Action
+
Are you sure?
+
+
+
+
+
+
+
+