Spaces:
Sleeping
Sleeping
Update templates/proposed-GUI.html
Browse files- templates/proposed-GUI.html +48 -45
templates/proposed-GUI.html
CHANGED
|
@@ -151,8 +151,9 @@
|
|
| 151 |
<label id="relvDocLabel">Other Relevant Documents</label>
|
| 152 |
<input type="search" onkeyup=filterFunction(this.id) id="relevantSearchInput">
|
| 153 |
<br>
|
| 154 |
-
<div id
|
| 155 |
-
<div id="relvselectid" hidden></div>
|
|
|
|
| 156 |
<!-- <select style="margin-left: -1%;" hidden name="relvselectname" id="relvselectid" multiple size="5"> </select> -->
|
| 157 |
<iframe id="pdfFrame" hidden></iframe>
|
| 158 |
</div>
|
|
@@ -1768,14 +1769,9 @@ var doorSchedulePDF;
|
|
| 1768 |
|
| 1769 |
console.log(projsec.value)
|
| 1770 |
if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
|
| 1771 |
-
|
| 1772 |
-
|
| 1773 |
-
|
| 1774 |
-
document.getElementById("all").style.display = "block";
|
| 1775 |
|
| 1776 |
-
|
| 1777 |
-
// Open popup immediately before initiating the PDF download
|
| 1778 |
-
|
| 1779 |
var eventSource = new EventSource('/pixelimg/' + JSON.stringify(pixelArr));
|
| 1780 |
document.getElementById('progressBar').removeAttribute('hidden')
|
| 1781 |
document.getElementById('progressBar').style.display='block';
|
|
@@ -1786,23 +1782,16 @@ var doorSchedulePDF;
|
|
| 1786 |
document.getElementById('progress').style.width = progress + '%';
|
| 1787 |
document.getElementById('progress').textContent = progress + '%';
|
| 1788 |
} else {
|
| 1789 |
-
// Final data handling when progress reaches 100%
|
| 1790 |
-
console.log('Process completed!');
|
| 1791 |
-
|
| 1792 |
-
// Parse and handle the final response data (documentsToMeasure, RelevantDocuments, extracted_path)
|
| 1793 |
var data = JSON.parse(event.data); // Assuming the result is a JSON array
|
| 1794 |
-
console.log('Final result:', data);
|
| 1795 |
-
// You can use this data to update your page or handle it accordingly
|
| 1796 |
-
|
| 1797 |
eventSource.close(); // Close the connection when finished
|
| 1798 |
|
| 1799 |
-
|
| 1800 |
-
|
| 1801 |
-
|
| 1802 |
-
|
| 1803 |
-
|
| 1804 |
-
|
| 1805 |
-
|
| 1806 |
downloadPdf(pdfname,'Pixel_Conversion_File_:'+pdfname)
|
| 1807 |
document.getElementById("all").style.display = "none";
|
| 1808 |
|
|
@@ -1947,6 +1936,9 @@ var doorSchedulePDF;
|
|
| 1947 |
// pdfnames=getSelectValues(elem)
|
| 1948 |
// }
|
| 1949 |
}
|
|
|
|
|
|
|
|
|
|
| 1950 |
}
|
| 1951 |
// Action for when the label is clicked (no checkbox change)
|
| 1952 |
function handleLabelClick(event) {
|
|
@@ -2037,7 +2029,7 @@ var doorSchedulePDF;
|
|
| 2037 |
}
|
| 2038 |
|
| 2039 |
|
| 2040 |
-
for (let i = 0; i < relvDocs.length; i++) {
|
| 2041 |
let name = relvDocs[i][0];
|
| 2042 |
|
| 2043 |
// Create div for the measure item
|
|
@@ -2112,13 +2104,13 @@ var doorSchedulePDF;
|
|
| 2112 |
relvids.push(relvSelect);
|
| 2113 |
measids.push(measSelect);
|
| 2114 |
|
| 2115 |
-
|
| 2116 |
-
|
| 2117 |
-
|
| 2118 |
-
|
| 2119 |
-
|
| 2120 |
-
|
| 2121 |
-
|
| 2122 |
document.getElementById('measureADRbutton').onclick= function()
|
| 2123 |
{
|
| 2124 |
if (!measSelect.value) {
|
|
@@ -2149,6 +2141,16 @@ var doorSchedulePDF;
|
|
| 2149 |
document.getElementById('selectunitA').removeAttribute('disabled')
|
| 2150 |
}
|
| 2151 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2152 |
|
| 2153 |
};
|
| 2154 |
|
|
@@ -2481,7 +2483,7 @@ function getData(form) {
|
|
| 2481 |
}
|
| 2482 |
else if (formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6') )
|
| 2483 |
{
|
| 2484 |
-
answers.push(tomeasureproj, 0,[] , 0,0,pdfpath , doorSchedulePDF);
|
| 2485 |
formData.append('answers',JSON.stringify(answers))
|
| 2486 |
}
|
| 2487 |
}
|
|
@@ -4195,30 +4197,31 @@ function callrefreshAPI(){
|
|
| 4195 |
}
|
| 4196 |
|
| 4197 |
var groupedValues = [];
|
| 4198 |
-
|
| 4199 |
-
|
| 4200 |
-
// Select all text input fields inside the modal
|
| 4201 |
const inputs = document.querySelectorAll('.modal-body input[type="text"], .modal-body input[type="number"]');
|
| 4202 |
const values = [];
|
| 4203 |
-
|
| 4204 |
-
//
|
| 4205 |
inputs.forEach(input => {
|
| 4206 |
-
values.push(input.value);
|
| 4207 |
});
|
| 4208 |
-
|
| 4209 |
console.log("Collected input values:", values);
|
| 4210 |
|
| 4211 |
-
// Group the values into subarrays of 4
|
| 4212 |
-
// const groupedValues = [];
|
| 4213 |
for (let i = 0; i < values.length; i += 4) {
|
| 4214 |
-
|
|
|
|
|
|
|
|
|
|
| 4215 |
}
|
| 4216 |
-
|
| 4217 |
console.log("Grouped input values:", groupedValues);
|
| 4218 |
-
|
| 4219 |
return groupedValues;
|
| 4220 |
-
|
| 4221 |
}
|
| 4222 |
|
|
|
|
| 4223 |
</script>
|
| 4224 |
|
|
|
|
| 151 |
<label id="relvDocLabel">Other Relevant Documents</label>
|
| 152 |
<input type="search" onkeyup=filterFunction(this.id) id="relevantSearchInput">
|
| 153 |
<br>
|
| 154 |
+
<div id="relvdiv" style="position: relative; max-height: 300px;">
|
| 155 |
+
<div id="relvselectid" class="scrollable-container" hidden></div>
|
| 156 |
+
<div id="relvoverlay" class="disable-overlay"></div>
|
| 157 |
<!-- <select style="margin-left: -1%;" hidden name="relvselectname" id="relvselectid" multiple size="5"> </select> -->
|
| 158 |
<iframe id="pdfFrame" hidden></iframe>
|
| 159 |
</div>
|
|
|
|
| 1769 |
|
| 1770 |
console.log(projsec.value)
|
| 1771 |
if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
|
| 1772 |
+
document.getElementById("all").style.display = "block";
|
|
|
|
|
|
|
|
|
|
| 1773 |
|
| 1774 |
+
pixelArr=[projname.value, projpart.value,projsec.value, pdfname]
|
|
|
|
|
|
|
| 1775 |
var eventSource = new EventSource('/pixelimg/' + JSON.stringify(pixelArr));
|
| 1776 |
document.getElementById('progressBar').removeAttribute('hidden')
|
| 1777 |
document.getElementById('progressBar').style.display='block';
|
|
|
|
| 1782 |
document.getElementById('progress').style.width = progress + '%';
|
| 1783 |
document.getElementById('progress').textContent = progress + '%';
|
| 1784 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1785 |
var data = JSON.parse(event.data); // Assuming the result is a JSON array
|
|
|
|
|
|
|
|
|
|
| 1786 |
eventSource.close(); // Close the connection when finished
|
| 1787 |
|
| 1788 |
+
document.getElementById('progressBar').setAttribute('hidden',true)
|
| 1789 |
+
document.getElementById('progressBar').style.display='none';
|
| 1790 |
+
document.getElementById('progress').style.width = '0%'; // Reset progress for the next process
|
| 1791 |
+
document.getElementById('progress').textContent = '0%';
|
| 1792 |
+
document.getElementById("all").style.display = "none";
|
| 1793 |
+
// Display link or any additional data if needed
|
| 1794 |
+
window.open(data[2]);
|
| 1795 |
downloadPdf(pdfname,'Pixel_Conversion_File_:'+pdfname)
|
| 1796 |
document.getElementById("all").style.display = "none";
|
| 1797 |
|
|
|
|
| 1936 |
// pdfnames=getSelectValues(elem)
|
| 1937 |
// }
|
| 1938 |
}
|
| 1939 |
+
else{
|
| 1940 |
+
document.getElementById('radiosColors').removeAttribute('hidden')
|
| 1941 |
+
}
|
| 1942 |
}
|
| 1943 |
// Action for when the label is clicked (no checkbox change)
|
| 1944 |
function handleLabelClick(event) {
|
|
|
|
| 2029 |
}
|
| 2030 |
|
| 2031 |
|
| 2032 |
+
for (let i = 0; i < relvDocs.length; i++) {
|
| 2033 |
let name = relvDocs[i][0];
|
| 2034 |
|
| 2035 |
// Create div for the measure item
|
|
|
|
| 2104 |
relvids.push(relvSelect);
|
| 2105 |
measids.push(measSelect);
|
| 2106 |
|
| 2107 |
+
document.addEventListener("click", function(event) {
|
| 2108 |
+
const iframe = document.getElementById("pdfFrame");
|
| 2109 |
+
if (!iframe.contains(event.target)) {
|
| 2110 |
+
const iframe = document.getElementById("pdfFrame");
|
| 2111 |
+
iframe.style.display = "none";
|
| 2112 |
+
}
|
| 2113 |
+
});
|
| 2114 |
document.getElementById('measureADRbutton').onclick= function()
|
| 2115 |
{
|
| 2116 |
if (!measSelect.value) {
|
|
|
|
| 2141 |
document.getElementById('selectunitA').removeAttribute('disabled')
|
| 2142 |
}
|
| 2143 |
}
|
| 2144 |
+
|
| 2145 |
+
|
| 2146 |
+
|
| 2147 |
+
if (!(thirddropdown.value.startsWith('2.8')||thirddropdown.value.startsWith('2.6')) ) {
|
| 2148 |
+
document.getElementById("relvselectid").classList.add("disabled");
|
| 2149 |
+
document.getElementById("relvoverlay").style.display = "block";
|
| 2150 |
+
} else {
|
| 2151 |
+
document.getElementById("relvselectid").classList.remove("disabled");
|
| 2152 |
+
document.getElementById("relvoverlay").style.display = "none";
|
| 2153 |
+
}
|
| 2154 |
|
| 2155 |
};
|
| 2156 |
|
|
|
|
| 2483 |
}
|
| 2484 |
else if (formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6') )
|
| 2485 |
{
|
| 2486 |
+
answers.push(tomeasureproj, 0,[] , 0,0,pdfpath , doorSchedulePDF,groupedValues);
|
| 2487 |
formData.append('answers',JSON.stringify(answers))
|
| 2488 |
}
|
| 2489 |
}
|
|
|
|
| 4197 |
}
|
| 4198 |
|
| 4199 |
var groupedValues = [];
|
| 4200 |
+
function getpopuptext() {
|
| 4201 |
+
groupedValues = [];
|
| 4202 |
+
// Select all text/number input fields inside the modal
|
| 4203 |
const inputs = document.querySelectorAll('.modal-body input[type="text"], .modal-body input[type="number"]');
|
| 4204 |
const values = [];
|
| 4205 |
+
|
| 4206 |
+
// Collect all input values
|
| 4207 |
inputs.forEach(input => {
|
| 4208 |
+
values.push(input.value.trim());
|
| 4209 |
});
|
| 4210 |
+
|
| 4211 |
console.log("Collected input values:", values);
|
| 4212 |
|
| 4213 |
+
// Group the values into subarrays of 4, only if any field has value
|
|
|
|
| 4214 |
for (let i = 0; i < values.length; i += 4) {
|
| 4215 |
+
const group = values.slice(i, i + 4);
|
| 4216 |
+
if (group.some(val => val !== '')) {
|
| 4217 |
+
groupedValues.push(group);
|
| 4218 |
+
}
|
| 4219 |
}
|
| 4220 |
+
|
| 4221 |
console.log("Grouped input values:", groupedValues);
|
|
|
|
| 4222 |
return groupedValues;
|
|
|
|
| 4223 |
}
|
| 4224 |
|
| 4225 |
+
|
| 4226 |
</script>
|
| 4227 |
|