Merge branch 'main' into UMBE
This commit is contained in:
2
.github/workflows/dev-pipeline.yml
vendored
2
.github/workflows/dev-pipeline.yml
vendored
@@ -23,4 +23,4 @@ jobs:
|
|||||||
git clean -f -d
|
git clean -f -d
|
||||||
git pull origin main
|
git pull origin main
|
||||||
git status
|
git status
|
||||||
bash build.sh
|
make prod
|
||||||
42
Makefile
42
Makefile
@@ -1,4 +1,4 @@
|
|||||||
.PHONY: dev database api online-energieausweis all
|
.PHONY: dev database api online-energieausweis all prod bun-install-database bun-install-api
|
||||||
|
|
||||||
online-energieausweis:
|
online-energieausweis:
|
||||||
bun run dev
|
bun run dev
|
||||||
@@ -6,13 +6,47 @@ online-energieausweis:
|
|||||||
dev: online-energieausweis api database
|
dev: online-energieausweis api database
|
||||||
|
|
||||||
database:
|
database:
|
||||||
|
$(MAKE) -C ../database dev
|
||||||
|
|
||||||
|
bun-install-database:
|
||||||
cd ../database
|
cd ../database
|
||||||
docker compose up
|
bun link
|
||||||
|
bun install
|
||||||
|
|
||||||
|
bun-install-api: bun-install-database
|
||||||
|
cd ../api
|
||||||
|
bun install
|
||||||
|
bun link @ibcornelsen/database
|
||||||
|
|
||||||
api:
|
api:
|
||||||
cd ../api
|
$(MAKE) -C ../api dev
|
||||||
bun run dev
|
|
||||||
|
|
||||||
all:
|
all:
|
||||||
mkdir -p ~/logs
|
mkdir -p ~/logs
|
||||||
bun run dev 2>&1 | tee ~/logs/`date '+%d-%m-%Y_%H:%M:%S'`.log
|
bun run dev 2>&1 | tee ~/logs/`date '+%d-%m-%Y_%H:%M:%S'`.log
|
||||||
|
|
||||||
|
prod: bun-install-api bun-install-database
|
||||||
|
mkdir -p ~/logs
|
||||||
|
mkdir -p ~/persistent/online-energieausweis
|
||||||
|
|
||||||
|
# Wir müssen sichergehen, dass der Database Container läuft, sonst können wir ihn nicht linken.
|
||||||
|
@if [ ! $$(docker ps | grep database | wc -l) -gt 0 ]; then \
|
||||||
|
cd ../database; \
|
||||||
|
$(MAKE) prod; \
|
||||||
|
cd ../online-energieausweis; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Auch die API sollte bereits laufen
|
||||||
|
@if [ $$(pm2 pid api) -eq "0" ]; then \
|
||||||
|
cd ../api; \
|
||||||
|
$(MAKE) prod; \
|
||||||
|
cd ../online-energieausweis; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
- rm -f ~/online-energieausweis/.env;
|
||||||
|
- touch ~/online-energieausweis/.env;
|
||||||
|
- echo "PRIVATE_KEY=$(cat /etc/letsencrypt/live/ibcornelsen.de/privkey.pem | base64 | tr -d '\n')" >> ~/online-energieausweis/.env;
|
||||||
|
- echo "CERTIFICATE=$(cat /etc/letsencrypt/live/ibcornelsen.de/fullchain.pem | base64 | tr -d '\n')" >> ~/online-energieausweis/.env;
|
||||||
|
|
||||||
|
- pm2 delete online-energieausweis
|
||||||
|
pm2 start --name "online-energieausweis" --log ~/logs/`date '+%d-%m-%Y_%H:%M:%S'`.log --time bun -- astro dev
|
||||||
@@ -1,41 +1,39 @@
|
|||||||
import { defineConfig } from "astro/config";
|
import { defineConfig } from "astro/config";
|
||||||
import svelte from "@astrojs/svelte";
|
import svelte from "@astrojs/svelte";
|
||||||
// import astroI18next from "astro-i18next";
|
// import astroI18next from "astro-i18next";
|
||||||
|
|
||||||
import tailwind from "@astrojs/tailwind";
|
import tailwind from "@astrojs/tailwind";
|
||||||
|
|
||||||
// https://astro.build/config
|
|
||||||
import node from "@astrojs/node";
|
import node from "@astrojs/node";
|
||||||
|
|
||||||
// https://astro.build/config
|
|
||||||
import mdx from "@astrojs/mdx";
|
import mdx from "@astrojs/mdx";
|
||||||
|
|
||||||
import { fileURLToPath } from "url";
|
import { fileURLToPath } from "url";
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
integrations: [svelte(), tailwind(), mdx()],
|
integrations: [svelte(), tailwind(), mdx()],
|
||||||
outDir: "./dist",
|
outDir: "./dist",
|
||||||
output: "server",
|
output: "server",
|
||||||
vite: {
|
vite: {
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
exclude: ["@ibcornelsen/api", "@ibcornelsen/database"]
|
exclude: ["@ibcornelsen/api", "@ibcornelsen/database"]
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"#": fileURLToPath(new URL("./src", import.meta.url))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ssr: {
|
||||||
|
noExternal: ["@pdfme/generator", "@pdfme/common", "@pdfme/schemas"]
|
||||||
},
|
},
|
||||||
resolve: {
|
build: {
|
||||||
alias: {
|
commonjsOptions: {
|
||||||
"#": fileURLToPath(new URL("./src", import.meta.url))
|
transformMixedEsModules: false
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
build: {
|
},
|
||||||
commonjsOptions: {
|
|
||||||
transformMixedEsModules: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
adapter: node({
|
adapter: node({
|
||||||
mode: "middleware"
|
mode: "middleware"
|
||||||
}),
|
}),
|
||||||
server: {
|
server: {
|
||||||
port: 3000
|
port: 3000
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
66
build.sh
66
build.sh
@@ -14,38 +14,24 @@ DB_PORT=5432
|
|||||||
# ausgeführt zu werden. Außerdem würde es nicht wirklich Sinn ergeben, wenn das
|
# ausgeführt zu werden. Außerdem würde es nicht wirklich Sinn ergeben, wenn das
|
||||||
# Build Skript sich die Änderungen am build Skript holen würde...
|
# Build Skript sich die Änderungen am build Skript holen würde...
|
||||||
# Wir müssen alle lokalen Pakete verlinken
|
# Wir müssen alle lokalen Pakete verlinken
|
||||||
|
|
||||||
|
# --------------------------------- Database --------------------------------- #
|
||||||
|
|
||||||
cd ../database
|
cd ../database
|
||||||
bun link
|
bun link
|
||||||
cd ../api
|
|
||||||
bun link
|
|
||||||
cd ../ui
|
|
||||||
bun link
|
|
||||||
cd ../database
|
|
||||||
bun install
|
bun install
|
||||||
|
|
||||||
|
# ------------------------------------ API ----------------------------------- #
|
||||||
|
|
||||||
cd ../api
|
cd ../api
|
||||||
bun install
|
bun install
|
||||||
cd ../ui
|
bun link @ibcornelsen/database
|
||||||
bun install
|
|
||||||
|
# ------------------------------------ APP ----------------------------------- #
|
||||||
|
|
||||||
cd ../$APP_NAME
|
cd ../$APP_NAME
|
||||||
|
|
||||||
|
|
||||||
# Als erstes linken wir das package mit yalc, damit wir z.B. in online-energieausweis darauf zugreifen können.
|
|
||||||
cd ../database
|
|
||||||
bunx yalc push --scripts
|
|
||||||
cd ../api
|
|
||||||
bunx yalc push --scripts
|
|
||||||
cd ../$APP_NAME
|
|
||||||
bunx yalc add @ibcornelsen/database
|
|
||||||
bunx yalc add @ibcornelsen/api
|
|
||||||
# Dann installieren wir noch einmal alle dependencies, das ist besonders wichtig
|
|
||||||
# falls wir lokal verlinkte Projekte haben, sonst werden die nicht in unser
|
|
||||||
# docker image übernommen
|
|
||||||
bun install
|
bun install
|
||||||
|
bun link @ibcornelsen/database
|
||||||
# Dann stoppen wir unser altes docker image und bauen es neu.
|
|
||||||
docker stop $APP_NAME
|
|
||||||
docker rm $APP_NAME
|
|
||||||
docker build -t $APP_NAME .
|
|
||||||
|
|
||||||
# Jeder unserer Applikationen hat ein Verzeichnis in dem alle Dateien dauerhaft,
|
# Jeder unserer Applikationen hat ein Verzeichnis in dem alle Dateien dauerhaft,
|
||||||
# Versionsunabhängig gespeichert werden. Dieses legen wir hier an, falls es noch
|
# Versionsunabhängig gespeichert werden. Dieses legen wir hier an, falls es noch
|
||||||
@@ -54,10 +40,10 @@ PERSISTENT_DIR="${HOME}/persistent/${APP_NAME}";
|
|||||||
mkdir -p $PERSISTENT_DIR;
|
mkdir -p $PERSISTENT_DIR;
|
||||||
|
|
||||||
# TODO: Wir legen hier die .env Datei an, die die SSL Zertifikate enthält.
|
# TODO: Wir legen hier die .env Datei an, die die SSL Zertifikate enthält.
|
||||||
# rm -f ~/$APP_NAME/.env;
|
rm -f ~/$APP_NAME/.env;
|
||||||
# touch ~/$APP_NAME/.env;
|
touch ~/$APP_NAME/.env;
|
||||||
# echo "PRIVATE_KEY=$(cat /etc/letsencrypt/live/ibcornelsen.de/privkey.pem | base64 | tr -d '\n')" >> ~/$APP_NAME/.env;
|
echo "PRIVATE_KEY=$(cat /etc/letsencrypt/live/ibcornelsen.de/privkey.pem | base64 | tr -d '\n')" >> ~/$APP_NAME/.env;
|
||||||
# echo "CERTIFICATE=$(cat /etc/letsencrypt/live/ibcornelsen.de/fullchain.pem | base64 | tr -d '\n')" >> ~/$APP_NAME/.env;
|
echo "CERTIFICATE=$(cat /etc/letsencrypt/live/ibcornelsen.de/fullchain.pem | base64 | tr -d '\n')" >> ~/$APP_NAME/.env;
|
||||||
|
|
||||||
# Wir müssen sichergehen, dass der Database Container läuft, sonst können wir ihn nicht linken.
|
# Wir müssen sichergehen, dass der Database Container läuft, sonst können wir ihn nicht linken.
|
||||||
if [ ! $((docker ps | grep $DB_CONTAINER_NAME) | wc -l) -gt 0 ]; then
|
if [ ! $((docker ps | grep $DB_CONTAINER_NAME) | wc -l) -gt 0 ]; then
|
||||||
@@ -66,12 +52,20 @@ if [ ! $((docker ps | grep $DB_CONTAINER_NAME) | wc -l) -gt 0 ]; then
|
|||||||
cd ../$APP_NAME;
|
cd ../$APP_NAME;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Auch die API sollte bereits laufen
|
||||||
|
if [ $(pm2 pid api) -eq "0" ]; then
|
||||||
|
cd ../api;
|
||||||
|
make prod;
|
||||||
|
cd ../$APP_NAME;
|
||||||
|
fi
|
||||||
|
|
||||||
# Jetzt wo wir alle Vorbereitungen getroffen haben, starten wir das Docker Image und linken es mit der Datenbank.
|
# Jetzt wo wir alle Vorbereitungen getroffen haben, starten wir das Docker Image und linken es mit der Datenbank.
|
||||||
docker run -d --name $APP_NAME --link $DB_CONTAINER_NAME \
|
# docker run -d --name $APP_NAME --link $DB_CONTAINER_NAME \
|
||||||
-v "${PERSISTENT_DIR}:/persistent" \
|
# -v "${PERSISTENT_DIR}:/persistent" \
|
||||||
-v "./node_modules/@ibcornelsen/database:/${APP_NAME}/node_modules/@ibcornelsen/database" \
|
# -v "./node_modules/@ibcornelsen/database:/${APP_NAME}/node_modules/@ibcornelsen/database" \
|
||||||
-v "./node_modules/@ibcornelsen/api:/${APP_NAME}/node_modules/@ibcornelsen/api" \
|
# -v "./node_modules/@ibcornelsen/api:/${APP_NAME}/node_modules/@ibcornelsen/api" \
|
||||||
-v "./node_modules/@ibcornelsen/ui:/${APP_NAME}/node_modules/@ibcornelsen/ui" \
|
# -v "./node_modules/@ibcornelsen/ui:/${APP_NAME}/node_modules/@ibcornelsen/ui" \
|
||||||
-p "${APP_PORT}:3000" \
|
# -p "${APP_PORT}:3000" \
|
||||||
$APP_NAME;
|
# $APP_NAME;
|
||||||
|
|
||||||
|
make prod
|
||||||
68
package.json
68
package.json
@@ -17,62 +17,62 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/mdx": "^2.1.1",
|
"@astrojs/mdx": "^3.1.9",
|
||||||
"@astrojs/node": "^5.1.4",
|
"@astrojs/node": "^8.3.4",
|
||||||
"@astrojs/svelte": "^2.2.0",
|
"@astrojs/svelte": "^2.2.0",
|
||||||
"@astrojs/tailwind": "^3.1.3",
|
"@astrojs/tailwind": "^3.1.3",
|
||||||
"@ibcornelsen/api": "link:@ibcornelsen/api",
|
"@ibcornelsen/api": "link:@ibcornelsen/api",
|
||||||
"@ibcornelsen/database": "link:@ibcornelsen/database",
|
"@ibcornelsen/database": "link:@ibcornelsen/database",
|
||||||
"@ibcornelsen/ui": "^0.0.2",
|
"@ibcornelsen/ui": "^0.0.2",
|
||||||
"@mollie/api-client": "^3.7.0",
|
"@mollie/api-client": "^3.7.0",
|
||||||
"@pdfme/common": "^5.1.6",
|
"@pdfme/common": "^5.1.7",
|
||||||
"@pdfme/generator": "^5.1.6",
|
"@pdfme/generator": "^5.1.7",
|
||||||
"@pdfme/ui": "^5.1.6",
|
"@pdfme/ui": "^5.1.7",
|
||||||
"@trpc/client": "^10.45.0",
|
"@trpc/client": "^10.45.2",
|
||||||
"@trpc/server": "^10.45.0",
|
"@trpc/server": "^10.45.2",
|
||||||
"astro": "^2.5.1",
|
"astro": "^4.16.10",
|
||||||
"astro-i18next": "1.0.0-beta.21",
|
"astro-i18next": "1.0.0-beta.21",
|
||||||
"body-scroll-lock": "^4.0.0-beta.0",
|
"body-scroll-lock": "^4.0.0-beta.0",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"bun": "^1.0.2",
|
"bun": "^1.1.34",
|
||||||
"csvtojson": "^2.0.10",
|
"csvtojson": "^2.0.10",
|
||||||
"express": "^4.18.2",
|
"express": "^4.21.1",
|
||||||
"flag-icons": "^6.9.2",
|
"flag-icons": "^6.15.0",
|
||||||
"fontkit": "^2.0.2",
|
"fontkit": "^2.0.4",
|
||||||
"i18next": "^23.4.1",
|
"i18next": "^23.16.5",
|
||||||
"i18next-fs-backend": "^2.1.5",
|
"i18next-fs-backend": "^2.3.2",
|
||||||
"i18next-http-backend": "^2.2.1",
|
"i18next-http-backend": "^2.6.2",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"js-interpolate": "^1.0.1",
|
"js-interpolate": "^1.0.1",
|
||||||
"katex": "^0.16.7",
|
|
||||||
"moment": "^2.29.4",
|
|
||||||
"moment-timezone": "^0.5.45",
|
|
||||||
"postcss-nested": "^7.0.2",
|
"postcss-nested": "^7.0.2",
|
||||||
|
"katex": "^0.16.11",
|
||||||
|
"moment": "^2.30.1",
|
||||||
|
"moment-timezone": "^0.5.46",
|
||||||
"radix-svelte-icons": "^1.0.0",
|
"radix-svelte-icons": "^1.0.0",
|
||||||
"sass": "^1.62.1",
|
"sass": "^1.80.6",
|
||||||
"svelte": "^3.59.1",
|
"svelte": "^3.59.2",
|
||||||
"svelte-dialogs": "^1.2.2",
|
"svelte-dialogs": "^1.2.2",
|
||||||
"svelte-preprocess": "^5.0.3",
|
"svelte-preprocess": "^5.1.4",
|
||||||
"svelte-ripple-action": "^1.0.5",
|
"svelte-ripple-action": "^1.0.6",
|
||||||
"tailwindcss": "^3.4.15",
|
"tailwindcss": "^3.4.14",
|
||||||
"trpc-openapi": "^1.2.0",
|
"trpc-openapi": "^1.2.0",
|
||||||
"uuid": "^9.0.0",
|
"uuid": "^9.0.1",
|
||||||
"zod": "^3.22.4"
|
"zod": "^3.23.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@faker-js/faker": "^8.3.1",
|
"@faker-js/faker": "^8.4.1",
|
||||||
"@tailwindcss/typography": "^0.5.10",
|
"@tailwindcss/typography": "^0.5.15",
|
||||||
"@types/body-scroll-lock": "^3.1.2",
|
"@types/body-scroll-lock": "^3.1.2",
|
||||||
"@types/fontkit": "^2.0.6",
|
"@types/fontkit": "^2.0.7",
|
||||||
"@types/js-cookie": "^3.0.6",
|
"@types/js-cookie": "^3.0.6",
|
||||||
"@types/uuid": "^9.0.1",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^5.59.6",
|
|
||||||
"@typescript-eslint/parser": "^5.59.6",
|
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"bun-types": "^1.0.22",
|
"@types/uuid": "^9.0.8",
|
||||||
"cypress": "^13.6.2",
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
||||||
|
"@typescript-eslint/parser": "^5.62.0",
|
||||||
|
"bun-types": "^1.1.34",
|
||||||
|
"cypress": "^13.15.2",
|
||||||
"cypress-file-upload": "^5.0.8",
|
"cypress-file-upload": "^5.0.8",
|
||||||
"daisyui": "^4.6.0",
|
"daisyui": "^4.12.14",
|
||||||
"eslint": "~8.15.0",
|
"eslint": "~8.15.0",
|
||||||
"eslint-config-prettier": "8.1.0",
|
"eslint-config-prettier": "8.1.0",
|
||||||
"postcss": "^8.4.49",
|
"postcss": "^8.4.49",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import { API_ACCESS_TOKEN_COOKIE_NAME, API_REFRESH_TOKEN_COOKIE_NAME, API_UID_COOKIE_NAME } from "../../lib/constants";
|
import { API_ACCESS_TOKEN_COOKIE_NAME, API_REFRESH_TOKEN_COOKIE_NAME, API_UID_COOKIE_NAME } from "#lib/constants.js";
|
||||||
import { client } from "src/trpc";
|
import { client } from "../../trpc.js";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
VerbrauchsausweisWohnenClient,
|
VerbrauchsausweisWohnenClient,
|
||||||
} from "./Ausweis/types.js";
|
} from "./Ausweis/types.js";
|
||||||
import AusweisPruefenTooltip from "./AusweisPruefenTooltip.svelte";
|
import AusweisPruefenTooltip from "./AusweisPruefenTooltip.svelte";
|
||||||
import { addNotification } from "./NotificationProvider/shared";
|
import { addNotification } from "./NotificationProvider/shared.js";
|
||||||
import { CheckCircled, CrossCircled, Image } from "radix-svelte-icons";
|
import { CheckCircled, CrossCircled, Image } from "radix-svelte-icons";
|
||||||
import ChevronDown from "radix-svelte-icons/src/lib/icons/ChevronDown.svelte";
|
import ChevronDown from "radix-svelte-icons/src/lib/icons/ChevronDown.svelte";
|
||||||
|
|
||||||
@@ -158,13 +158,13 @@
|
|||||||
if (gebaeude_aufnahme_allgemein.solarsystem_warmwasser) {
|
if (gebaeude_aufnahme_allgemein.solarsystem_warmwasser) {
|
||||||
// Wenn Warmwasser Anteil unbekannt und Solarsystem
|
// Wenn Warmwasser Anteil unbekannt und Solarsystem
|
||||||
verbrauchWWGesamt_1 =
|
verbrauchWWGesamt_1 =
|
||||||
calculations?.energetische_nutzfläche +
|
calculations?.energetischeNutzflaeche +
|
||||||
" m² x 12 kWh/m² x 3 Jahre";
|
" m² x 12 kWh/m² x 3 Jahre";
|
||||||
solarsystemWarmwasser = "Solarsystem Warmwasser";
|
solarsystemWarmwasser = "Solarsystem Warmwasser";
|
||||||
} else {
|
} else {
|
||||||
// Wenn Warmwasser Anteil unbekannt und **kein** Solarsystem
|
// Wenn Warmwasser Anteil unbekannt und **kein** Solarsystem
|
||||||
verbrauchWWGesamt_1 =
|
verbrauchWWGesamt_1 =
|
||||||
calculations?.energetische_nutzfläche +
|
calculations?.energetischeNutzflaeche +
|
||||||
" m² x 20 kWh/m² x 3 Jahre";
|
" m² x 20 kWh/m² x 3 Jahre";
|
||||||
solarsystemWarmwasser = "kein Solarsystem Warmwasser";
|
solarsystemWarmwasser = "kein Solarsystem Warmwasser";
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@
|
|||||||
ausweis.keller_beheizt +
|
ausweis.keller_beheizt +
|
||||||
" ) in m²";
|
" ) in m²";
|
||||||
table3Z1 = gebaeude_aufnahme_allgemein.flaeche;
|
table3Z1 = gebaeude_aufnahme_allgemein.flaeche;
|
||||||
table3Z2 = calculations?.energetische_nutzfläche;
|
table3Z2 = calculations?.energetischeNutzflaeche;
|
||||||
|
|
||||||
|
|
||||||
tooltip4Z1 =
|
tooltip4Z1 =
|
||||||
@@ -261,7 +261,7 @@
|
|||||||
|
|
||||||
|
|
||||||
tooltip8Z1 =
|
tooltip8Z1 =
|
||||||
calculations?.energetische_nutzfläche +
|
calculations?.energetischeNutzflaeche +
|
||||||
" m² x 6 kWh/m² x 3 Jahre >> Kühlungszuschlag in kWh";
|
" m² x 6 kWh/m² x 3 Jahre >> Kühlungszuschlag in kWh";
|
||||||
tooltip8Z2 = "";
|
tooltip8Z2 = "";
|
||||||
table8Z1 = calculations?.kuehlungsZuschlag;
|
table8Z1 = calculations?.kuehlungsZuschlag;
|
||||||
@@ -277,7 +277,7 @@
|
|||||||
" + " +
|
" + " +
|
||||||
calculations?.energieVerbrauchHeizungBereinigt_2 +
|
calculations?.energieVerbrauchHeizungBereinigt_2 +
|
||||||
") / (3 * " +
|
") / (3 * " +
|
||||||
calculations?.energetische_nutzfläche +
|
calculations?.energetischeNutzflaeche +
|
||||||
") >> Durchschnittsverbrauch Heizung in kWh";
|
") >> Durchschnittsverbrauch Heizung in kWh";
|
||||||
table9Z1 =
|
table9Z1 =
|
||||||
calculations?.faktorDurchschnittsEnergieVerbrauchHeizungBereinigt;
|
calculations?.faktorDurchschnittsEnergieVerbrauchHeizungBereinigt;
|
||||||
@@ -288,7 +288,7 @@
|
|||||||
"faktorDurchschnittsEnergieVerbrauchHeizungBereinigt"
|
"faktorDurchschnittsEnergieVerbrauchHeizungBereinigt"
|
||||||
] +
|
] +
|
||||||
" x " +
|
" x " +
|
||||||
calculations.leerstand +
|
calculations?.leerstand +
|
||||||
" x (" +
|
" x (" +
|
||||||
calculations.energieVerbrauchHeizungBereinigt_1 +
|
calculations.energieVerbrauchHeizungBereinigt_1 +
|
||||||
" + " +
|
" + " +
|
||||||
@@ -304,21 +304,13 @@
|
|||||||
table10Z1 = calculations?.leerstandsZuschlagHeizung;
|
table10Z1 = calculations?.leerstandsZuschlagHeizung;
|
||||||
table10Z2 = calculations?.leerstandsZuschlagWarmwasser;
|
table10Z2 = calculations?.leerstandsZuschlagWarmwasser;
|
||||||
|
|
||||||
tooltip11Z1 =
|
|
||||||
"(" +
|
|
||||||
calculations?.energieVerbrauchHeizungBereinigt_1 +
|
|
||||||
" + " +
|
|
||||||
calculations?.energieVerbrauchWarmwasser_1 +
|
|
||||||
") / (3 Jahre x " +
|
|
||||||
calculations?.energetische_nutzfläche +
|
|
||||||
") Endenergieverbrauch 1 in kWh/m²a";
|
|
||||||
tooltip11Z2 =
|
tooltip11Z2 =
|
||||||
"(" +
|
"(" +
|
||||||
calculations?.energieVerbrauchHeizungBereinigt_2 +
|
calculations?.energieVerbrauchHeizungBereinigt_2 +
|
||||||
" + " +
|
" + " +
|
||||||
calculations?.energieVerbrauchWarmwasser_2 +
|
calculations?.energieVerbrauchWarmwasser_2 +
|
||||||
") / (3 Jahre x " +
|
") / (3 Jahre x " +
|
||||||
calculations?.energetische_nutzfläche +
|
calculations?.energetischeNutzflaeche +
|
||||||
") Endenergieverbrauch 2 in kWh/m²a";
|
") Endenergieverbrauch 2 in kWh/m²a";
|
||||||
table11Z1 = calculations?.endEnergieVerbrauch_1;
|
table11Z1 = calculations?.endEnergieVerbrauch_1;
|
||||||
table11Z2 = calculations?.endEnergieVerbrauch_2;
|
table11Z2 = calculations?.endEnergieVerbrauch_2;
|
||||||
@@ -333,7 +325,7 @@
|
|||||||
" x " +
|
" x " +
|
||||||
calculations?.primaerfaktorww +
|
calculations?.primaerfaktorww +
|
||||||
")) / (3 Jahre x " +
|
")) / (3 Jahre x " +
|
||||||
calculations?.energetische_nutzfläche +
|
calculations?.energetischeNutzflaeche +
|
||||||
") Primärenergieverbrauch 1 in kWh/m²a";
|
") Primärenergieverbrauch 1 in kWh/m²a";
|
||||||
tooltip12Z2 =
|
tooltip12Z2 =
|
||||||
"((" +
|
"((" +
|
||||||
@@ -345,7 +337,7 @@
|
|||||||
" x " +
|
" x " +
|
||||||
calculations?.primaerfaktorww_1 +
|
calculations?.primaerfaktorww_1 +
|
||||||
")) / (3 Jahre x " +
|
")) / (3 Jahre x " +
|
||||||
calculations?.energetische_nutzfläche +
|
calculations?.energetischeNutzflaeche +
|
||||||
") Primärenergieverbrauch 2 in kWh/m²a";
|
") Primärenergieverbrauch 2 in kWh/m²a";
|
||||||
table12Z1 = calculations?.primaerEnergieVerbrauch_1;
|
table12Z1 = calculations?.primaerEnergieVerbrauch_1;
|
||||||
table12Z2 = calculations?.primaerEnergieVerbrauch_2;
|
table12Z2 = calculations?.primaerEnergieVerbrauch_2;
|
||||||
@@ -356,13 +348,13 @@
|
|||||||
" + " +
|
" + " +
|
||||||
calculations?.leerstandsZuschlagWarmwasser +
|
calculations?.leerstandsZuschlagWarmwasser +
|
||||||
") / (3 Jahre x " +
|
") / (3 Jahre x " +
|
||||||
calculations?.energetische_nutzfläche +
|
calculations?.energetischeNutzflaeche +
|
||||||
") Endenergieverbrauch Leerstand in kWh/m²a";
|
") Endenergieverbrauch Leerstand in kWh/m²a";
|
||||||
tooltip13Z2 =
|
tooltip13Z2 =
|
||||||
"(" +
|
"(" +
|
||||||
calculations?.kuehlungsZuschlag +
|
calculations?.kuehlungsZuschlag +
|
||||||
") / (3 Jahre x " +
|
") / (3 Jahre x " +
|
||||||
calculations?.energetische_nutzfläche +
|
calculations?.energetischeNutzflaeche +
|
||||||
") Endenergieverbrauch Kühlung in kWh/m²a";
|
") Endenergieverbrauch Kühlung in kWh/m²a";
|
||||||
table13Z1 = calculations?.endEnergieVerbrauchLeerstandsZuschlag;
|
table13Z1 = calculations?.endEnergieVerbrauchLeerstandsZuschlag;
|
||||||
table13Z2 = calculations?.endEnergieVerbrauchKuehlungsZuschlag;
|
table13Z2 = calculations?.endEnergieVerbrauchKuehlungsZuschlag;
|
||||||
@@ -509,7 +501,7 @@
|
|||||||
<span>{ausweis.faktorKeller} x {gebaeude_aufnahme_allgemein.flaeche}m² Energetische Nutzfläche (Keller {gebaeude_aufnahme_allgemein.keller}) in m²</span>
|
<span>{ausweis.faktorKeller} x {gebaeude_aufnahme_allgemein.flaeche}m² Energetische Nutzfläche (Keller {gebaeude_aufnahme_allgemein.keller}) in m²</span>
|
||||||
</div>
|
</div>
|
||||||
<span>{gebaeude_aufnahme_allgemein.flaeche}</span>
|
<span>{gebaeude_aufnahme_allgemein.flaeche}</span>
|
||||||
<span><strong>{calculations?.energetische_nutzfläche}</strong></span>
|
<span><strong>{calculations?.energetischeNutzflaeche}</strong></span>
|
||||||
</AusweisPruefenTooltip>
|
</AusweisPruefenTooltip>
|
||||||
</td
|
</td
|
||||||
>
|
>
|
||||||
@@ -604,7 +596,7 @@
|
|||||||
>
|
>
|
||||||
<AusweisPruefenTooltip>
|
<AusweisPruefenTooltip>
|
||||||
<div slot="tooltip">
|
<div slot="tooltip">
|
||||||
<span>{tooltip11Z1}</span>
|
<span>({calculations?.energieVerbrauchHeizungBereinigt_1} + {calculations?.energieVerbrauchWarmwasser_1}) / (3 Jahre x {calculations?.energetischeNutzflaeche}) Endenergieverbrauch 1 in kWh/m²a</span>
|
||||||
<br>
|
<br>
|
||||||
<span>{tooltip11Z2}</span>
|
<span>{tooltip11Z2}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -748,7 +740,7 @@
|
|||||||
<td title="Ausweis ausstellen" class="w-4 p-1"
|
<td title="Ausweis ausstellen" class="w-4 p-1"
|
||||||
><button
|
><button
|
||||||
class="btn btn-xs btn-ghost"
|
class="btn btn-xs btn-ghost"
|
||||||
on:click={() => ausweisAusstellen('{gebaeude_aufnahme_allgemein.uid}')}>A</button
|
on:click={() => ausweisAusstellen(gebaeude_aufnahme_allgemein.uid)}>A</button
|
||||||
></td
|
></td
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
@@ -756,7 +748,7 @@
|
|||||||
class="w-4 p-1"
|
class="w-4 p-1"
|
||||||
><button
|
><button
|
||||||
class="btn btn-xs btn-ghost"
|
class="btn btn-xs btn-ghost"
|
||||||
on:click={() => ausweisAusstellenPost('{gebaeude_aufnahme_allgemein.uid}')}>P</button
|
on:click={() => ausweisAusstellenPost(gebaeude_aufnahme_allgemein.uid)}>P</button
|
||||||
></td
|
></td
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
@@ -764,7 +756,7 @@
|
|||||||
class="w-4 p-1"
|
class="w-4 p-1"
|
||||||
><button
|
><button
|
||||||
class="btn btn-xs btn-ghost"
|
class="btn btn-xs btn-ghost"
|
||||||
on:click={() => ausweisnichtAusstellen('{gebaeude_aufnahme_allgemein.uid}')}>N</button
|
on:click={() => ausweisnichtAusstellen(gebaeude_aufnahme_allgemein.uid)}>N</button
|
||||||
></td
|
></td
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
@@ -772,7 +764,7 @@
|
|||||||
class="w-4 p-1"
|
class="w-4 p-1"
|
||||||
><button
|
><button
|
||||||
class="btn btn-xs btn-ghost"
|
class="btn btn-xs btn-ghost"
|
||||||
on:click={() => bestellBestaetigung('{gebaeude_aufnahme_allgemein.uid}')}>B</button
|
on:click={() => bestellBestaetigung(gebaeude_aufnahme_allgemein.uid)}>B</button
|
||||||
></td
|
></td
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
@@ -780,7 +772,7 @@
|
|||||||
class="w-4 p-1"
|
class="w-4 p-1"
|
||||||
><button
|
><button
|
||||||
class="btn btn-xs btn-ghost"
|
class="btn btn-xs btn-ghost"
|
||||||
on:click={() => erinnern('{gebaeude_aufnahme_allgemein.uid}')}
|
on:click={() => erinnern(gebaeude_aufnahme_allgemein.uid)}
|
||||||
>E</button
|
>E</button
|
||||||
></td
|
></td
|
||||||
>
|
>
|
||||||
@@ -793,12 +785,16 @@
|
|||||||
href="/energieausweis-erstellen/gespeichert?id={gebaeude_aufnahme_allgemein.uid}">F</a
|
href="/energieausweis-erstellen/gespeichert?id={gebaeude_aufnahme_allgemein.uid}">F</a
|
||||||
></td
|
></td
|
||||||
>
|
>
|
||||||
{@html gebaeude_aufnahme_allgemein.kontrolldatei
|
{#if gebaeude_aufnahme_allgemein.kontrolldatei}
|
||||||
? `<td title="XML-Datei an das DiBT verschicken." class="w-4 p-1"><button class="btn btn-xs btn-ghost" on:click="xmlAbschicken('{gebaeude_aufnahme_allgemein.uid}')">X</button></td>`
|
<td title="XML-Datei an das DiBT verschicken." class="w-4 p-1"><button class="btn btn-xs btn-ghost" on:click={() => {
|
||||||
: ""}
|
xmlAbschicken(gebaeude_aufnahme_allgemein.uid)
|
||||||
{@html !gebaeude_aufnahme_allgemein.registriernummer
|
}}>X</button></td>
|
||||||
? `<td title="Registriernummer vom DiBT anfordern." class="w-4 p-1"><button class="btn btn-xs btn-ghost" on:click="registriernummerAnfordern('{gebaeude_aufnahme_allgemein.uid}')">R</button></td>`
|
{/if}
|
||||||
: ""}
|
{#if !gebaeude_aufnahme_allgemein.registriernummer}
|
||||||
|
<td title="Registriernummer vom DiBT anfordern." class="w-4 p-1"><button class="btn btn-xs btn-ghost" on:click={() => {
|
||||||
|
registriernummerAnfordern(gebaeude_aufnahme_allgemein.uid)
|
||||||
|
}}>R</button></td>
|
||||||
|
{/if}
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
import {
|
||||||
VerbrauchsausweisWohnenClient,
|
VerbrauchsausweisWohnenClient,
|
||||||
} from "#components/Ausweis/types";
|
} from "#components/Ausweis/types.js";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { dialogs } from "svelte-dialogs";
|
import { dialogs } from "svelte-dialogs";
|
||||||
import {
|
import {
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
Pencil2,
|
Pencil2,
|
||||||
QuestionMarkCircled,
|
QuestionMarkCircled,
|
||||||
} from "radix-svelte-icons";
|
} from "radix-svelte-icons";
|
||||||
import { endEnergieVerbrauchVerbrauchsausweis_2016 } from "#lib/Berechnungen/VerbrauchsausweisWohnen/VerbrauchsausweisWohnen_2016";
|
import { endEnergieVerbrauchVerbrauchsausweis_2016 } from "#lib/Berechnungen/VerbrauchsausweisWohnen/VerbrauchsausweisWohnen_2016.js";
|
||||||
import { client } from "src/trpc";
|
import { client } from "src/trpc.js";
|
||||||
|
|
||||||
export let ausweis: VerbrauchsausweisWohnenClient;
|
export let ausweis: VerbrauchsausweisWohnenClient;
|
||||||
export let progress: number;
|
export let progress: number;
|
||||||
@@ -167,7 +167,7 @@
|
|||||||
{/await}
|
{/await}
|
||||||
<div class="card-actions justify-end mt-8">
|
<div class="card-actions justify-end mt-8">
|
||||||
<a class="btn btn-primary" href="/energieausweis-erstellen/verbrauchsausweis-wohnen?uid={ausweis.uid}">Bearbeiten</a>
|
<a class="btn btn-primary" href="/energieausweis-erstellen/verbrauchsausweis-wohnen?uid={ausweis.uid}">Bearbeiten</a>
|
||||||
<a class="btn btn-ghost" title="PDF Herunterladen" target="_blank" href="/pdf/ansichtsausweis?ausweis_uid={ausweis.uid}">
|
<a class="btn btn-ghost" title="PDF Herunterladen" target="_blank" href="/pdf/ansichtsausweis?uid={ausweis.uid}">
|
||||||
<Download size={22} />
|
<Download size={22} />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import ThemeController from "./ThemeController.svelte";
|
|||||||
|
|
||||||
const valid = await validateAccessTokenServer(Astro)
|
const valid = await validateAccessTokenServer(Astro)
|
||||||
|
|
||||||
const lightTheme = Astro.cookies.get("theme").value === "light";
|
const lightTheme = Astro.cookies.get("theme")?.value === "light";
|
||||||
---
|
---
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import RawNotification from "./RawNotification.svelte";
|
import RawNotification from "./RawNotification.svelte";
|
||||||
import { Notification } from "./shared";
|
import { Notification } from "./shared.js";
|
||||||
|
|
||||||
export let notification: Notification & { uid: string };
|
export let notification: Notification & { uid: string };
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import Notification from "./Notification.svelte";
|
import Notification from "./Notification.svelte";
|
||||||
import RawNotificationWrapper from "./RawNotificationWrapper.svelte";
|
import RawNotificationWrapper from "./RawNotificationWrapper.svelte";
|
||||||
|
|
||||||
import { notifications } from "./shared";
|
import { notifications } from "./shared.js";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<RawNotificationWrapper>
|
<RawNotificationWrapper>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Notification, deleteNotification } from "./shared";
|
import { Notification, deleteNotification } from "./shared.js";
|
||||||
import { fly } from "svelte/transition";
|
import { fly } from "svelte/transition";
|
||||||
|
|
||||||
export let notification: Partial<Notification> & { uid: string };
|
export let notification: Partial<Notification> & { uid: string };
|
||||||
|
|||||||
9
src/components/Notifications/index.ts
Normal file
9
src/components/Notifications/index.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import Notification from "./Notification.svelte";
|
||||||
|
export { Notification };
|
||||||
|
import NotificationWrapper from "./NotificationWrapper.svelte";
|
||||||
|
export { NotificationWrapper };
|
||||||
|
import RawNotificationWrapper from "./RawNotificationWrapper.svelte";
|
||||||
|
export { RawNotificationWrapper };
|
||||||
|
import RawNotification from "./RawNotification.svelte";
|
||||||
|
export { RawNotification };
|
||||||
|
export * from "./shared.js";
|
||||||
@@ -1,4 +1,15 @@
|
|||||||
|
---
|
||||||
|
import { validateAccessTokenServer } from "#server/lib/validateAccessToken";
|
||||||
|
import SidebarWidgetLogin from "./SidebarWidgetLogin.svelte";
|
||||||
|
import SidebarWidgetProfile from "./SidebarWidgetProfile.svelte"
|
||||||
|
|
||||||
|
const loggedin = await validateAccessTokenServer(Astro)
|
||||||
|
---
|
||||||
|
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
|
{ !loggedin ?
|
||||||
|
<SidebarWidgetLogin client:load></SidebarWidgetLogin> : <SidebarWidgetProfile></SidebarWidgetProfile>}
|
||||||
|
|
||||||
<div class="infoCard">
|
<div class="infoCard">
|
||||||
<h2 style="font-weight: bold; font-size: 1.2em; color: #3A4AB5;">
|
<h2 style="font-weight: bold; font-size: 1.2em; color: #3A4AB5;">
|
||||||
Rufen Sie uns an<br /> Wir sind gerne für Sie da
|
Rufen Sie uns an<br /> Wir sind gerne für Sie da
|
||||||
|
|||||||
96
src/components/SidebarWidgetLogin.svelte
Normal file
96
src/components/SidebarWidgetLogin.svelte
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { loginClient } from "#lib/login";
|
||||||
|
import CrossCircled from "radix-svelte-icons/src/lib/icons/CrossCircled.svelte";
|
||||||
|
import { fade } from "svelte/transition";
|
||||||
|
|
||||||
|
let email: string;
|
||||||
|
let passwort: string;
|
||||||
|
|
||||||
|
async function login(e: SubmitEvent) {
|
||||||
|
console.log(e);
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
const response = await loginClient(email, passwort);
|
||||||
|
|
||||||
|
if (response === null) {
|
||||||
|
errorHidden = false;
|
||||||
|
} else {
|
||||||
|
window.location.href = "/dashboard";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let errorHidden = true;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div
|
||||||
|
id="card-login"
|
||||||
|
class="box card hidden bg-white px-6 py-4 mb-5
|
||||||
|
lg:block"
|
||||||
|
>
|
||||||
|
<div class="grid">
|
||||||
|
<div class="grid grid-cols-[2rem,1fr,1fr]">
|
||||||
|
<img
|
||||||
|
class="w-6 align-middle"
|
||||||
|
src="/images/right-sidebar/UMBE_user-icon.svg"
|
||||||
|
alt="user-icon"
|
||||||
|
/>
|
||||||
|
<h2 class="text-secondary">Kunden Login</h2>
|
||||||
|
<div class="justify-self-end text-secondary">
|
||||||
|
<a
|
||||||
|
class="text-lg font-bold text-box-heading leading-6 no-underline hover:text-primary"
|
||||||
|
href="">Kontakt</a
|
||||||
|
>
|
||||||
|
/
|
||||||
|
<a
|
||||||
|
class="text-lg font-bold text-box-heading leading-6 no-underline hover:text-primary"
|
||||||
|
href="">AGB</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr class="mb-4" />
|
||||||
|
<form on:submit={login}>
|
||||||
|
<input
|
||||||
|
class="my-1 rounded-md px-2 py-1 ring-1 w-full"
|
||||||
|
type="text"
|
||||||
|
placeholder="nutzer@email.com"
|
||||||
|
name="email"
|
||||||
|
bind:value={email}
|
||||||
|
on:focus={() => (errorHidden = true)}
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
class="my-1 rounded-md px-2 py-1 ring-1 w-full"
|
||||||
|
type="password"
|
||||||
|
minlength="8"
|
||||||
|
placeholder="********"
|
||||||
|
name="passwort"
|
||||||
|
bind:value={passwort}
|
||||||
|
on:focus={() => (errorHidden = true)}
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{#if !errorHidden}
|
||||||
|
<div role="alert" class="alert alert-error" in:fade out:fade={{delay: 400}}>
|
||||||
|
<CrossCircled size={24} />
|
||||||
|
<span class="font-semibold">Das hat leider nicht geklappt, haben sie ihr Passwort und ihre Email Adresse richtig eingegeben?</span>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
<button class="my-1 rounded-md px-2 py-1 ring-1 w-full bg-secondary text-white font-bold hover:bg-primary" type="submit">Einloggen</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-[1fr,1fr]">
|
||||||
|
<a
|
||||||
|
class="justify-self-start text-sm font-bold no-underline hover:text-primary"
|
||||||
|
href="/auth/signup">Registrieren</a
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
class="justify-self-end text-sm font-bold no-underline hover:text-primary"
|
||||||
|
href="/auth/passwort-vergessen">Passwort vergessen</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
</style>
|
||||||
10
src/components/SidebarWidgetProfile.svelte
Normal file
10
src/components/SidebarWidgetProfile.svelte
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div
|
||||||
|
id="card-login"
|
||||||
|
class="box card hidden bg-white px-6 py-4
|
||||||
|
lg:block"
|
||||||
|
>
|
||||||
|
<a href="/dashboard">Profil</a>
|
||||||
|
</div>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
import Login from "#components/UMBE_card-login.svelte";
|
import Login from "#components/SidebarWidgetLogin.svelte";
|
||||||
import Contact from "#components/UMBE_card-contact.svelte";
|
import Contact from "#components/UMBE_card-contact.svelte";
|
||||||
import Review from "#components/UMBE_card-review.svelte";
|
import Review from "#components/UMBE_card-review.svelte";
|
||||||
import VApromo from "#components/UMBE_card-VA-promo.svelte";
|
import VApromo from "#components/UMBE_card-VA-promo.svelte";
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
<script>
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id ="card-login"
|
|
||||||
class=" box card hidden bg-white px-6 py-4 mb-5
|
|
||||||
lg:block">
|
|
||||||
|
|
||||||
<div class="grid">
|
|
||||||
|
|
||||||
<div class="grid grid-cols-[2rem,1fr,1fr]">
|
|
||||||
<img class="w-6 align-middle" src="/images/right-sidebar/UMBE_user-icon.svg" alt="user-icon"/>
|
|
||||||
<h2 class="text-secondary">Kunden Login</h2>
|
|
||||||
<div class="justify-self-end text-secondary">
|
|
||||||
<a class="text-lg font-bold text-box-heading leading-6 no-underline hover:text-primary" href="">Kontakt</a> /
|
|
||||||
<a class="text-lg font-bold text-box-heading leading-6 no-underline hover:text-primary" href="">AGB</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<hr class="mb-4">
|
|
||||||
<form action="" method="">
|
|
||||||
<input class="my-1 rounded-md px-2 py-1 ring-1 w-full" id="user" name="user" type="email" placeholder="e-mail" />
|
|
||||||
<input class="my-1 rounded-md px-2 py-1 ring-1 w-full" id="password" name="password" type="password" placeholder="password" />
|
|
||||||
<button class="my-1 rounded-md px-2 py-1 ring-1 w-full bg-secondary text-white font-bold hover:bg-primary">einloggen</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-[1fr,1fr]">
|
|
||||||
<a class="justify-self-start text-sm font-bold no-underline hover:text-primary" href="">Registrieren</a>
|
|
||||||
<a class="justify-self-end text-sm font-bold no-underline hover:text-primary" href="">Passwort vergessen</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
|
||||||
1
src/env.d.ts
vendored
1
src/env.d.ts
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
/// <reference path="../.astro/types.d.ts" />
|
||||||
/// <reference types="astro/client" />
|
/// <reference types="astro/client" />
|
||||||
|
|
||||||
/// <reference path="../.astro-i18n/generated.d.ts" />
|
/// <reference path="../.astro-i18n/generated.d.ts" />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
|
import "../style/UMBE_global.css";
|
||||||
import "../style/global.scss";
|
import "../style/global.scss";
|
||||||
import "../../svelte-dialogs.config"
|
import "../../svelte-dialogs.config"
|
||||||
import Footer from "../components/Footer.astro";
|
import Footer from "../components/Footer.astro";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { VerbrauchsausweisWohnenClient } from "#components/Ausweis/types";
|
import { VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js";
|
||||||
import { Enums } from "@ibcornelsen/database/client";
|
import { Enums } from "@ibcornelsen/database/client";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { appRouter, t } from "@ibcornelsen/api";
|
import { appRouter, t } from "@ibcornelsen/api";
|
||||||
import { API_ACCESS_TOKEN_COOKIE_NAME } from "./constants";
|
import { API_ACCESS_TOKEN_COOKIE_NAME } from "./constants.js";
|
||||||
|
|
||||||
export const createCaller = function (opts: any) {
|
export const createCaller = function (opts: any) {
|
||||||
// 1. create a caller-function for your router
|
// 1. create a caller-function for your router
|
||||||
const createCaller = t.createCallerFactory(appRouter);
|
const createCaller = t.createCallerFactory(appRouter);
|
||||||
|
|
||||||
const token = Buffer.from(opts.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME).value ?? "", "utf-8").toString("base64");
|
const token = Buffer.from(opts.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value ?? "", "utf-8").toString("base64");
|
||||||
// 2. create a caller using your `Context`
|
// 2. create a caller using your `Context`
|
||||||
return createCaller({
|
return createCaller({
|
||||||
authorization: `Bearer ${token}`,
|
authorization: `Bearer ${token}`,
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
import { VerbrauchsausweisWohnenClient } from "#components/Ausweis/types";
|
import { VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js";
|
||||||
import { generate } from "@pdfme/generator";
|
import { generate } from "@pdfme/generator";
|
||||||
import VerbrauchsausweisWohnen2016Template from "../../lib/pdf/templates/GEG24_Verbrauchsausweis.json";
|
import VerbrauchsausweisWohnen2016Template from "../../lib/pdf/templates/GEG24_Verbrauchsausweis.json";
|
||||||
import { convertAusweisData } from "#lib/AusweisData";
|
import { convertAusweisData } from "#lib/AusweisData.js";
|
||||||
import { variable } from "#lib/pdf/plugins/variables";
|
|
||||||
|
/* -------------------------------- Pdf Tools ------------------------------- */
|
||||||
|
import { variable } from "#lib/pdf/plugins/variables/index.js";
|
||||||
import { text, image } from "@pdfme/schemas";
|
import { text, image } from "@pdfme/schemas";
|
||||||
import { Schema, Template } from "@pdfme/common";
|
import { Schema, Template } from "@pdfme/common";
|
||||||
|
|
||||||
import { Moment } from "moment";
|
import { Moment } from "moment";
|
||||||
import { endEnergieVerbrauchVerbrauchsausweis_2016 } from "#lib/Berechnungen/VerbrauchsausweisWohnen/VerbrauchsausweisWohnen_2016";
|
import { endEnergieVerbrauchVerbrauchsausweis_2016 } from "#lib/Berechnungen/VerbrauchsausweisWohnen/VerbrauchsausweisWohnen_2016.js";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { getEmpfehlungen } from "#lib/XML/getEmpfehlungen";
|
import { getEmpfehlungen } from "#lib/XML/getEmpfehlungen.js";
|
||||||
|
|
||||||
export async function pdfVerbrauchsausweisWohnen(ausweis: VerbrauchsausweisWohnenClient) {
|
export async function pdfVerbrauchsausweisWohnen(ausweis: VerbrauchsausweisWohnenClient) {
|
||||||
const template = VerbrauchsausweisWohnen2016Template as Template;
|
const template = VerbrauchsausweisWohnen2016Template as Template;
|
||||||
|
|||||||
@@ -9,25 +9,25 @@
|
|||||||
import ZipSearch from "#components/PlzSuche.svelte";
|
import ZipSearch from "#components/PlzSuche.svelte";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import BilderZusatzsysteme from "#components/Ausweis/BilderZusatzsysteme.svelte";
|
import BilderZusatzsysteme from "#components/Ausweis/BilderZusatzsysteme.svelte";
|
||||||
import { RawNotificationWrapper, RawNotification, notifications } from "@ibcornelsen/ui";
|
import { RawNotificationWrapper, RawNotification, notifications } from "#components/Notifications/index.js";
|
||||||
import { auditHeizungGebaeudeBaujahr } from "#components/Verbrauchsausweis/audits/HeizungGebaeudeBaujahr";
|
import { auditHeizungGebaeudeBaujahr } from "#components/Verbrauchsausweis/audits/HeizungGebaeudeBaujahr.js";
|
||||||
import { auditHeizungJuengerDreiJahre } from "#components/Verbrauchsausweis/audits/HeizungJuengerDreiJahre";
|
import { auditHeizungJuengerDreiJahre } from "#components/Verbrauchsausweis/audits/HeizungJuengerDreiJahre.js";
|
||||||
import { auditZeitraumAktuell } from "#components/Verbrauchsausweis/audits/ZeitraumAktuell";
|
import { auditZeitraumAktuell } from "#components/Verbrauchsausweis/audits/ZeitraumAktuell.js";
|
||||||
import { auditKlimaFaktoren } from "#components/Verbrauchsausweis/audits/KlimaFaktoren";
|
import { auditKlimaFaktoren } from "#components/Verbrauchsausweis/audits/KlimaFaktoren.js";
|
||||||
import { auditWohnFlaeche } from "#components/Verbrauchsausweis/audits/WohnFlaeche";
|
import { auditWohnFlaeche } from "#components/Verbrauchsausweis/audits/WohnFlaeche.js";
|
||||||
import { auditWarmWasser } from "#components/Verbrauchsausweis/audits/WarmWasser";
|
import { auditWarmWasser } from "#components/Verbrauchsausweis/audits/WarmWasser.js";
|
||||||
import { auditLeerStand } from "#components/Verbrauchsausweis/audits/LeerStand";
|
import { auditLeerStand } from "#components/Verbrauchsausweis/audits/LeerStand.js";
|
||||||
import { auditPlzNichtErkannt } from "#components/Verbrauchsausweis/audits/PlzNichtErkannt";
|
import { auditPlzNichtErkannt } from "#components/Verbrauchsausweis/audits/PlzNichtErkannt.js";
|
||||||
import { AuditType, hidden } from "#components/Verbrauchsausweis/audits/hidden";
|
import { AuditType, hidden } from "#components/Verbrauchsausweis/audits/hidden.js";
|
||||||
import { auditBedarfsausweisBenoetigt } from "#components/Verbrauchsausweis/audits/BedarfsausweisBenoetigt";
|
import { auditBedarfsausweisBenoetigt } from "#components/Verbrauchsausweis/audits/BedarfsausweisBenoetigt.js";
|
||||||
import { auditVerbrauchAbweichung } from "#components/Verbrauchsausweis/audits/VerbrauchAbweichung";
|
import { auditVerbrauchAbweichung } from "#components/Verbrauchsausweis/audits/VerbrauchAbweichung.js";
|
||||||
import { auditEndEnergie } from "#components/Verbrauchsausweis/audits/EndEnergie";
|
import { auditEndEnergie } from "#components/Verbrauchsausweis/audits/EndEnergie.js";
|
||||||
import { auditWohnflaecheGroesserGesamtflaeche } from "#components/Verbrauchsausweis/audits/WohnflaecheGroesserGesamtflaeche";
|
import { auditWohnflaecheGroesserGesamtflaeche } from "#components/Verbrauchsausweis/audits/WohnflaecheGroesserGesamtflaeche.js";
|
||||||
import { Enums } from "@ibcornelsen/database/client"
|
import { Enums } from "@ibcornelsen/database/client"
|
||||||
import Overlay from "#components/Overlay.svelte";
|
import Overlay from "#components/Overlay.svelte";
|
||||||
import AusweisGespeichertModule from "./AusweisGespeichertModule.svelte";
|
import AusweisGespeichertModule from "./AusweisGespeichertModule.svelte";
|
||||||
import { VerbrauchsausweisWohnenClient, BenutzerClient, UploadedGebaeudeBild } from "#components/Ausweis/types";
|
import { VerbrauchsausweisWohnenClient, BenutzerClient, UploadedGebaeudeBild } from "#components/Ausweis/types.js";
|
||||||
import { verbrauchsausweisWohnenSpeichern } from "src/client/lib/verbrauchsausweisWohnenSpeichern";
|
import { verbrauchsausweisWohnenSpeichern } from "src/client/lib/verbrauchsausweisWohnenSpeichern.js";
|
||||||
|
|
||||||
// TODO: Vom Server sollte ein volles Objekt kommen, dass alle Subobjekte enthält, weil es sonst zu Problemen führen kann
|
// TODO: Vom Server sollte ein volles Objekt kommen, dass alle Subobjekte enthält, weil es sonst zu Problemen führen kann
|
||||||
// wenn gebaeude_aufnahme_allgemein oder gebaeude_stammdaten nicht existiert...
|
// wenn gebaeude_aufnahme_allgemein oder gebaeude_stammdaten nicht existiert...
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ if (!accessTokenValid) {
|
|||||||
|
|
||||||
const caller = createCaller(Astro);
|
const caller = createCaller(Astro);
|
||||||
|
|
||||||
const user = await caller.v1.benutzer.self();
|
const user = await caller.v1.benutzer.self(undefined);
|
||||||
const gebaeudeArray = await caller.v1.gebaeude.getMany({ limit: 5 });
|
const gebaeudeArray = await caller.v1.gebaeude.getMany({ limit: 5 });
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ if (base64) {
|
|||||||
const json = buffer.toString("utf-8");
|
const json = buffer.toString("utf-8");
|
||||||
ausweis = JSON.parse(json) as VerbrauchsausweisWohnenClient;
|
ausweis = JSON.parse(json) as VerbrauchsausweisWohnenClient;
|
||||||
} else {
|
} else {
|
||||||
const uidAusweis = Astro.url.searchParams.get("ausweis_uid");
|
const uidAusweis = Astro.url.searchParams.get("uid");
|
||||||
|
|
||||||
if (!uidAusweis) {
|
if (!uidAusweis) {
|
||||||
return Astro.redirect("/404");
|
return Astro.redirect("/404");
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ if (base64) {
|
|||||||
const json = buffer.toString("utf-8");
|
const json = buffer.toString("utf-8");
|
||||||
ausweis = JSON.parse(json) as VerbrauchsausweisWohnenClient;
|
ausweis = JSON.parse(json) as VerbrauchsausweisWohnenClient;
|
||||||
} else {
|
} else {
|
||||||
const uidAusweis = Astro.url.searchParams.get("ausweis_uid");
|
const uidAusweis = Astro.url.searchParams.get("uid");
|
||||||
|
|
||||||
if (!uidAusweis) {
|
if (!uidAusweis) {
|
||||||
return Astro.redirect("/404");
|
return Astro.redirect("/404");
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { createCaller } from "#lib/caller";
|
import { createCaller } from "#lib/caller.js";
|
||||||
import { API_ACCESS_TOKEN_COOKIE_NAME, API_REFRESH_TOKEN_COOKIE_NAME, API_UID_COOKIE_NAME } from "#lib/constants";
|
import { API_ACCESS_TOKEN_COOKIE_NAME, API_REFRESH_TOKEN_COOKIE_NAME, API_UID_COOKIE_NAME } from "#lib/constants.js";
|
||||||
import type { AstroGlobal } from "astro";
|
import type { AstroGlobal } from "astro";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
|
||||||
|
|
||||||
export async function validateAccessTokenServer(astro: AstroGlobal) {
|
export async function validateAccessTokenServer(astro: AstroGlobal) {
|
||||||
const accessToken = astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME).value;
|
const accessToken = astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value;
|
||||||
const refreshToken = astro.cookies.get(API_REFRESH_TOKEN_COOKIE_NAME).value;
|
const refreshToken = astro.cookies.get(API_REFRESH_TOKEN_COOKIE_NAME)?.value;
|
||||||
|
|
||||||
if (!refreshToken) {
|
if (!refreshToken) {
|
||||||
// Wir haben keinen Refresh Token, also müssen wir uns neu anmelden.
|
// Wir haben keinen Refresh Token, also müssen wir uns neu anmelden.
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
// Enable top-level await, and other modern ESM features
|
// Enable top-level await, and other modern ESM features
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"module": "ESNext",
|
"module": "NodeNext",
|
||||||
// Enable node-style module resolution, for things like npm package imports
|
// Enable node-style module resolution, for things like npm package imports
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "NodeNext",
|
||||||
// Enable JSON imports
|
// Enable JSON imports
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
// Enable stricter transpilation for better output
|
// Enable stricter transpilation for better output
|
||||||
@@ -28,6 +28,6 @@
|
|||||||
"#client/*": ["./src/client/*"],
|
"#client/*": ["./src/client/*"],
|
||||||
"#server/*": ["./src/server/*"],
|
"#server/*": ["./src/server/*"],
|
||||||
},
|
},
|
||||||
"types": ["cypress", "cypress-file-upload", "bun-types"]
|
"types": ["cypress", "cypress-file-upload", "bun-types", "svelte"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user