This commit is contained in:
2023-07-27 12:37:24 -07:00
parent 0111a25e69
commit 9717fcb3bf
37 changed files with 425 additions and 43 deletions

View File

@ -1,19 +1,56 @@
"use strict";
var connection = new signalR.HubConnectionBuilder().withUrl("/NotificationHub").build();
var connection = new signalR.HubConnectionBuilder()
.withUrl("/NotificationHub")
.build();
connection.on("NotifyAll", function (data) {
if (data.keyPressEvent && data.lastScanServiceResultValue) {
var innerText = `${data.keyPressEvent.dateTime} - [${data.lastScanServiceResultValue}]`;
document.getElementById("lastScanServiceResultValue").innerText = innerText;
if (!data.keyPressEvent || !data.lastScanServiceResultValue) {
if (!data.httpContentBody) {
document.getElementById("lastScanServiceResultValue").innerText = "";
}
else if (data.httpContentBody) {
var innerText = `${data.httpContentBody}]`; //JSON.parse() // JSON.stringify()
document.getElementById("httpContentBody").innerText = innerText;
} else {
var innerText = `${data.keyPressEvent.dateTime} - [${data.lastScanServiceResultValue}]`;
document.getElementById("lastScanServiceResultValue").innerText = innerText;
}
if (!data.httpContentBody) {
if (!data.keyPressEvent || !data.lastScanServiceResultValue) {
document.getElementById("httpContentBody").innerText = data;
document.getElementById("mId").innerText = "";
document.getElementById("recipe").innerText = "";
}
} else {
document.getElementById("httpContentBody").innerText = data.httpContentBody;
var postResult = JSON.parse(data.httpContentBody);
if (!postResult.MId) {
document.getElementById("mId").innerText = "";
} else {
document.getElementById(
"mId",
).innerText = `Use ${postResult.MId} for the wafer and input id`;
}
if (!postResult.Recipe) {
document.getElementById("recipe").innerText = "";
} else {
if (postResult.Recipe != "Recipe") {
document.getElementById("recipe").innerText = postResult.Recipe;
} else {
$.getJSON(
"https://oi-prod-ec-api.mes.infineon.com/api/oiWizard/materials/rds/" +
postResult.LotName,
function (data) {
document.getElementById("recipe").innerText =
data.rds.rdsLayers.length;
},
);
}
}
}
});
connection.start().then(function () {
}).catch(function (err) {
connection
.start()
.then(function () {})
.catch(function (err) {
return console.error(err.toString());
});
});