Spaces:
Runtime error
Runtime error
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>My static Space</title> | |
<link rel="stylesheet" href="https://huggingface.co/spaces/vk-ai-system/flask_inference_api/resolve/main/style.css" /> | |
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> | |
</head> | |
<body> | |
<h1>Онлайн данные системы</h1> | |
<p>День : <span id="dey">{{ dey }}</span></p> | |
<p>Неделя: <span id="wek">{{ wek }}</span></p> | |
<br> | |
<p>PH раствора: <span id="ph">{{ ph }}</span></p> | |
<p>EC раствора: <span id="ec">{{ ec }}</span></p> | |
<p>Т. раствора: <span id="tS">{{ tS }}</span></p> | |
<p>Т. воздуха: <span id="tA">{{ tA }}</span></p> | |
<p>Вл. воздуха: <span id="hDm">{{ hDm }}</span></p> | |
<p>Об. вентилятора: <span id="sVen">{{ sVen }}</span></p> | |
<script> | |
document.addEventListener("DOMContentLoaded", function() { | |
function updateValues(deyValue, wekValue, phValue, ecValue, tSValue, tAValue, hDmValue, sVenValue) { | |
document.getElementById("dey").textContent = deyValue; | |
document.getElementById("wek").textContent = wekValue; | |
document.getElementById("ph").textContent = phValue; | |
document.getElementById("ec").textContent = ecValue; | |
document.getElementById("tS").textContent = tSValue; | |
document.getElementById("tA").textContent = tAValue; | |
document.getElementById("hDm").textContent = hDmValue; | |
document.getElementById("sVen").textContent = sVenValue; | |
} | |
function fetchValues() { | |
fetch("/zapro") | |
.then(response => response.json()) | |
.then(data => updateValues(data.dey, data.wek, data.ph, data.ec, data.tS, data.tA, data.hDm, data.sVen)) | |
.catch(error => console.error("Error:", error)); | |
} | |
fetchValues(); | |
setInterval(fetchValues, 10000); | |
}); | |
</script> | |
</body> | |
</html> |