This commit is contained in:
DeSqBlocki committed 2025-12-06 19:33:32 +01:00
1 parent a7ef7c11ae
commit eb770487dc
1 file changed
+18
+18
View File
@@ -136,7 +136,25 @@
</div>
</div>
<script>
async function fetchLogs() {
try {
const res = await fetch('/home/pm2/.pm2/logs/proxerdl-worker1-out.log');
const text = await res.text();
document.getElementById('pm2Logs').textContent = text;
// auto-scroll to bottom
const logDiv = document.getElementById('pm2Logs');
logDiv.scrollTop = logDiv.scrollHeight;
} catch (err) {
console.error('Error fetching logs:', err);
}
}
// fetch logs every 2 seconds
setInterval(fetchLogs, 2000);
// initial fetch
fetchLogs();
</script>
<!-- ======================= -->
<!-- AUTO-REFRESH SCRIPT -->
<!-- ======================= -->