added debug text

This commit is contained in:
2026-09-04 19:51:27 -07:00
parent b8e474cb92
commit 49b2a7622b
2 changed files with 26 additions and 27 deletions

View File

@@ -195,6 +195,9 @@
<div class="loader-container">
<div class="loader-card">
<div class="status-text" id="status-message">Starting runtime engine...</div>
<div id="debug-log-box"
style="display: none; width: 100%; max-height: 180px; overflow-y: auto; background: rgba(255, 50, 50, 0.12); border: 1px solid rgba(255, 100, 100, 0.3); border-radius: 8px; padding: 12px; font-family: monospace; font-size: 12px; color: #fca5a5; text-align: left; white-space: pre-wrap; word-break: break-all; margin-bottom: 20px; user-select: text;">
</div>
<div class="progress-track" id="progress-track" style="display: none;">
<div class="progress-fill" id="progress-fill"></div>
</div>
@@ -257,7 +260,7 @@
</div>
</div>
</div>
</div>
</div>
<script type="module">
@@ -500,6 +503,7 @@ void main() {
<script>
const statusEl = document.getElementById("status-message");
const debugBox = document.getElementById("debug-log-box");
const progressTrack = document.getElementById("progress-track");
const progressFill = document.getElementById("progress-fill");
const actionsEl = document.getElementById("update-actions");
@@ -524,6 +528,12 @@ void main() {
});
}
function showDebug(msg) {
if (!debugBox) return;
debugBox.style.display = "block";
debugBox.textContent = msg;
}
async function initTauriEvents() {
const eventApi = window.__TAURI__?.event || window.__TAURI_INTERNALS__;
if (!eventApi || typeof eventApi.listen !== 'function') {
@@ -567,23 +577,15 @@ void main() {
});
eventApi.listen("error", (e) => {
setStatus("Cleaning up background processes...", "#fca5a5");
try {
const core = window.__TAURI__?.core;
if (core) {
core.invoke("kill_orphans").finally(() => {
setTimeout(() => {
core.invoke("win_close").catch(() => {});
}, 500);
});
}
} catch (err) { }
const data = e.payload || e;
const msg = data && data.message ? data.message : JSON.stringify(data);
setStatus("Runtime Error", "#fca5a5");
showDebug(msg);
});
}
btnYes.addEventListener("click", () => {
if (actionsEl) actionsEl.style.display = "none";
if (actionsEl) actionsEl.style.display = "none";
setStatus("Starting update installation...");
fetch("http://127.0.0.1:4891/update/yes", { method: "POST" }).catch(() => { });
});