test2
This commit is contained in:
1 parent
a7ef7c11ae
commit
eb770487dc
1 file changed
+18
@@ -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 -->
|
||||
<!-- ======================= -->
|
||||
|
||||
Reference in new issue
Block a user