Marthee commited on
Commit
b2efd1c
·
verified ·
1 Parent(s): 768c885

Update templates/proposed-GUI.html

Browse files
Files changed (1) hide show
  1. templates/proposed-GUI.html +95 -59
templates/proposed-GUI.html CHANGED
@@ -86,7 +86,7 @@
86
  </div> -->
87
  <input type="button" id="refreshAPIbutton" title="Refresh data retrieved from MC" value="Refresh data retrieved from MC ">
88
  <div id ="">
89
- <select name="selectproj" class="selectionsProj" id="selectionsProjid" onchange=getproj() required > </select>
90
  </div>
91
 
92
  <div id ="projectpart">
@@ -94,7 +94,7 @@
94
  </div>
95
 
96
  <div id ="projectsection">
97
- <select name="selectprojs" class="selectionsProjs" onchange=getALLMCTNAMES() required> </select>
98
  </div>
99
 
100
 
@@ -679,6 +679,7 @@ function getALLMCTNAMES(){
679
  document.getElementById("all").style.display = "block";
680
  $.get( '/RetrieveMCTNames/')
681
  .success (function(data){
 
682
  console.log(data)
683
  MCTNames=data;
684
  sectionNumber=thirddropdown.value
@@ -939,7 +940,7 @@ var ratioPunit=1;
939
  //___________________________________________________________________________________________________________
940
  //Retrieves list of projects
941
  function getproj(){
942
- // getALLMCTNAMES();
943
 
944
  var proj = document.getElementsByClassName("selectionsProj")[0];
945
  var projectVal=proj.value.toString() //selected project
@@ -952,6 +953,7 @@ var ratioPunit=1;
952
 
953
  $.get( '/getmethod/'+JSON.stringify(projectVal))
954
  .success (function(data){
 
955
  document.getElementById("all").style.display = "none";
956
 
957
  console.log(data[0],data[1])
@@ -1412,63 +1414,97 @@ interval= setInterval( function() {
1412
 
1413
  const delay = ms => new Promise(res => setTimeout(res, ms));
1414
  delay(3000)
1415
- $.getJSON('/_submission', {
1416
-
1417
- // dict: JSON.stringify(SimilarAreaDictionary),
1418
- dict1: JSON.stringify(list1),
1419
- spreadsheetId:spreadsheetId,
1420
- pdfpathpath:JSON.stringify(pdfpath),
1421
- path:Object.fromEntries(formData)['measureselectname'],
1422
-
1423
- },function(data1){
1424
-
1425
- if(data1.length >0){
1426
- delrows1=data1[0];
1427
- console.log(data1, delrows1,delrows2)
1428
- console.log(typeof delrows1)
1429
- console.log(typeof delrows2)
1430
- if (JSON.stringify(delrows1)=== JSON.stringify(delrows2))
1431
- {
1432
- console.log('same')
1433
- }
1434
- else{
1435
- // if (data1[0]==1){
1436
- // return data1[0];
1437
- flag=1
1438
- if (confirm("Changes have been made in the markups. Would you like to save and view them in the legend?")) {
1439
-
1440
-
1441
- $.getJSON('/deletemarkupsroute', {
1442
- dict: JSON.stringify(SimilarAreaDictionary),
1443
- deletedrows: JSON.stringify(delrows1),
1444
- path:Object.fromEntries(formData)['measureselectname'],
1445
- spreadsheetId:spreadsheetId,
1446
- areaPermArr: JSON.stringify(data[7]),
1447
- section: Object.fromEntries(formData)['selectprojs'],
1448
- pdfpathpath:JSON.stringify(pdfpath),
1449
-
1450
-
1451
-
1452
- }, function(data2){
1453
- console.log(data2)
1454
- })
1455
- }
1456
- }
1457
- }
1458
- });
1459
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1460
  delay(6000);
1461
- $.getJSON('/_submission', {
1462
- // dict: JSON.stringify(SimilarAreaDictionary),
1463
- dict1: JSON.stringify(list1),
1464
- spreadsheetId:spreadsheetId,
1465
- pdfpathpath:JSON.stringify(pdfpath),
1466
- path:Object.fromEntries(formData)['measureselectname'],
1467
-
1468
- },function(data11){
1469
- delrows2=data11[0];
1470
-
1471
- })
 
 
 
 
 
 
 
 
 
 
 
 
 
1472
  },10000)
1473
 
1474
 
 
86
  </div> -->
87
  <input type="button" id="refreshAPIbutton" title="Refresh data retrieved from MC" value="Refresh data retrieved from MC ">
88
  <div id ="">
89
+ <select name="selectproj" class="selectionsProj" id="selectionsProjid" required > </select>
90
  </div>
91
 
92
  <div id ="projectpart">
 
94
  </div>
95
 
96
  <div id ="projectsection">
97
+ <select name="selectprojs" class="selectionsProjs" onchange=getproj() required> </select>
98
  </div>
99
 
100
 
 
679
  document.getElementById("all").style.display = "block";
680
  $.get( '/RetrieveMCTNames/')
681
  .success (function(data){
682
+ // document.getElementById("all").style.display = "none";
683
  console.log(data)
684
  MCTNames=data;
685
  sectionNumber=thirddropdown.value
 
940
  //___________________________________________________________________________________________________________
941
  //Retrieves list of projects
942
  function getproj(){
943
+ getALLMCTNAMES();
944
 
945
  var proj = document.getElementsByClassName("selectionsProj")[0];
946
  var projectVal=proj.value.toString() //selected project
 
953
 
954
  $.get( '/getmethod/'+JSON.stringify(projectVal))
955
  .success (function(data){
956
+
957
  document.getElementById("all").style.display = "none";
958
 
959
  console.log(data[0],data[1])
 
1414
 
1415
  const delay = ms => new Promise(res => setTimeout(res, ms));
1416
  delay(3000)
1417
+
1418
+ $.ajax({
1419
+ type: "POST",
1420
+ url: "/_submission",
1421
+ // set content type header to use Flask response.get_json()
1422
+ contentType: "application/json",
1423
+ // convert data/object to JSON to send
1424
+ data: JSON.stringify({dict1: JSON.stringify(list1),
1425
+ spreadsheetId:spreadsheetId,
1426
+ pdfpathpath:JSON.stringify(pdfpath),
1427
+ path:Object.fromEntries(formData)['measureselectname']}),
1428
+ // expect JSON data in return (e.g. Flask jsonify)
1429
+ dataType: "json",
1430
+ // handle response
1431
+ success: function(data1){
1432
+
1433
+ if(data1.length >0){
1434
+ delrows1=data1[0];
1435
+ console.log(data1, delrows1,delrows2)
1436
+ console.log(typeof delrows1)
1437
+ console.log(typeof delrows2)
1438
+ if (JSON.stringify(delrows1)=== JSON.stringify(delrows2))
1439
+ {
1440
+ console.log('same')
1441
+ }
1442
+ else{
1443
+ // if (data1[0]==1){
1444
+ // return data1[0];
1445
+ flag=1
1446
+ if (confirm("Changes have been made in the markups. Would you like to save and view them in the legend?")) {
1447
+
1448
+ $.ajax({
1449
+ type: "POST",
1450
+ url: "/deletemarkupsroute",
1451
+ // set content type header to use Flask response.get_json()
1452
+ contentType: "application/json",
1453
+ // convert data/object to JSON to send
1454
+ data: JSON.stringify({ dict: JSON.stringify(SimilarAreaDictionary),
1455
+ deletedrows: JSON.stringify(delrows1),
1456
+ path:Object.fromEntries(formData)['measureselectname'],
1457
+ spreadsheetId:spreadsheetId,
1458
+ areaPermArr: JSON.stringify(data[7]),
1459
+ section: Object.fromEntries(formData)['selectprojs'],
1460
+ pdfpathpath:JSON.stringify(pdfpath),}),
1461
+ // expect JSON data in return (e.g. Flask jsonify)
1462
+ dataType: "json",
1463
+ // handle response
1464
+ success: function(response) {
1465
+ console.log(data2)
1466
+ },
1467
+ error: function(err) {
1468
+ PopupElement.textContent='Error occured. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
1469
+ ShowPopUp();
1470
+ }
1471
+ })
1472
+
1473
+ }
1474
+ }
1475
+ }
1476
+ },
1477
+ error: function(err) {
1478
+ PopupElement.textContent='Error occured. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
1479
+ ShowPopUp();
1480
+ }
1481
+ })
1482
+
1483
  delay(6000);
1484
+
1485
+
1486
+ $.ajax({
1487
+ type: "POST",
1488
+ url: "/_submission",
1489
+ // set content type header to use Flask response.get_json()
1490
+ contentType: "application/json",
1491
+ // convert data/object to JSON to send
1492
+ data: JSON.stringify({dict1: JSON.stringify(list1),
1493
+ spreadsheetId:spreadsheetId,
1494
+ pdfpathpath:JSON.stringify(pdfpath),
1495
+ path:Object.fromEntries(formData)['measureselectname']}),
1496
+ // expect JSON data in return (e.g. Flask jsonify)
1497
+ dataType: "json",
1498
+ // handle response
1499
+ success: function(data11) {
1500
+ delrows2=data11[0];
1501
+ },
1502
+ error: function(err) {
1503
+ PopupElement.textContent='Error occured. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
1504
+ ShowPopUp();
1505
+ }
1506
+ })
1507
+
1508
  },10000)
1509
 
1510