update esp32_air_pump/data/index.html.

master
慕炎 2022-01-09 08:28:44 +00:00 committed by Gitee
parent 884fd67f77
commit d7623ea797
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 138 additions and 140 deletions

View File

@ -1,7 +1,15 @@
<html lang="zh-cn"> <!--
微型气泵控制板
HW:Ver 1.0
FW:Ver 1.2
-->
<html lang="zh-cn">
<head> <head>
<title>Air Pump Control</title> <title>Air Pump Control</title>
<meta charset="utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="Cache-Control" content="max-age=7200" />
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<style> <style>
/*input框*/ /*input框*/
@ -143,23 +151,18 @@
<script> <script>
var running_type = ["无", "篮球", "摩托车", "汽车", "自行车", "自定义"]; var running_type = ["无", "篮球", "摩托车", "汽车", "自行车", "自定义"];
var pressure_type = [0, 0.6, 2.4, 2.5, 3.9, 2.4]; var pressure_type = [0, 0.6, 2.4, 2.5, 3.9, 2.4];
function loadXMLDoc(path,element)
{ function loadXMLDoc(path, element) {
var xmlhttp; var xmlhttp;
if (window.XMLHttpRequest) if (window.XMLHttpRequest) {
{
// IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码 // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
xmlhttp = new XMLHttpRequest(); xmlhttp = new XMLHttpRequest();
} } else {
else
{
// IE6, IE5 浏览器执行代码 // IE6, IE5 浏览器执行代码
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} }
xmlhttp.onreadystatechange=function() xmlhttp.onreadystatechange = function() {
{ if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById(element).innerHTML = xmlhttp.responseText; document.getElementById(element).innerHTML = xmlhttp.responseText;
} }
} }
@ -167,25 +170,18 @@ function loadXMLDoc(path,element)
xmlhttp.send(); xmlhttp.send();
} }
function UpdateInfo() function UpdateInfo() {
{
var xmlhttp; var xmlhttp;
if (window.XMLHttpRequest) if (window.XMLHttpRequest) {
{
// IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码 // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
xmlhttp = new XMLHttpRequest(); xmlhttp = new XMLHttpRequest();
} } else {
else
{
// IE6, IE5 浏览器执行代码 // IE6, IE5 浏览器执行代码
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} }
xmlhttp.onreadystatechange=function() xmlhttp.onreadystatechange = function() {
{ if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
var arr = xmlhttp.responseText.split(","); var arr = xmlhttp.responseText.split(",");
document.getElementById('bat_voltage').innerHTML = arr[1]; document.getElementById('bat_voltage').innerHTML = arr[1];
if (arr[3] == 1) { if (arr[3] == 1) {
document.getElementById('CurrentMillis').innerHTML = "已启动:" + arr[0]; document.getElementById('CurrentMillis').innerHTML = "已启动:" + arr[0];
@ -207,14 +203,11 @@ function UpdateInfo()
xmlhttp.send(); xmlhttp.send();
} }
function MyAutoRun() {
function MyAutoRun()
{
UpdateInfo(); UpdateInfo();
} }
setInterval("MyAutoRun()", 1000); setInterval("MyAutoRun()", 1000);
function checkNum(obj) { function checkNum(obj) {
if (isNaN(obj.value)) { //检查是否是非数字值 if (isNaN(obj.value)) { //检查是否是非数字值
obj.value = ""; obj.value = "";
@ -241,15 +234,19 @@ function running_type5(obj){
} }
</script> </script>
</head> </head>
<body style="background-color:black;color:white"> <body style="background-color:black;color:white">
<div> <div>
<font size=6>微型气泵状态监控</font> <font size=6>微型气泵状态监控</font>
</div> </div>
<div id="OperationHit"><h2></h2></div> <div id="OperationHit">
<h2></h2>
</div>
<table border="0"> <table border="0">
<tr> <tr>
<td height="50"></font> <span id=CurrentMillis></span> <td height="50">
</font> <span id=CurrentMillis></span>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -298,4 +295,5 @@ function running_type5(obj){
</tr> </tr>
</table> </table>
</body> </body>
</html> </html>