Add live console output streaming

This commit is contained in:
2026-01-01 17:48:35 +11:00
parent c9cfb19174
commit 1d149443d5
2 changed files with 73 additions and 6 deletions

View File

@@ -210,6 +210,7 @@ let statusInterval = null;
async function checkScanStatus() {
const statusBadge = document.getElementById("scan-status");
const stopBtn = document.getElementById("stop-scan-btn");
const consoleOutput = document.getElementById("console-output");
if (!statusBadge) return;
try {
@@ -227,6 +228,26 @@ async function checkScanStatus() {
if (stopBtn) stopBtn.style.display = "none";
stopStatusPolling();
}
// Update console with log content
if (consoleOutput && (result.logContent || result.workspaceOutput)) {
let output = "UltyScan Console\n";
output += "================\n";
if (result.latestLogFile) {
output += `Log: ${result.latestLogFile}\n`;
}
output += `Time: ${result.timestamp}\n`;
output += "----------------\n\n";
if (result.workspaceOutput) {
output += result.workspaceOutput;
} else if (result.logContent) {
output += result.logContent;
}
consoleOutput.textContent = output;
consoleOutput.scrollTop = consoleOutput.scrollHeight;
}
} catch (error) {
console.error("Status check failed:", error);
}