Ready to demo

This commit is contained in:
2023-02-16 14:28:03 -07:00
parent 1e7f70c6c4
commit 1e1d4803b2
9 changed files with 104 additions and 43 deletions

View File

@ -123,9 +123,17 @@ function ConstructMessageDialog() {
' <span id="spanMessageText"></span> ' +
' <table id="ModalHeaderGrid"></table> ' +
' <table id="ModalBodyGrid"></table> ' +
' <textarea type="text" value="Hello World" id="textareaClipboard" style="display:none"></textarea> ' +
' </div> ' +
' <div class="modal-footer"> ' +
' <button type="button" data-dismiss="modal">OK</button> ' +
' <div class="row" style="margin-top: 10px; margin-bottom: 20px;"> ' +
' <div class="col-xs-1"> ' +
' <button type="button" data-dismiss="modal" onclick="copy()">Copy</button> ' +
' </div> ' +
' <div class="col-xs-1"> ' +
' <button type="button" data-dismiss="modal">OK</button> ' +
' </div> ' +
' </div> ' +
' </div> ' +
' </div> ' +
'</div>';

View File

@ -465,14 +465,19 @@ function pinButtonRunInfo() {
if (selectedRow !== null) {
$("#PinButton").prop("disabled", true);
var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index];
var stringified = JSON.stringify(rowData);
stringified = stringified.replace(/"Tool":/gm, '"MesEntity":');
stringified = stringified.replace(/"Equipment ID":/gm, '"MesEntity":');
var jsonObject = JSON.parse(stringified);
$.ajax({
type: "POST",
url: "http://localhost:5126/api" + '/pin/' + toolTypeId + "/markAsPinned",
data: rowData,
url: _apiUrl + '/pin/' + toolTypeId + "/markAsPinned",
data: jsonObject,
success: function (e) {
DisplayWSMessage("info", "Marked as pinned", e);
// DisplayWSMessage("info", stringified, e);
$("#PinButton").prop("disabled", false);
$.getJSON("http://localhost:5126/api" + '/pin/' + toolTypeId + "/pinned?biorad_id=" + _BioRadId + "&cde_id=" + _CdeId + "&rds=" + rowData.RDS, function (data) {
$.getJSON(_apiUrl + '/pin/' + toolTypeId + "/pinned?biorad_id=" + _BioRadId + "&cde_id=" + _CdeId + "&rds=" + rowData.RDS, function (data) {
$("#ModalHeaderGrid").igGrid({
dataSource: data,
features: [
@ -481,6 +486,7 @@ function pinButtonRunInfo() {
columns: [
{ key: "ID", dataType: "number", hidden: true, },
{ key: "ToolTypeID", dataType: "number", hidden: true, },
{ headerText: "Tool", key: "MesEntity", dataType: "string", width: "10%" },
{ key: "Reactor", dataType: "string", width: "10%" },
{ key: "RDS", dataType: "string", width: "10%" },
{ key: "PSN", dataType: "string", width: "10%" },
@ -489,6 +495,11 @@ function pinButtonRunInfo() {
],
responseDataKey: "Results",
});
var text = "";
for (var i = 0; i < data.Results.length; i++) {
text = text + data.Results[i].Point1 + "\t" + data.Results[i].Point2 + "\t" + data.Results[i].Point3 + "\t" + data.Results[i].Point4 + "\t" + data.Results[i].Point5 + "\t" + data.Results[i].Point6 + "\t" + data.Results[i].Point7 + "\t" + data.Results[i].Point8 + "\t" + data.Results[i].Point9 + "\r";
}
$("#textareaClipboard").val(text);
$("#ModalBodyGrid").igGrid({
dataSource: data,
features: [
@ -497,14 +508,15 @@ function pinButtonRunInfo() {
columns: [
{ key: "ID", dataType: "number", hidden: true, },
{ key: "ToolTypeID", dataType: "number", hidden: true, },
{ key: "PointA", dataType: "number", width: "10%" },
{ key: "PointB", dataType: "number", width: "10%" },
{ key: "PointC", dataType: "number", width: "10%" },
{ key: "PointD", dataType: "number", width: "10%" },
{ key: "PointE", dataType: "number", width: "10%" },
{ key: "PointF", dataType: "number", width: "10%" },
{ key: "PointG", dataType: "number", width: "10%" },
{ key: "PointI", dataType: "number", width: "10%" },
{ headerText: "Point 1", key: "Point1", dataType: "number", width: "10%" },
{ headerText: "Point 2", key: "Point2", dataType: "number", width: "10%" },
{ headerText: "Point 3", key: "Point3", dataType: "number", width: "10%" },
{ headerText: "Point 4", key: "Point4", dataType: "number", width: "10%" },
{ headerText: "Point 5", key: "Point5", dataType: "number", width: "10%" },
{ headerText: "Point 6", key: "Point6", dataType: "number", width: "10%" },
{ headerText: "Point 7", key: "Point7", dataType: "number", width: "10%" },
{ headerText: "Point 8", key: "Point8", dataType: "number", width: "10%" },
{ headerText: "Point 9", key: "Point9", dataType: "number", width: "10%" },
],
responseDataKey: "Results",
});
@ -611,4 +623,15 @@ function triggerFileDownload(fileName, url) {
}
function initIndex() {
}
function copy() {
var copyText = document.getElementById("textareaClipboard");
// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);
}