You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
HTML
46 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Simple Sensor Dashboard</title>
|
|
<style>
|
|
body { font-family: Arial, sans-serif; text-align: center; }
|
|
.sensor { margin: 10px; padding: 10px; border: 1px solid #ccc; }
|
|
.sensor-title { font-weight: bold; }
|
|
.sensor-value { font-size: 2em; color: #333; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<h1>EZO RTD Temperature Monitor</h1>
|
|
|
|
<div id="temperature" class="sensor">
|
|
<div class="sensor-title">Temperature</div>
|
|
<div class="sensor-value" id="temp-value">--</div>
|
|
<div id="last-update">--</div>
|
|
</div>
|
|
|
|
<script>
|
|
async function fetchData() {
|
|
try {
|
|
const response = await fetch('./data/EZORTD.json');
|
|
const data = await response.json();
|
|
|
|
document.getElementById('temp-value').textContent =
|
|
data.temperature.toFixed(3) + ' ℃';
|
|
document.getElementById('last-update').textContent =
|
|
"Updated: " + new Date().toLocaleTimeString();
|
|
|
|
} catch (error) {
|
|
console.error('Error fetching data:', error);
|
|
}
|
|
}
|
|
|
|
setInterval(fetchData, 1000);
|
|
fetchData();
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|