File size: 3,048 Bytes
1e9310c ef2e452 3c11f53 4eba8a4 ea22cb5 d0ddd2f 1e9310c d0ddd2f 5457996 ea22cb5 1e9310c 112c1c4 15e9db2 bd498c0 8b3a17d 87bc521 8cde8ac 8b3a17d e0a7a53 8cde8ac 148022c 2591d1c 87bc521 148022c 2591d1c 148022c e80947e bd498c0 e80947e 87e4a83 e80947e e0a7a53 e80947e 4eb5c05 5526c84 4eb5c05 5526c84 4eb5c05 5526c84 4eb5c05 9c1fe58 112c1c4 8b1734c 93c573b 1e9310c 9159ff4 1e9310c 28742bb e80947e 4eb5c05 b3f874e 1e9310c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>My static Space</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: inner-spin-button;
opacity: 1;
}
input[type="number"] {
-moz-appearance: textfield;
}
</style>
</head>
<body>
<div class="container mt-3">
<div class="container text-center">
<h1>Настройки системы</h1>
</div>
<br>
<h4>Уровень pH</h4>
<p>EEPROM : <span id="pH_eep"></span></p>
<form>
<label for="pH_set">Новое : </label>
<input type="number" id="pH_set" value="5.6" min="1" max="14" step="0.01">
</form>
<br>
<h4>pH доз. ON sec.</h4>
<p>EEPROM : <span id="ph_on_eep"></span></p>
<form>
<label for="ph_on_eep_set">Новое : </label>
<input type="number" id="ph_on_eep_set" value="2.5" min="0.1" max="20" step="0.01">
</form>
<br>
<h4>Уровень EC</h4>
<p>EEPROM : <span id="ec_eep"></span></p>
<form>
<label for="ec_eep_set">Новое : </label>
<input type="number" id="ec_eep_set" value="0.85" min="0.1" max="4" step="0.01">
</form>
<br>
<h4>EC доз. A_ON sec.</h4>
<p>EEPROM : <span id="ec_A_eep"></span></p>
<form>
<label for="ec_A_eep_set">Новое : </label>
<input type="number" id="ec_A_eep_set" value="1.5" min="0.1" max="20" step="0.01">
</form>
<br>
<h4>EC доз. B_ON sec.</h4>
<p>EEPROM : <span id="ec_B_eep"></span></p>
<form>
<label for="ec_B_eep_set">Новое : </label>
<input type="number" id="ec_B_eep_set" value="1.5" min="0.1" max="20" step="0.01">
</form>
<br>
<h4>EC доз. C_ON sec.</h4>
<p>EEPROM : <span id="ec_C_eep"></span></p>
<form>
<label for="ec_C_eep_set">Новое : </label>
<input type="number" id="ec_C_eep_set" value="1.5" min="0.1" max="20" step="0.01">
</form>
</div>
<script>
function updateValues(data) {
document.getElementById("pH_eep").textContent = data.ph_eep;
document.getElementById("ph_on_eep").textContent = data.ph_on_eep;
document.getElementById("ec_eep").textContent = data.ec_eep;
document.getElementById("ec_A_eep").textContent = data.ec_A_eep;
document.getElementById("ec_B_eep").textContent = data.ec_B_eep;
document.getElementById("ec_C_eep").textContent = data.ec_C_eep;
}
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> |