wt32powermeter/index.h
Michael Clemens // DK1MI 649128c479 „index.h“ ändern
2023-04-24 12:27:35 +00:00

112 lines
2.4 KiB
C

const char MAIN_page[] PROGMEM = R"=====(
<!DOCTYPE html>
<html>
<style>
.card{
max-width: 500px;
min-height: 200px;
background: #02b875;
padding: 30px;
box-sizing: border-box;
color: #FFF;
margin:20px;
box-shadow: 0px 2px 18px -4px rgba(0,0,0,0.75);
}
</style>
<body>
<div class="card">
<h1>FWD Voltage</h1>
<h1><span id="FWDValue">0</span>mV</h1>
</div>
<div class="card">
<h1>REF Voltage</h1>
<h1><span id="REFValue">0</span>mV</h1>
</div>
<div class="card">
<h1>DRV Voltage</h1>
<h1><span id="DRVValue">0</span>mV</h1>
</div>
<div class="card">
<h1>SWR</h1>
<h1><span id="SWRValue">0</span>mV</h1>
</div>
<div class="card">
<h1>Temperature</h1>
<h1><span id="TEMPValue">0</span>&#8451;</h1>
</div>
<script>
setInterval(function() {
// Call a function repetatively with 1 Second interval
getFWD();
getREF();
getTEMP();
}, 1000); //1000mSeconds update rate
function getFWD() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("FWDValue").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "readFWD", true);
xhttp.send();
}
function getREF() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("REFValue").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "readREF", true);
xhttp.send();
}
function getDRV() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("DRVValue").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "readDRV", true);
xhttp.send();
}
function getSWR() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("SWRValue").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "readSWR", true);
xhttp.send();
}
function getTEMP() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("TEMPValue").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "readTEMP", true);
xhttp.send();
}
</script>
</body>
</html>
)=====";