Many changes - not yet "controlled" updates.

This commit is contained in:
David
2021-10-04 13:45:39 +00:00
parent 8c1a403008
commit 74543a99f8
42 changed files with 7718 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
//
// rssi script
//
// var mySite = 'http://192.168.1.23' from myip.js
var url = mySite + '/state';
setInterval(RefreshStatus, 5000);
getIt = function(aUrl, callback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', aUrl, true);
xhr.responseType = 'text';
xhr.onload = function(e) {
if (this.status === 200) {
callback(this.response);
}
};
xhr.send();
}
function RefreshStatus() {
getIt(url,
function(data) {
obj = JSON.parse(data);
var elms = document.querySelectorAll('.' + 'ip'), i;
for (i = 0; i < elms.length; ++i) {
elms[i].textContent = obj.ip;
}
}
);
}