mirror of
https://github.com/DeNNiiInc/UltyScan.git
synced 2026-04-17 18:26:00 +00:00
Fix sudo bash command and preserve console output
This commit is contained in:
@@ -229,24 +229,27 @@ async function checkScanStatus() {
|
|||||||
stopStatusPolling();
|
stopStatusPolling();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update console with log content
|
// Update console with log content - only if there's actual content
|
||||||
if (consoleOutput && (result.logContent || result.workspaceOutput)) {
|
if (consoleOutput) {
|
||||||
let output = "UltyScan Console\n";
|
if (result.logContent || result.workspaceOutput) {
|
||||||
output += "================\n";
|
let output = "UltyScan Console\n";
|
||||||
if (result.latestLogFile) {
|
output += "================\n";
|
||||||
output += `Log: ${result.latestLogFile}\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;
|
||||||
}
|
}
|
||||||
output += `Time: ${result.timestamp}\n`;
|
// Don't clear console if there's no log content - keep existing content
|
||||||
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) {
|
} catch (error) {
|
||||||
console.error("Status check failed:", error);
|
console.error("Status check failed:", error);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
define('SNIPER_PATH', 'sudo /usr/share/sniper/sniper');
|
define('SNIPER_PATH', 'sudo bash /usr/share/sniper/sniper');
|
||||||
define('LOG_DIR', '/var/log/ultyscan');
|
define('LOG_DIR', '/var/log/ultyscan');
|
||||||
|
|
||||||
// Ensure log directory exists
|
// Ensure log directory exists
|
||||||
|
|||||||
Reference in New Issue
Block a user