machine_param.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <html>
  2. <head>
  3. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  4. </head>
  5. <style>
  6. table, th, td {
  7. border: 1px solid black;
  8. border-collapse: collapse;
  9. }</style>
  10. <p>Parameters</p>
  11. <form method="GET" action="../services/return_cpee.php">
  12. <input type="text" name="id" id="cbid" required>
  13. <input type="text" name="workerID" id="workerID" required>
  14. <input type="submit" value="Next" onclick="reloaded(rolle);">
  15. </form>
  16. <div id="cont"></div>
  17. <script type="text/javascript" src="form.js"></script>
  18. <script>
  19. var inhalt = "";
  20. $.ajax({
  21. url: '../callbacks/'+cbid+'.txt',
  22. async: false,
  23. success: function (data){
  24. inhalt = data;
  25. }
  26. });
  27. inhalt = JSON.parse(inhalt);
  28. var params = inhalt[1]['params'];
  29. params = JSON.parse(params);
  30. var rolle = inhalt[1]['rolle'];
  31. console.log(rolle);
  32. var mytable = "<table cellpadding=\"0\" cellspacing=\"0\">";
  33. mytable += "<thead><tr><th>Parameter</th><th>Value</th></tr></thead><tbody><tr>";
  34. Object.keys(params).forEach(val => {
  35. //console.log(val, params[val][0]);
  36. mytable += "<td>" + val + "</td>";
  37. mytable += "<td>" + params[val][0] + "</td></tr><tr>";
  38. });
  39. mytable += "</tr></tbody></table>";
  40. var elem = document.getElementById("cont");
  41. elem.insertAdjacentHTML( 'beforeend', mytable );
  42. </script>
  43. </html>