Add meta feed functionality and enhance error handling in catalog API

This commit is contained in:
“VeLiTi”
2025-12-03 11:30:01 +01:00
parent 04b9814c07
commit 990f270855
6 changed files with 336 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
var port, textEncoder, writableStreamClosed, writer, historyIndex = -1;
const lineHistory = [];
maintenanceRun = 0;
handshakeComplete = false;
let maintenanceRun = 0;
let handshakeComplete = false;
// Function to log communication to API
async function logCommunication(data, direction) {
@@ -102,6 +102,7 @@ async function connectSerial() {
// Log connection failure details
await logCommunication(`Serial connection failed: ${error.message || 'Unknown error'}`, 'disconnected');
alert("Serial Connection Failed");
window.location.reload();
}
}
@@ -580,7 +581,7 @@ async function closePort(){
maintenanceRun = 0; // reset maintenanceRun
// Refresh the page
window.location.reload();
setTimeout(() => {window.location.reload();}, 500);
}
async function closePortCarTest(){
@@ -736,7 +737,7 @@ async function updateHistory(){
body: testdetails
});
const historyresult = await response.json;
const historyresult = await response.json();
setTimeout(maintenanceTest,5000);
@@ -805,5 +806,6 @@ async function updateHistory(){
catch(e)
{
alert(e.message || e);
window.location.reload();
}
}