Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamBenes3 committed Dec 1, 2023
1 parent 8151ab9 commit 575d75d
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,13 @@
var currentTimestamp = new Date();
var timeDifferenceInSeconds = (currentTimestamp - timestamp) / 1000;
if (timeDifferenceInSeconds < 60) {
timestampBackgroundColor = 'green';
timestampBackgroundColor = 'rgba(0, 128, 0, 0.7)';
} else if (timeDifferenceInSeconds >= 60 && timeDifferenceInSeconds <= 300) {
timestampBackgroundColor = 'orange';
timestampBackgroundColor = 'rgba(255, 165, 0, 0.7)';
} else {
timestampBackgroundColor = 'red';
timestampBackgroundColor = 'rgba(255, 0, 0, 0.7)';
}
document.getElementById('cdpHb').textContent = timestamp.toLocaleString() + ", Time difference: " + timeDifferenceInSeconds;
document.getElementById('cdpHb').textContent = timestamp.toLocaleString() + ", (-" + timeDifferenceInSeconds + "s)";
document.getElementById('cdpHb').style.backgroundColor = timestampBackgroundColor;
}
Expand All @@ -416,13 +416,13 @@
var currentTimestamp = new Date();
var timeDifferenceInSeconds = (currentTimestamp - timestamp) / 1000;
if (timeDifferenceInSeconds < 60) {
timestampBackgroundColor = 'green';
timestampBackgroundColor = 'rgba(0, 128, 0, 0.7)';
} else if (timeDifferenceInSeconds >= 60 && timeDifferenceInSeconds <= 300) {
timestampBackgroundColor = 'orange';
timestampBackgroundColor = 'rgba(255, 165, 0, 0.7)';
} else {
timestampBackgroundColor = 'red';
timestampBackgroundColor = 'rgba(255, 0, 0, 0.7)';
}
document.getElementById('car1Hb').textContent = timestamp.toLocaleString() + ", Time difference: " + timeDifferenceInSeconds;
document.getElementById('car1Hb').textContent = timestamp.toLocaleString() + ", (-" + timeDifferenceInSeconds + "s)";
document.getElementById('car1Hb').style.backgroundColor = timestampBackgroundColor;
}
Expand All @@ -432,13 +432,13 @@
var currentTimestamp = new Date();
var timeDifferenceInSeconds = (currentTimestamp - timestamp) / 1000;
if (timeDifferenceInSeconds < 60) {
timestampBackgroundColor = 'green';
timestampBackgroundColor = 'rgba(0, 128, 0, 0.7)';
} else if (timeDifferenceInSeconds >= 60 && timeDifferenceInSeconds <= 300) {
timestampBackgroundColor = 'orange';
timestampBackgroundColor = 'rgba(255, 165, 0, 0.7)';
} else {
timestampBackgroundColor = 'red';
timestampBackgroundColor = 'rgba(255, 0, 0, 0.7)';
}
document.getElementById('car2Hb').textContent = timestamp.toLocaleString() + ", Time difference: " + timeDifferenceInSeconds;
document.getElementById('car2Hb').textContent = timestamp.toLocaleString() + ", (-" + timeDifferenceInSeconds + "s)";
document.getElementById('car2Hb').style.backgroundColor = timestampBackgroundColor;
}
function updateStaticTableWithcar3Hb(HbData) {
Expand All @@ -447,13 +447,13 @@
var currentTimestamp = new Date();
var timeDifferenceInSeconds = (currentTimestamp - timestamp) / 1000;
if (timeDifferenceInSeconds < 60) {
timestampBackgroundColor = 'green';
timestampBackgroundColor = 'rgba(0, 128, 0, 0.7)';
} else if (timeDifferenceInSeconds >= 60 && timeDifferenceInSeconds <= 300) {
timestampBackgroundColor = 'orange';
timestampBackgroundColor = 'rgba(255, 165, 0, 0.7)';
} else {
timestampBackgroundColor = 'red';
timestampBackgroundColor = 'rgba(255, 0, 0, 0.7)';
}
document.getElementById('car3Hb').textContent = timestamp.toLocaleString() + ", Time difference: " + timeDifferenceInSeconds;
document.getElementById('car3Hb').textContent = timestamp.toLocaleString() + ", (-" + timeDifferenceInSeconds + "s)";
document.getElementById('car3Hb').style.backgroundColor = timestampBackgroundColor;
}
function updateStaticTableWithldpHb(HbData) {
Expand All @@ -462,13 +462,13 @@
var currentTimestamp = new Date();
var timeDifferenceInSeconds = (currentTimestamp - timestamp) / 1000;
if (timeDifferenceInSeconds < 60) {
timestampBackgroundColor = 'green';
timestampBackgroundColor = 'rgba(0, 128, 0, 0.7)';
} else if (timeDifferenceInSeconds >= 60 && timeDifferenceInSeconds <= 300) {
timestampBackgroundColor = 'orange';
timestampBackgroundColor = 'rgba(255, 165, 0, 0.7)';
} else {
timestampBackgroundColor = 'red';
timestampBackgroundColor = 'rgba(255, 0, 0, 0.7)';
}
document.getElementById('ldpHb').textContent = timestamp.toLocaleString() + ", Time difference: " + timeDifferenceInSeconds;
document.getElementById('ldpHb').textContent = timestamp.toLocaleString() + ", (-" + timeDifferenceInSeconds + "s)";
document.getElementById('ldpHb').style.backgroundColor = timestampBackgroundColor;
}
Expand Down

0 comments on commit 575d75d

Please sign in to comment.