-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a stop and restart ocurre, we lose the tracking #3
Comments
hello again, the same thing keeps happening, after several hours of running, the application has the following error.. |
add this little routine to the status.html page to generate the output csv file for the contacts you select... it's not very elegant, but it's functional. Insert this code inside the HTML file, just before the tag. <script> // Function to export contacts to CSV function exportToCSV() { const rows = []; // Add CSV header rows.push(["JID", "Username", "Status", "Time"]); // Get current time in format HH:MM:SS const currentTime = new Date().toLocaleTimeString(); // Traverses through the elements of each contact and extracts data document.querySelectorAll('.chart-container').forEach(container => { const jid = container.querySelector('.chart-title').textContent; const username = container.querySelector('.chart-username').textContent || 'Unknown'; const status = container.querySelector('.status-indicator').textContent; // Add each contact as a row in the CSV along with time rows.push([jid, username, status, currentTime]); }); // Convert the rows to CSV format let csvContent = "data:text/csv;charset=utf-8," + rows.map(e => e.join(",")).join("\n"); // Create a link for downloading the CSV file const encodedUri = encodeURI(csvContent); const link = document.createElement("a"); link.setAttribute("href", encodedUri); link.setAttribute("download", "contacts_status.csv"); // Simulates the click to start the download document.body.appendChild(link); link.click(); document.body.removeChild(link); console.log("CSV Exported at", currentTime); } // Export CSV every minute (60,000 ms) setInterval(exportToCSV, 60000); </script> |
When happen something like "[Client/Socket ERROR] Error closing websocket: tls: failed to send closeNotify alert (but connection was closed anyway): write tcp [2800:300:6f31:d730:1876:2c0d:65c:415a]:49273->[2a03:2880:f247:c6:face:b00c:0:167]:443: write: broken pipe" and you stop and restart the program... you lose all the tracking data.. is possible to have an saving data every 5 minutes in a csv or restore the old data?
The text was updated successfully, but these errors were encountered: