File size: 1,022 Bytes
58f870a
 
 
 
 
 
 
5e8ef40
58f870a
 
 
 
 
 
291e8c2
19d121f
d60b019
 
5b86fd1
739b49d
 
 
 
d60b019
 
739b49d
 
 
 
 
 
 
 
e9872d6
739b49d
 
 
 
 
 
 
 
58f870a
291e8c2
58f870a
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
<!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://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>Zapro</h1>
  <p>PH значение: <span id="ph">{{ ph }}</span></p>
  <p>EC значение: <span id="ec">{{ ec }}</span></p>


  <script>
    $(document).ready(function() {
      function updateValues(phValue, ecValue) {
        $("#ph").text(phValue);
        $("#ec").text(ecValue);
      }

      function fetchValues() {
        $.ajax({
          url: "/zapro",
          method: "GET",
          dataType: "json",
          success: function(response) {
            updateValues(response.ph, response.ec);
          }
        });
      }

      fetchValues();
      setInterval(fetchValues, 10000);
    });
  </script>
      
</body>
</html>