Spaces:
Sleeping
Sleeping
Update templates/proposed-GUI.html
Browse files- templates/proposed-GUI.html +62 -0
templates/proposed-GUI.html
CHANGED
|
@@ -494,7 +494,69 @@ $toggle.addEventListener('click', function() {
|
|
| 494 |
}
|
| 495 |
|
| 496 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 497 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 498 |
//___________________________________________________________________________________________________________
|
| 499 |
//___________________________________________________________________________________________________________
|
| 500 |
/*Retrieve MCTNAMES Dictionary from API - Flask*/
|
|
|
|
| 494 |
}
|
| 495 |
|
| 496 |
});
|
| 497 |
+
//API refresh worker -- work parallel to this code
|
| 498 |
+
var worker = new Worker('../static/API_Refresh_workerJS.js');
|
| 499 |
+
worker.onmessage= function(event){
|
| 500 |
+
var data=JSON.parse(event.data);
|
| 501 |
+
if (data)
|
| 502 |
+
{
|
| 503 |
+
if (confirm(data[0]+"\n")){
|
| 504 |
+
document.getElementById('all').style.display='block';
|
| 505 |
+
|
| 506 |
+
$.get('/refreshAPIAppendNewTables')
|
| 507 |
+
.success(function(successData){
|
| 508 |
+
if (data[1]===('projectsection'))
|
| 509 |
+
{
|
| 510 |
+
if (firstdropdown.value & seconddropdown.value)
|
| 511 |
+
{
|
| 512 |
+
displayprjnames();
|
| 513 |
+
displayprojsections(firstdropdown.value,seconddropdown.value);
|
| 514 |
+
}
|
| 515 |
+
}
|
| 516 |
|
| 517 |
+
else if (data[1]==='project')
|
| 518 |
+
{
|
| 519 |
+
console.log('projjjj')
|
| 520 |
+
displayprjnames();
|
| 521 |
+
}
|
| 522 |
+
else if (data[1]==='part')
|
| 523 |
+
{ if (firstdropdown.value)
|
| 524 |
+
displayprojparts(firstDpwnValue);
|
| 525 |
+
}
|
| 526 |
+
else if (data[1]==='section')
|
| 527 |
+
{
|
| 528 |
+
if (firstdropdown.value & seconddropdown.value)
|
| 529 |
+
displayprojsections(firstdropdown.value,seconddropdown.value);
|
| 530 |
+
}
|
| 531 |
+
else if (data[1]==='projectpart')
|
| 532 |
+
{
|
| 533 |
+
displayprjnames();
|
| 534 |
+
if (firstdropdown.value)
|
| 535 |
+
displayprojparts(firstDpwnValue);
|
| 536 |
+
}
|
| 537 |
+
else if (data[1]==='partsection')
|
| 538 |
+
if (firstdropdown.value & seconddropdown.value)
|
| 539 |
+
{
|
| 540 |
+
displayprojparts(firstdropdown.value);
|
| 541 |
+
displayprojsections(firstdropdown.value,seconddropdown.value);
|
| 542 |
+
}
|
| 543 |
+
// else{
|
| 544 |
+
// displayprjnames();
|
| 545 |
+
// }
|
| 546 |
+
document.getElementById('all').style.display='none';
|
| 547 |
+
})
|
| 548 |
+
.error(function(jqXHR, textStatus, errorThrown) {
|
| 549 |
+
PopupElement.textContent='Error occured while retrieving projects. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
|
| 550 |
+
ShowPopUp();
|
| 551 |
+
});
|
| 552 |
+
}
|
| 553 |
+
else{
|
| 554 |
+
worker.terminate()
|
| 555 |
+
}
|
| 556 |
+
|
| 557 |
+
|
| 558 |
+
}
|
| 559 |
+
}
|
| 560 |
//___________________________________________________________________________________________________________
|
| 561 |
//___________________________________________________________________________________________________________
|
| 562 |
/*Retrieve MCTNAMES Dictionary from API - Flask*/
|