Added in a loading indicator.

This commit is contained in:
ouellette 2023-11-14 11:00:43 -07:00
parent c1bb74433b
commit 9352923aa0
2 changed files with 23 additions and 9 deletions

View File

@ -561,7 +561,9 @@
</tbody>
</table>
</div>
<div class="table-responsive">
<div class="table-responsive" style="margin-top:40px;" id="eppTempOffsets">
<table class="table">
<thead>
<tr>
@ -582,15 +584,23 @@
<th scope="col">Hours</th>
</tr>
</thead>
<tbody id ="EpiProTempVerification"></tbody>
<tbody id ="EpiProTempVerification">
<tr>
<td id="loadingRow" colspan="16">Loading EPP Temperature Data...
<div class="spinner-border text-danger" role="status">
<span class="sr-only">Loading...</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<script>
$(document).ready(function () {
appendDiv();
loadEPPTempOffsets();
});

View File

@ -224,20 +224,24 @@ function compareStrings(isDate, dir, string1, string2) {
return false;
}
function appendDiv() {
function loadEPPTempOffsets() {
const tbody = document.getElementById("EpiProTempVerification");
$.ajax({
type: "GET",
url: 'https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQSV3/epi-pro-temp-verification/?night=44&night=46&night=52&night=54',
success: function (r) {
if (r == null)
ShowErrorMessage("Invalid data");
if (r == null) {
r = "<tr><td colspan='16'>Error getting EPP Temp Offset data...</td></tr>"
tbody.innerHTML = r;
}
else {
tbody.innerHTML = r;
}
},
error: function (e, _ajaxOptions, ex) {
DisplayWSMessage("error", "There was an error getting data.", e, ex);
}
r = "<tr><td colspan='16'>Error getting EPP Temp Offset data...</td></tr>"
tbody.innerHTML = r;
}
});
}