added separate stylesheet and moved common js to a file.

This commit is contained in:
George Ruinelli
2022-08-30 21:23:05 +02:00
parent fe17d97a05
commit 3dcdd52eb7
2 changed files with 129 additions and 0 deletions

31
sd-card/html/common.js Normal file
View File

@@ -0,0 +1,31 @@
var basepath = "http://192.168.178.22";
function LoadHostname() {
_basepath = getbasepath();
var xhttp = new XMLHttpRequest();
xhttp.addEventListener('load', function(event) {
if (xhttp.status >= 200 && xhttp.status < 300) {
hostname = xhttp.responseText;
document.title = hostname + " - jomjol - AI on the edge";
document.getElementById("id_title").innerHTML = "Digitizer - AI on the edge - " + hostname;
}
else {
console.warn(request.statusText, request.responseText);
}
});
// var xhttp = new XMLHttpRequest();
try {
url = _basepath + '/version?type=Hostname';
xhttp.open("GET", url, true);
xhttp.send();
}
catch (error)
{
// alert("Loading Hostname failed");
}
}