| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <title>Apache Ignite Teamcity Bot</title> |
| <link rel="icon" href="img/leaf-icon-png-7066.png"> |
| |
| <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> |
| <script src="https://code.jquery.com/jquery-1.12.4.js"></script> |
| <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> |
| </head> |
| <body> |
| <pre id="ciResponseText"></pre> |
| |
| <div id="loadStatus"></div> |
| <script> |
| |
| function findGetParameter(parameterName) { |
| var result = null, |
| tmp = []; |
| location.search |
| .substr(1) |
| .split("&") |
| .forEach(function (item) { |
| tmp = item.split("="); |
| if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]); |
| }); |
| return result; |
| } |
| |
| $(document).ready(function() { |
| $( document ).tooltip(); |
| loadData(); |
| //todo fix setInterval(loadData, 60000) |
| }); |
| |
| function loadData() { |
| $("#loadStatus").html("<img src='https://www.wallies.com/filebin/images/loading_apple.gif' width=20px height=20px> Please wait"); |
| $.ajax({ |
| url: "rest/" + findGetParameter("url"), |
| success: function(result) { |
| $("#loadStatus").html(""); |
| showData(result); |
| }, |
| error: function(jqXHR, exception) { |
| if (jqXHR.status === 0) { |
| $("#loadStatus").html('Not connect.\n Verify Network.'); |
| } else if (jqXHR.status === 404) { |
| $("#loadStatus").html('Requested page not found. [404]'); |
| } else if (jqXHR.status === 500) { |
| $("#loadStatus").html('Internal Server Error [500].'); |
| } else if (exception === 'parsererror') { |
| $("#loadStatus").html('Requested JSON parse failed.'); |
| } else if (exception === 'timeout') { |
| $("#loadStatus").html('Time out error.'); |
| } else if (exception === 'abort') { |
| $("#loadStatus").html('Ajax request aborted.'); |
| } else { |
| $("#loadStatus").html('Uncaught Error.\n' + jqXHR.responseText); |
| } |
| } |
| |
| }, ); |
| } |
| |
| function showData(result) { |
| var ciResponseText = document.getElementById('ciResponseText'); |
| ciResponseText.innerHTML = JSON.stringify(result, null, '\t'); |
| } |
| </script> |
| </body> |
| </html> |