This commit is contained in:
parent
c7bf411f01
commit
54c67cf5c2
@ -10,7 +10,7 @@ COPY start.sh ${APP_DIR}/
|
||||
WORKDIR ${APP_DIR}
|
||||
|
||||
RUN \
|
||||
apk add --no-cache build-base libpq-dev && \
|
||||
apk add --no-cache build-base libpq-dev npm && \
|
||||
pip install --upgrade pip && \
|
||||
pip install -r requirements.txt && \
|
||||
if [ "${VERSION_ID2}" != "" ]; then VERSION_ID=${VERSION_ID2}; else VERSION_ID=${VERSION_ID1}; fi && \
|
||||
|
@ -134,22 +134,20 @@
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const tableBody = document.getElementById('database-nutrition-table').getElementsByTagName('tbody')[0];
|
||||
tableBody.innerHTML = '';
|
||||
tableBody.innerHTML = ''; // Das Löschen ist hier in Ordnung, da wir nur den Inhalt entfernen
|
||||
data.forEach(entry => {
|
||||
const row = tableBody.insertRow();
|
||||
row.insertCell(0).innerHTML = entry.food;
|
||||
row.insertCell(1).innerHTML = entry.kcal;
|
||||
row.insertCell(2).innerHTML = entry.ew;
|
||||
row.insertCell(3).innerHTML = entry.fett;
|
||||
row.insertCell(4).innerHTML = entry.kh;
|
||||
row.insertCell(5).innerHTML = entry.bst;
|
||||
row.insertCell(6).innerHTML = entry.ca;
|
||||
Object.keys(entry).forEach((key, index) => {
|
||||
const cell = row.insertCell(index);
|
||||
cell.innerText = entry[key]; // Verwendung von innerText statt innerHTML
|
||||
});
|
||||
|
||||
// ... Fügen Sie weitere Zellen für die anderen Werte hinzu ...
|
||||
// Kein Bedarf, die Kommentare zu wiederholen – die Methode ist selbsterklärend
|
||||
});
|
||||
})
|
||||
.catch(error => console.error('Fehler:', error));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', loadDatabaseEntries);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user