2019-09-26 18:37:48 +02:00
|
|
|
let call_backend = function(e) {
|
|
|
|
type = event.target.getAttribute('name');
|
|
|
|
|
2019-09-27 15:20:10 +02:00
|
|
|
var url_base = document.forms["link"]["url-field"].value;
|
2019-09-26 18:37:48 +02:00
|
|
|
var run = document.forms["link"]["run-field"].value;
|
|
|
|
var link = document.forms["link"]["link-field"].value;
|
|
|
|
|
2019-09-27 15:20:10 +02:00
|
|
|
x = new XMLHttpRequest();
|
|
|
|
x.onreadystatechange = function() {
|
|
|
|
if (x.readyState === 4) {
|
|
|
|
console.log("response: " + x.responseText);
|
|
|
|
document.getElementById("result").innerHTML = x.responseText;
|
2019-09-26 18:37:48 +02:00
|
|
|
};
|
|
|
|
};
|
2019-09-27 15:20:10 +02:00
|
|
|
|
|
|
|
var url = "http://" + url_base + "/link/" + (type === "start" ? "start" : "handoff") + "/" + run + "/" + link;
|
|
|
|
// console.log(url);
|
|
|
|
x.open("GET", url, true);
|
|
|
|
x.send();
|
|
|
|
};
|