Spaces:
Sleeping
Sleeping
<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> | |
<style> | |
#form_ph input[type="number"] { | |
border: 2px solid green; /* Зелёная рамка */ | |
} | |
#form_ph input[type="number"]::-webkit-inner-spin-button, | |
#form_ph input[type="number"]::-webkit-outer-spin-button { | |
/* Стилизация стрелок вверх и вниз */ | |
-webkit-appearance: none; | |
appearance: none; | |
background-color: cyan; /* Фоновый цвет */ | |
color: black; /* Цвет стрелок */ | |
cursor: pointer; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Настройки системы</h1> | |
<p>День : <span id="dey"></span></p> | |
<form id="form_ph"> | |
<p>Укажите нормальную среднюю температуру человека:</p> | |
<p><input type="number" name="pH" value="7" min="1" max="14" step="0.05"></p> | |
</form> | |
<script> | |
function updateValues(data) { | |
document.getElementById("dey").textContent = data.dey; | |
} | |
function fetchValues() { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", "/settings_api", true); | |
xhr.setRequestHeader("Content-Type", "application/json"); | |
xhr.onreadystatechange = function () { | |
if (xhr.readyState === 4 && xhr.status === 200) { | |
var response = JSON.parse(xhr.responseText); | |
updateValues(response); | |
} | |
}; | |
xhr.send(); | |
} | |
fetchValues(); | |
setInterval(fetchValues, 10000); | |
</script> | |
</body> | |
</html> |