update esp32_air_pump/data/index.html.
parent
884fd67f77
commit
d7623ea797
|
@ -1,8 +1,16 @@
|
|||
<html lang="zh-cn">
|
||||
<!--
|
||||
微型气泵控制板
|
||||
HW:Ver 1.0
|
||||
FW:Ver 1.2
|
||||
-->
|
||||
<html lang="zh-cn">
|
||||
|
||||
<head>
|
||||
<title>Air Pump Control</title>
|
||||
<meta charset="utf-8">
|
||||
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
|
||||
<title>Air Pump Control</title>
|
||||
<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">
|
||||
<style>
|
||||
/*input框*/
|
||||
input,
|
||||
|
@ -140,116 +148,105 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
var running_type = ["无", "篮球", "摩托车", "汽车", "自行车", "自定义"];
|
||||
var pressure_type = [0, 0.6, 2.4, 2.5, 3.9, 2.4];
|
||||
function loadXMLDoc(path,element)
|
||||
{
|
||||
<script>
|
||||
var running_type = ["无", "篮球", "摩托车", "汽车", "自行车", "自定义"];
|
||||
var pressure_type = [0, 0.6, 2.4, 2.5, 3.9, 2.4];
|
||||
|
||||
function loadXMLDoc(path, element) {
|
||||
var xmlhttp;
|
||||
if (window.XMLHttpRequest)
|
||||
{
|
||||
if (window.XMLHttpRequest) {
|
||||
// IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
|
||||
xmlhttp=new XMLHttpRequest();
|
||||
}
|
||||
else
|
||||
{
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
} else {
|
||||
// IE6, IE5 浏览器执行代码
|
||||
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
xmlhttp.onreadystatechange=function()
|
||||
{
|
||||
if (xmlhttp.readyState==4 && xmlhttp.status==200)
|
||||
{
|
||||
document.getElementById(element).innerHTML=xmlhttp.responseText;
|
||||
xmlhttp.onreadystatechange = function() {
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
||||
document.getElementById(element).innerHTML = xmlhttp.responseText;
|
||||
}
|
||||
}
|
||||
xmlhttp.open("GET",path,true);
|
||||
xmlhttp.open("GET", path, true);
|
||||
xmlhttp.send();
|
||||
}
|
||||
}
|
||||
|
||||
function UpdateInfo()
|
||||
{
|
||||
function UpdateInfo() {
|
||||
var xmlhttp;
|
||||
if (window.XMLHttpRequest)
|
||||
{
|
||||
if (window.XMLHttpRequest) {
|
||||
// IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
|
||||
xmlhttp=new XMLHttpRequest();
|
||||
}
|
||||
else
|
||||
{
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
} else {
|
||||
// IE6, IE5 浏览器执行代码
|
||||
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
xmlhttp.onreadystatechange=function()
|
||||
{
|
||||
if (xmlhttp.readyState==4 && xmlhttp.status==200)
|
||||
{
|
||||
var arr=xmlhttp.responseText.split(",");
|
||||
|
||||
document.getElementById('bat_voltage').innerHTML=arr[1];
|
||||
if(arr[3]==1){
|
||||
document.getElementById('CurrentMillis').innerHTML="已启动:"+arr[0];
|
||||
}else{
|
||||
document.getElementById('CurrentMillis').innerHTML="未启动";
|
||||
xmlhttp.onreadystatechange = function() {
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
||||
var arr = xmlhttp.responseText.split(",");
|
||||
document.getElementById('bat_voltage').innerHTML = arr[1];
|
||||
if (arr[3] == 1) {
|
||||
document.getElementById('CurrentMillis').innerHTML = "已启动:" + arr[0];
|
||||
} else {
|
||||
document.getElementById('CurrentMillis').innerHTML = "未启动";
|
||||
}
|
||||
document.getElementById('running_type').innerHTML=arr[4];
|
||||
document.getElementById('running_pressure_type').value=arr[5];
|
||||
document.getElementById('running_type').innerHTML = arr[4];
|
||||
document.getElementById('running_pressure_type').value = arr[5];
|
||||
running_type5(arr[4]);
|
||||
if(arr[2]=="-1.00"){
|
||||
document.getElementById('pressure_val').innerHTML="<font color='red'>传感器异常</font>";
|
||||
document.getElementById('running_type_html').innerHTML=document.getElementById('running_type_html').innerHTML+" <font color='red'>传感器异常,启动会限制执行1分钟</font>";
|
||||
}else{
|
||||
document.getElementById('pressure_val').innerHTML=arr[2];
|
||||
if (arr[2] == "-1.00") {
|
||||
document.getElementById('pressure_val').innerHTML = "<font color='red'>传感器异常</font>";
|
||||
document.getElementById('running_type_html').innerHTML = document.getElementById('running_type_html').innerHTML + " <font color='red'>传感器异常,启动会限制执行1分钟</font>";
|
||||
} else {
|
||||
document.getElementById('pressure_val').innerHTML = arr[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
xmlhttp.open("GET",'/update',true);
|
||||
xmlhttp.open("GET", '/update', true);
|
||||
xmlhttp.send();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function MyAutoRun()
|
||||
{
|
||||
function MyAutoRun() {
|
||||
UpdateInfo();
|
||||
}
|
||||
setInterval("MyAutoRun()",1000);
|
||||
setInterval("MyAutoRun()", 1000);
|
||||
|
||||
|
||||
function checkNum(obj) {
|
||||
function checkNum(obj) {
|
||||
if (isNaN(obj.value)) { //检查是否是非数字值
|
||||
obj.value = "";
|
||||
}
|
||||
if (obj != null) { //检查小数点后是否对于两位
|
||||
if ( obj.value.toString().split(".").length > 1 && obj.value.toString().split(".")[1].length > 2 ) { //alert("小数点后多于两位!");
|
||||
if (obj.value.toString().split(".").length > 1 && obj.value.toString().split(".")[1].length > 2) { //alert("小数点后多于两位!");
|
||||
obj.value = Number(obj.value).toPrecision(2);
|
||||
}
|
||||
if(obj.value<0){
|
||||
obj.value = 0-obj.value;
|
||||
if (obj.value < 0) {
|
||||
obj.value = 0 - obj.value;
|
||||
}
|
||||
if(obj.value>6){
|
||||
if (obj.value > 6) {
|
||||
obj.value = 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function running_type5(obj){
|
||||
document.getElementById('running_type_html').innerHTML=running_type[obj];
|
||||
document.getElementById('running_type').value=obj;
|
||||
if(obj!="5"){
|
||||
document.getElementById('running_pressure_type').value=pressure_type[obj];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
function running_type5(obj) {
|
||||
document.getElementById('running_type_html').innerHTML = running_type[obj];
|
||||
document.getElementById('running_type').value = obj;
|
||||
if (obj != "5") {
|
||||
document.getElementById('running_pressure_type').value = pressure_type[obj];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body style="background-color:black;color:white">
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<font size=6>微型气泵状态监控</font>
|
||||
</div>
|
||||
<div id="OperationHit"><h2></h2></div>
|
||||
</div>
|
||||
<div id="OperationHit">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td height="50"></font> <span id=CurrentMillis></span>
|
||||
<td height="50">
|
||||
</font> <span id=CurrentMillis></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -298,4 +295,5 @@ function running_type5(obj){
|
|||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue