common.js 863 B

12345678910111213141516171819202122232425262728293031
  1. var basepath = "http://192.168.178.22";
  2. function LoadHostname() {
  3. _basepath = getbasepath();
  4. var xhttp = new XMLHttpRequest();
  5. xhttp.addEventListener('load', function(event) {
  6. if (xhttp.status >= 200 && xhttp.status < 300) {
  7. hostname = xhttp.responseText;
  8. document.title = hostname + " - AI on the edge";
  9. document.getElementById("id_title").innerHTML = "Digitizer - AI on the edge - " + hostname;
  10. }
  11. else {
  12. console.warn(request.statusText, request.responseText);
  13. }
  14. });
  15. // var xhttp = new XMLHttpRequest();
  16. try {
  17. url = _basepath + '/version?type=Hostname';
  18. xhttp.open("GET", url, true);
  19. xhttp.send();
  20. }
  21. catch (error)
  22. {
  23. // alert("Loading Hostname failed");
  24. }
  25. }