Spaces:
Sleeping
Sleeping
Update templates/proposed-GUI.html
Browse files- templates/proposed-GUI.html +53 -12
templates/proposed-GUI.html
CHANGED
|
@@ -220,7 +220,7 @@
|
|
| 220 |
</lord-icon>
|
| 221 |
</div>
|
| 222 |
|
| 223 |
-
</div>
|
| 224 |
<button hidden id="doneebackground" onclick="getSecondData()" > Export Summary </button>
|
| 225 |
<button hidden id="summarytoXML" onclick=summary_to_XML() > Summary to XML</button>
|
| 226 |
<div hidden id ="duplicaterhidden" class="duplicaterclasshidden">
|
|
@@ -891,8 +891,9 @@ $toggle.addEventListener('click', function() {
|
|
| 891 |
|
| 892 |
MCTNames=event.data;
|
| 893 |
MCTNames=MCTNames[sectionNumber.toString().toLowerCase()]
|
|
|
|
| 894 |
}
|
| 895 |
-
console.log(MCTNames)
|
| 896 |
}
|
| 897 |
// }
|
| 898 |
var val=''
|
|
@@ -1022,7 +1023,7 @@ worker.onmessage= function(event){
|
|
| 1022 |
//___________________________________________________________________________________________________________
|
| 1023 |
//___________________________________________________________________________________________________________
|
| 1024 |
// /*Retrieve MCTNAMES Dictionary from API - Flask*/
|
| 1025 |
-
|
| 1026 |
function getALLMCTNAMES(){
|
| 1027 |
MCTNames={}
|
| 1028 |
document.getElementById("all").style.display = "block";
|
|
@@ -1031,9 +1032,29 @@ $.get( '/RetrieveMCTNames/')
|
|
| 1031 |
// document.getElementById("all").style.display = "none";
|
| 1032 |
console.log(data)
|
| 1033 |
MCTNames=data;
|
| 1034 |
-
sectionNumber=
|
| 1035 |
-
|
| 1036 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1037 |
})
|
| 1038 |
.error(function(jqXHR, textStatus, errorThrown) {
|
| 1039 |
PopupElement.textContent='Error occured while retrieving the MC-T Names. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
|
|
@@ -2031,6 +2052,16 @@ function ImgSide(imgdata, spreadsheetLink, pdfLink) {
|
|
| 2031 |
legendbutton.innerText = 'Legend and Data created';
|
| 2032 |
legendbutton.style.backgroundColor = 'rgb(5, 43, 235)';
|
| 2033 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2034 |
legendbutton.addEventListener('mouseover', function () {
|
| 2035 |
legendbutton.style.boxShadow = '0 0 8px 2px rgb(5, 43, 235)';
|
| 2036 |
});
|
|
@@ -2039,11 +2070,7 @@ function ImgSide(imgdata, spreadsheetLink, pdfLink) {
|
|
| 2039 |
});
|
| 2040 |
|
| 2041 |
|
| 2042 |
-
|
| 2043 |
-
legendbutton.setAttribute('disabled',true);
|
| 2044 |
-
legendbutton.style.cursor='not-allowed';
|
| 2045 |
-
}
|
| 2046 |
-
else{
|
| 2047 |
legendbutton.addEventListener('click', function () {
|
| 2048 |
window.open(spreadsheetLink);
|
| 2049 |
});
|
|
@@ -2297,6 +2324,20 @@ function getData(form) {
|
|
| 2297 |
document.getElementById('addicon').style.display='inline-block';
|
| 2298 |
document.getElementById('doneebackground').removeAttribute('hidden');
|
| 2299 |
document.getElementById('summarytoXML').removeAttribute('hidden');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2300 |
|
| 2301 |
|
| 2302 |
|
|
@@ -2419,7 +2460,7 @@ function getData(form) {
|
|
| 2419 |
var flag=0;
|
| 2420 |
pdfpath=[];
|
| 2421 |
pdfpath.push(formvalues['selectproj'],formvalues['selectprojp'] ,formvalues['selectprojs'])
|
| 2422 |
-
if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].startsWith('3.2') ||
|
| 2423 |
const interval = 6000; // Interval in milliseconds
|
| 2424 |
let delrows1 = ''; // Initial data storage
|
| 2425 |
let delrows2 = ''; // Updated data storage
|
|
|
|
| 220 |
</lord-icon>
|
| 221 |
</div>
|
| 222 |
|
| 223 |
+
</div>
|
| 224 |
<button hidden id="doneebackground" onclick="getSecondData()" > Export Summary </button>
|
| 225 |
<button hidden id="summarytoXML" onclick=summary_to_XML() > Summary to XML</button>
|
| 226 |
<div hidden id ="duplicaterhidden" class="duplicaterclasshidden">
|
|
|
|
| 891 |
|
| 892 |
MCTNames=event.data;
|
| 893 |
MCTNames=MCTNames[sectionNumber.toString().toLowerCase()]
|
| 894 |
+
|
| 895 |
}
|
| 896 |
+
console.log('MCtname::',MCTNames)
|
| 897 |
}
|
| 898 |
// }
|
| 899 |
var val=''
|
|
|
|
| 1023 |
//___________________________________________________________________________________________________________
|
| 1024 |
//___________________________________________________________________________________________________________
|
| 1025 |
// /*Retrieve MCTNAMES Dictionary from API - Flask*/
|
| 1026 |
+
var mctnameEmpty=false;
|
| 1027 |
function getALLMCTNAMES(){
|
| 1028 |
MCTNames={}
|
| 1029 |
document.getElementById("all").style.display = "block";
|
|
|
|
| 1032 |
// document.getElementById("all").style.display = "none";
|
| 1033 |
console.log(data)
|
| 1034 |
MCTNames=data;
|
| 1035 |
+
let sectionNumber = projsec.value.split(" ")[0]; // Get first item after splitting by space
|
| 1036 |
+
console.log(sectionNumber);
|
| 1037 |
+
|
| 1038 |
+
// Find the first key in MCTNames that starts with sectionNumber
|
| 1039 |
+
let matchedKey = Object.keys(MCTNames).find(key => key.toLowerCase().startsWith(sectionNumber.toLowerCase()));
|
| 1040 |
+
|
| 1041 |
+
if (matchedKey) {
|
| 1042 |
+
console.log(matchedKey); // Found matching key
|
| 1043 |
+
let matchedValue = MCTNames[matchedKey]; // Store matched value without overwriting MCTNames
|
| 1044 |
+
|
| 1045 |
+
console.log('MCTname::', matchedValue);
|
| 1046 |
+
|
| 1047 |
+
if (matchedValue && matchedValue.length ==0) { // Ensure matchedValue exists and has length
|
| 1048 |
+
mctnameEmpty = true;
|
| 1049 |
+
} else {
|
| 1050 |
+
mctnameEmpty = false;
|
| 1051 |
+
}
|
| 1052 |
+
} else {
|
| 1053 |
+
console.log("No matching key found in MCTNames");
|
| 1054 |
+
mctnameEmpty = false; // Handle case where no key is found
|
| 1055 |
+
}
|
| 1056 |
+
|
| 1057 |
+
|
| 1058 |
})
|
| 1059 |
.error(function(jqXHR, textStatus, errorThrown) {
|
| 1060 |
PopupElement.textContent='Error occured while retrieving the MC-T Names. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
|
|
|
|
| 2052 |
legendbutton.innerText = 'Legend and Data created';
|
| 2053 |
legendbutton.style.backgroundColor = 'rgb(5, 43, 235)';
|
| 2054 |
|
| 2055 |
+
|
| 2056 |
+
|
| 2057 |
+
if ( projsec.value.startsWith('2.8')){
|
| 2058 |
+
legendbutton.setAttribute('disabled',true);
|
| 2059 |
+
legendbutton.style.cursor='not-allowed';
|
| 2060 |
+
legendbutton.style.boxShadow = 'none';
|
| 2061 |
+
legendbutton.style.color = 'white';
|
| 2062 |
+
legendbutton.style.backgroundColor="rgb(154,152,152)";
|
| 2063 |
+
}
|
| 2064 |
+
else{
|
| 2065 |
legendbutton.addEventListener('mouseover', function () {
|
| 2066 |
legendbutton.style.boxShadow = '0 0 8px 2px rgb(5, 43, 235)';
|
| 2067 |
});
|
|
|
|
| 2070 |
});
|
| 2071 |
|
| 2072 |
|
| 2073 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2074 |
legendbutton.addEventListener('click', function () {
|
| 2075 |
window.open(spreadsheetLink);
|
| 2076 |
});
|
|
|
|
| 2324 |
document.getElementById('addicon').style.display='inline-block';
|
| 2325 |
document.getElementById('doneebackground').removeAttribute('hidden');
|
| 2326 |
document.getElementById('summarytoXML').removeAttribute('hidden');
|
| 2327 |
+
if (mctnameEmpty){
|
| 2328 |
+
document.getElementById('doneebackground').setAttribute('disabled','True')
|
| 2329 |
+
document.getElementById('doneebackground').style.cursor='not-allowed';
|
| 2330 |
+
document.getElementById('doneebackground').style.boxShadow = 'none';
|
| 2331 |
+
document.getElementById('doneebackground').style.color = 'white';
|
| 2332 |
+
document.getElementById('doneebackground').style.backgroundColor="rgb(154,152,152)";
|
| 2333 |
+
|
| 2334 |
+
document.getElementById('summarytoXML').setAttribute('disabled','True')
|
| 2335 |
+
document.getElementById('summarytoXML').style.cursor='not-allowed';
|
| 2336 |
+
document.getElementById('summarytoXML').style.boxShadow = 'none';
|
| 2337 |
+
document.getElementById('summarytoXML').style.color = 'white';
|
| 2338 |
+
document.getElementById('summarytoXML').style.backgroundColor="rgb(154,152,152)";
|
| 2339 |
+
|
| 2340 |
+
}
|
| 2341 |
|
| 2342 |
|
| 2343 |
|
|
|
|
| 2460 |
var flag=0;
|
| 2461 |
pdfpath=[];
|
| 2462 |
pdfpath.push(formvalues['selectproj'],formvalues['selectprojp'] ,formvalues['selectprojs'])
|
| 2463 |
+
if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('3.3')|| formvalues['selectprojs'].startsWith('2.7')) { // || formvalues['selectprojs'].startsWith('2.8')
|
| 2464 |
const interval = 6000; // Interval in milliseconds
|
| 2465 |
let delrows1 = ''; // Initial data storage
|
| 2466 |
let delrows2 = ''; // Updated data storage
|