Spaces:
Sleeping
Sleeping
Update templates/proposed-GUI.html
Browse files- templates/proposed-GUI.html +11 -6
templates/proposed-GUI.html
CHANGED
|
@@ -4803,13 +4803,15 @@ function callrefreshAPI(){
|
|
| 4803 |
return groupedValues;
|
| 4804 |
}
|
| 4805 |
|
| 4806 |
-
|
| 4807 |
-
//
|
|
|
|
| 4808 |
function getAddedTablesDataSimple_modified() {
|
| 4809 |
-
const
|
| 4810 |
|
| 4811 |
const rows = Array.from(document.querySelectorAll('.extraDoorRow'));
|
| 4812 |
rows.forEach(row => {
|
|
|
|
| 4813 |
const inputs = row.querySelectorAll(
|
| 4814 |
'input[name="textidname"], ' +
|
| 4815 |
'input[name="texttypename"], ' +
|
|
@@ -4821,12 +4823,15 @@ function getAddedTablesDataSimple_modified() {
|
|
| 4821 |
|
| 4822 |
if (inputs.length === 6) {
|
| 4823 |
const values = Array.from(inputs).map(inp => (inp.value || '').trim());
|
| 4824 |
-
|
|
|
|
| 4825 |
}
|
| 4826 |
});
|
| 4827 |
|
| 4828 |
-
|
| 4829 |
-
|
|
|
|
|
|
|
| 4830 |
}
|
| 4831 |
|
| 4832 |
|
|
|
|
| 4803 |
return groupedValues;
|
| 4804 |
}
|
| 4805 |
|
| 4806 |
+
|
| 4807 |
+
// Collect all tables grouped by PDF, but drop the PDF names
|
| 4808 |
+
// Shape: [ [ [id,type,stop,height,fire,acoustic], ... ], ... ]
|
| 4809 |
function getAddedTablesDataSimple_modified() {
|
| 4810 |
+
const groups = new Map();
|
| 4811 |
|
| 4812 |
const rows = Array.from(document.querySelectorAll('.extraDoorRow'));
|
| 4813 |
rows.forEach(row => {
|
| 4814 |
+
const pdfName = row.dataset.pdfName || '__no_pdf__';
|
| 4815 |
const inputs = row.querySelectorAll(
|
| 4816 |
'input[name="textidname"], ' +
|
| 4817 |
'input[name="texttypename"], ' +
|
|
|
|
| 4823 |
|
| 4824 |
if (inputs.length === 6) {
|
| 4825 |
const values = Array.from(inputs).map(inp => (inp.value || '').trim());
|
| 4826 |
+
if (!groups.has(pdfName)) groups.set(pdfName, []);
|
| 4827 |
+
groups.get(pdfName).push(values);
|
| 4828 |
}
|
| 4829 |
});
|
| 4830 |
|
| 4831 |
+
// Return just the arrays of arrays, without the PDF keys
|
| 4832 |
+
const result = Array.from(groups.values());
|
| 4833 |
+
console.log("All table data (grouped, no pdf names):", result);
|
| 4834 |
+
return result;
|
| 4835 |
}
|
| 4836 |
|
| 4837 |
|