diff --git a/client/index.css b/client/index.css new file mode 100644 index 0000000..5e714e8 --- /dev/null +++ b/client/index.css @@ -0,0 +1,11 @@ +.input-group { + padding: 10px; +} + +input { + padding: 5px; +} + +label { + margin-right: 10px; +} diff --git a/client/index.html b/client/index.html new file mode 100644 index 0000000..bbc989b --- /dev/null +++ b/client/index.html @@ -0,0 +1,33 @@ + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+
+ +

Result:

+ + + + diff --git a/client/index.js b/client/index.js new file mode 100644 index 0000000..b0c619d --- /dev/null +++ b/client/index.js @@ -0,0 +1,18 @@ +let call_backend = function(e) { + console.log("Call backend"); + type = event.target.getAttribute('name'); + console.log(type); + + var url = document.forms["link"]["url-field"].value; + var run = document.forms["link"]["run-field"].value; + var link = document.forms["link"]["link-field"].value; + + xmlhttp = new XMLHttpRequest(); + xmlhttp.onreadystatechange = function() { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { + document.getElementById("result").innerHTML = xmlhttp.responseText; + }; + }; + xmlhttp.open("POST", url + "/link/" (type==="start" ? "start" : "handoff") + "/" + run + "/" + link, true); + xmlhttp.send(); +}