common.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. }
  26. function LoadVersion() {
  27. _basepath = getbasepath();
  28. var xhttp = new XMLHttpRequest();
  29. xhttp.addEventListener('load', function(event) {
  30. if (xhttp.status >= 200 && xhttp.status < 300) {
  31. version = xhttp.responseText;
  32. document.getElementById("Version").innerHTML = version;
  33. }
  34. else {
  35. console.warn(request.statusText, request.responseText);
  36. }
  37. });
  38. try {
  39. url = _basepath + '/version?type=GitBaseBranch';
  40. xhttp.open("GET", url, true);
  41. xhttp.send();
  42. }
  43. catch (error)
  44. {}
  45. }