1
0

- changed webserver to apiserver

- added webserver
- a lot of debugging
- install shell script
This commit is contained in:
2022-04-07 01:44:17 +02:00
parent 0d35b1ff3f
commit f8fc3f63ec
28 changed files with 463 additions and 223 deletions

37
apiserver/javascript.php Normal file
View File

@ -0,0 +1,37 @@
<?php
function insertJavascript()
{
global $listenPort;
return '<script language="javascript">
<!--
function setPropertyValue(topic, fn, value, property)
{
document.getElementById(topic+"/"+fn+"/"+property+"/"+value.toLowerCase()).value = value;
let xhr = new XMLHttpRequest();
xhr.open("GET", "http://192.168.1.253:' . $listenPort . '/set&fn="+fn+"&property="+property+"&topic="+topic+"&value="+value);
xhr.onload = function () {};
xhr.send();
}
function setPropertyNumberValue(topic, fn, value, property)
{
document.getElementById(topic+"/"+fn+"/"+property).value = value;
let xhr = new XMLHttpRequest();
xhr.open("GET", "http://192.168.1.253:' . $listenPort . '/set&fn="+fn+"&property="+property+"&topic="+topic+"&value="+value);
xhr.onload = function () {};
xhr.send();
}
function getPropertyValue(topic, fn, property)
{
let xhr = new XMLHttpRequest();
xhr.open("GET", "http://192.168.1.253:' . $listenPort . '/get&fn="+fn+"&property="+property+"&topic="+topic );
xhr.onload = function () {};
xhr.send();
setTimeout(function()
{
location.reload();
}, 1000);
}
// -->
</script>';
}
?>