Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
11469a2865 | |||
9a4160e4e1 | |||
54c67cf5c2 | |||
c7bf411f01
|
|||
67c4981cbe
|
|||
6211ea95a4
|
|||
3cee043e28
|
|||
6fe351e110
|
|||
7429d4a4f0
|
|||
515657b1fd
|
|||
605ddc00d0
|
|||
7e00994a37
|
|||
fb1249d37b
|
|||
d9195187f3
|
|||
161aea553c
|
|||
7c3ae15c67
|
|||
d535fe3743
|
|||
56ed58b6d4
|
|||
863fcef491
|
@ -2,7 +2,7 @@ steps:
|
|||||||
build:
|
build:
|
||||||
image: plugins/kaniko
|
image: plugins/kaniko
|
||||||
settings:
|
settings:
|
||||||
repo: gitea.hottis.de/moerp/elo-rezept-rechner
|
repo: ${FORGE_NAME}/${CI_REPO}
|
||||||
registry:
|
registry:
|
||||||
from_secret: container_registry
|
from_secret: container_registry
|
||||||
tags: latest,${CI_COMMIT_SHA},${CI_COMMIT_TAG}
|
tags: latest,${CI_COMMIT_SHA},${CI_COMMIT_TAG}
|
||||||
@ -17,6 +17,11 @@ steps:
|
|||||||
when:
|
when:
|
||||||
- event: [push, tag]
|
- event: [push, tag]
|
||||||
|
|
||||||
|
scan_image:
|
||||||
|
image: aquasec/trivy
|
||||||
|
commands:
|
||||||
|
- trivy image $FORGE_NAME/$CI_REPO:$CI_COMMIT_SHA --quiet --exit-code 1
|
||||||
|
|
||||||
deploytest:
|
deploytest:
|
||||||
image: portainer/kubectl-shell:latest
|
image: portainer/kubectl-shell:latest
|
||||||
secrets:
|
secrets:
|
||||||
|
@ -10,7 +10,8 @@ COPY start.sh ${APP_DIR}/
|
|||||||
WORKDIR ${APP_DIR}
|
WORKDIR ${APP_DIR}
|
||||||
|
|
||||||
RUN \
|
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 && \
|
pip install -r requirements.txt && \
|
||||||
if [ "${VERSION_ID2}" != "" ]; then VERSION_ID=${VERSION_ID2}; else VERSION_ID=${VERSION_ID1}; fi && \
|
if [ "${VERSION_ID2}" != "" ]; then VERSION_ID=${VERSION_ID2}; else VERSION_ID=${VERSION_ID1}; fi && \
|
||||||
sed -i -e 's/VERSION_ID/'$VERSION_ID'/' ${APP_DIR}/templates/index.html && \
|
sed -i -e 's/VERSION_ID/'$VERSION_ID'/' ${APP_DIR}/templates/index.html && \
|
||||||
|
@ -36,7 +36,7 @@ kubectl create secret generic nutri-secrets \
|
|||||||
--from-literal=CLIENT_SECRETS="$CLIENT_SECRETS" \
|
--from-literal=CLIENT_SECRETS="$CLIENT_SECRETS" \
|
||||||
--from-literal=PGUSER="$PGUSER" \
|
--from-literal=PGUSER="$PGUSER" \
|
||||||
--from-literal=PGPASSWORD="$PGPASSWORD" \
|
--from-literal=PGPASSWORD="$PGPASSWORD" \
|
||||||
--from-literal=PGDATABASE="$PGDATABASE" \
|
--from-literal=PGDATABASE="$PGDATABASE$POSTFIX" \
|
||||||
--from-literal=PGHOST="timescaledb.database.svc.cluster.local" \
|
--from-literal=PGHOST="timescaledb.database.svc.cluster.local" \
|
||||||
--from-literal=PGSSLMODE="require" | \
|
--from-literal=PGSSLMODE="require" | \
|
||||||
kubectl apply -f - -n $NAMESPACE
|
kubectl apply -f - -n $NAMESPACE
|
||||||
|
@ -21,6 +21,8 @@ app.config.update({
|
|||||||
oidc = OpenIDConnect(app)
|
oidc = OpenIDConnect(app)
|
||||||
app.logger.handlers = logging.getLogger('gunicorn.error').handlers
|
app.logger.handlers = logging.getLogger('gunicorn.error').handlers
|
||||||
|
|
||||||
|
datapw = 'dasrtwegdffgtewrt4335wferg'
|
||||||
|
|
||||||
def calculate_nutrition(food, weight):
|
def calculate_nutrition(food, weight):
|
||||||
try:
|
try:
|
||||||
conn = psycopg2.connect()
|
conn = psycopg2.connect()
|
||||||
|
@ -49,14 +49,14 @@
|
|||||||
const table = document.getElementById('nutrition-table');
|
const table = document.getElementById('nutrition-table');
|
||||||
const row = table.insertRow();
|
const row = table.insertRow();
|
||||||
|
|
||||||
row.insertCell(0).innerHTML = food;
|
row.insertCell(0).innerText = food;
|
||||||
row.insertCell(1).innerHTML = weight;
|
row.insertCell(1).innerText = weight;
|
||||||
row.insertCell(2).innerHTML = nutritionData.kcal;
|
row.insertCell(2).innerText = nutritionData.kcal;
|
||||||
row.insertCell(3).innerHTML = nutritionData.ew;
|
row.insertCell(3).innerText = nutritionData.ew;
|
||||||
row.insertCell(4).innerHTML = nutritionData.fett;
|
row.insertCell(4).innerText = nutritionData.fett;
|
||||||
row.insertCell(5).innerHTML = nutritionData.kh;
|
row.insertCell(5).innerText = nutritionData.kh;
|
||||||
row.insertCell(6).innerHTML = nutritionData.bst;
|
row.insertCell(6).innerText = nutritionData.bst;
|
||||||
row.insertCell(7).innerHTML = nutritionData.ca;
|
row.insertCell(7).innerText = nutritionData.ca;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -124,14 +124,14 @@
|
|||||||
const table = document.getElementById('nutrition-table');
|
const table = document.getElementById('nutrition-table');
|
||||||
const row = table.insertRow();
|
const row = table.insertRow();
|
||||||
// Fügt die einzelnen Nährwerte zur neuen Zeile hinzu
|
// Fügt die einzelnen Nährwerte zur neuen Zeile hinzu
|
||||||
row.insertCell(0).innerHTML = food;
|
row.insertCell(0).innerText = food;
|
||||||
row.insertCell(1).innerHTML = weight;
|
row.insertCell(1).innerText = weight;
|
||||||
row.insertCell(2).innerHTML = data.kcal;
|
row.insertCell(2).innerText = data.kcal;
|
||||||
row.insertCell(3).innerHTML = data.ew;
|
row.insertCell(3).innerText = data.ew;
|
||||||
row.insertCell(4).innerHTML = data.fett;
|
row.insertCell(4).innerText = data.fett;
|
||||||
row.insertCell(5).innerHTML = data.kh;
|
row.insertCell(5).innerText = data.kh;
|
||||||
row.insertCell(6).innerHTML = data.bst;
|
row.insertCell(6).innerText = data.bst;
|
||||||
row.insertCell(7).innerHTML = data.ca;
|
row.insertCell(7).innerText = data.ca;
|
||||||
|
|
||||||
foodInput.value = ''; // Zurücksetzen des Lebensmittel-Eingabefeldes
|
foodInput.value = ''; // Zurücksetzen des Lebensmittel-Eingabefeldes
|
||||||
weightInput.value = ''; // Zurücksetzen des Gewicht-Eingabefeldes
|
weightInput.value = ''; // Zurücksetzen des Gewicht-Eingabefeldes
|
||||||
|
@ -137,13 +137,13 @@
|
|||||||
tableBody.innerHTML = '';
|
tableBody.innerHTML = '';
|
||||||
data.forEach(entry => {
|
data.forEach(entry => {
|
||||||
const row = tableBody.insertRow();
|
const row = tableBody.insertRow();
|
||||||
row.insertCell(0).innerHTML = entry.food;
|
row.insertCell(0).innerText = entry.food;
|
||||||
row.insertCell(1).innerHTML = entry.kcal;
|
row.insertCell(1).innerText = entry.kcal;
|
||||||
row.insertCell(2).innerHTML = entry.ew;
|
row.insertCell(2).innerText = entry.ew;
|
||||||
row.insertCell(3).innerHTML = entry.fett;
|
row.insertCell(3).innerText = entry.fett;
|
||||||
row.insertCell(4).innerHTML = entry.kh;
|
row.insertCell(4).innerText = entry.kh;
|
||||||
row.insertCell(5).innerHTML = entry.bst;
|
row.insertCell(5).innerText = entry.bst;
|
||||||
row.insertCell(6).innerHTML = entry.ca;
|
row.insertCell(6).innerText = entry.ca;
|
||||||
|
|
||||||
// ... Fügen Sie weitere Zellen für die anderen Werte hinzu ...
|
// ... Fügen Sie weitere Zellen für die anderen Werte hinzu ...
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user