From ce467b13673249b6fcc8d1dab2b831c7489474b7 Mon Sep 17 00:00:00 2001 From: Subliminal Guy <subliminal_kid@posteo.de> Date: Sat, 15 Jun 2024 16:35:38 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20(node=5Fmodules):=20Aktualisiere?= =?UTF-8?q?=20die=20Hashes=20und=20Dateipfade=20f=C3=BCr=20lottie-web-vue,?= =?UTF-8?q?=20vue=20und=20vue3-toastify=20in=20=5Fmetadata.json=20?= =?UTF-8?q?=E2=AC=86=EF=B8=8F=20(package.json):=20F=C3=BCge=20vue3-toastif?= =?UTF-8?q?y=20als=20Abh=C3=A4ngigkeit=20hinzu=20=E2=9C=A8=20(App.vue,=20F?= =?UTF-8?q?orm.vue):=20F=C3=BCge=20die=20Funktion=20sendJson=20hinzu,=20um?= =?UTF-8?q?=20JSON-Daten=20zu=20senden=20und=20Toast-Nachrichten=20anzuzei?= =?UTF-8?q?gen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node_modules/.package-lock.json | 17 ++++++++++ node_modules/.vite/deps/_metadata.json | 16 ++++++--- package-lock.json | 20 +++++++++++- package.json | 3 +- src/App.vue | 45 ++++++++++++++++++++++++++ src/components/Form.vue | 32 ++---------------- 6 files changed, 96 insertions(+), 37 deletions(-) diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 77e0cca..c879910 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -786,6 +786,23 @@ "peerDependencies": { "typescript": "*" } + }, + "node_modules/vue3-toastify": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vue3-toastify/-/vue3-toastify-0.2.1.tgz", + "integrity": "sha512-u4i5LCu1q5qs4L4Kbjb4u8NipCS8ox1fCHQ6XFS62676xnA6Q/AJRpZEkAurTMp723LeH6eQX6k9+24bKf1T4Q==", + "engines": { + "node": ">=16", + "npm": ">=7" + }, + "peerDependencies": { + "vue": ">=3.2.0" + }, + "peerDependenciesMeta": { + "vue": { + "optional": true + } + } } } } diff --git a/node_modules/.vite/deps/_metadata.json b/node_modules/.vite/deps/_metadata.json index 59a05b6..dceb9f0 100644 --- a/node_modules/.vite/deps/_metadata.json +++ b/node_modules/.vite/deps/_metadata.json @@ -1,19 +1,25 @@ { - "hash": "73db24cd", + "hash": "64be97be", "configHash": "f2578dad", - "lockfileHash": "5238c63e", - "browserHash": "33d3d47c", + "lockfileHash": "6427e35a", + "browserHash": "d69337be", "optimized": { "lottie-web-vue": { "src": "../../lottie-web-vue/dist/lottie-web-vue.js", "file": "lottie-web-vue.js", - "fileHash": "d3bf8cec", + "fileHash": "02dd3265", "needsInterop": false }, "vue": { "src": "../../vue/dist/vue.runtime.esm-bundler.js", "file": "vue.js", - "fileHash": "f281c34a", + "fileHash": "86fa3510", + "needsInterop": false + }, + "vue3-toastify": { + "src": "../../vue3-toastify/dist/index.mjs", + "file": "vue3-toastify.js", + "fileHash": "5fe1bb53", "needsInterop": false } }, diff --git a/package-lock.json b/package-lock.json index 3f22dc2..034b0c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,8 @@ "dependencies": { "@lottiefiles/vue-lottie-player": "^1.1.0", "lottie-web-vue": "^2.0.7", - "vue": "^3.4.21" + "vue": "^3.4.21", + "vue3-toastify": "^0.2.1" }, "devDependencies": { "@vitejs/plugin-vue": "^5.0.4", @@ -1306,6 +1307,23 @@ "peerDependencies": { "typescript": "*" } + }, + "node_modules/vue3-toastify": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vue3-toastify/-/vue3-toastify-0.2.1.tgz", + "integrity": "sha512-u4i5LCu1q5qs4L4Kbjb4u8NipCS8ox1fCHQ6XFS62676xnA6Q/AJRpZEkAurTMp723LeH6eQX6k9+24bKf1T4Q==", + "engines": { + "node": ">=16", + "npm": ">=7" + }, + "peerDependencies": { + "vue": ">=3.2.0" + }, + "peerDependenciesMeta": { + "vue": { + "optional": true + } + } } } } diff --git a/package.json b/package.json index 65cdfd0..d987d52 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "dependencies": { "@lottiefiles/vue-lottie-player": "^1.1.0", "lottie-web-vue": "^2.0.7", - "vue": "^3.4.21" + "vue": "^3.4.21", + "vue3-toastify": "^0.2.1" }, "devDependencies": { "@vitejs/plugin-vue": "^5.0.4", diff --git a/src/App.vue b/src/App.vue index c9843c8..b1ce3f5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,10 @@ <script setup lang="ts"> import Form from "./components/Form.vue"; import Lottie from "./components/Lottie.vue"; +import jsonDraft from "./assets/boilerplate.json"; + +import { toast } from "vue3-toastify"; +import "vue3-toastify/dist/index.css"; import { ref } from "vue"; @@ -19,6 +23,46 @@ function playLottie(data: boolean) { function pauseLottie(data: boolean) { pauseLottieStatus.value = data; } + +function sendJson() { + jsonDraft.metadata[1].value = String(`BB${BBEcke.value}`); + jsonDraft.metadata[2].value = String(vorname.value); + jsonDraft.metadata[3].value = String(nachname.value); + jsonDraft.metadata[4].value = String(funktionZeileEins.value); + jsonDraft.metadata[5].value = String(funktionZeileZwei.value); + let outputPath = `G:/VPMS/00-Temp_Austausch/von_Helmut/Schwertgen, David/Bauchbinde_${nachname.value}.mp4`; + jsonDraft.metadata[6].value = String(outputPath); + //download(JSON.stringify(jsonDraft), `test.json`, "text/plain"); + // write a post request to submit the json to the backend + const token = + "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJkczAzMSIsImlwQWRkcmVzcyI6IjE3Mi4xNi43OC4xMzMiLCJpc3MiOiJodHRwczovL2hlbG11dC5yYmItb25saW5lLmRlIiwidXNlcnJvbGUiOiJBRE1JTiIsImlhdCI6MTY4NTE5NTczMCwidXNlcm5hbWUiOiJkczAzMSJ9.TYMYcg1NzCtQuRJCborwPjc1p__e32Ecmtx55I9MdFZ3Ct88TWbH7A48OzsUNeMDYCLLB0R3O21LxYqno1pMRw"; + + fetch("https://helmut.rbb-online.de/v1/io/jobs", { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${token}`, + }, + body: JSON.stringify(jsonDraft), + }) + .then((response) => { + toast.success( + "Die Bauchbinde ist auf den Weg in deinen Helmut-Ordner! In circa 1 Minute ist sie da ...", + { + position: toast.POSITION.TOP_CENTER, + autoClose: 5000, + } + ); // ToastOptions + console.log(response); + }) + .catch((error) => { + // Handle any errors + toast.error("Something went wrong!", { + position: toast.POSITION.TOP_CENTER, + }); + console.log(error); + }); +} </script> <template> @@ -35,6 +79,7 @@ function pauseLottie(data: boolean) { v-model:BBEcke="BBEcke" v-on:playLottie="playLottie" v-on:pauseLottie="pauseLottie" + v-on:sendJson="sendJson" ></Form> <Lottie diff --git a/src/components/Form.vue b/src/components/Form.vue index ab81fe0..95373fb 100644 --- a/src/components/Form.vue +++ b/src/components/Form.vue @@ -1,11 +1,10 @@ <script setup lang="ts"> -const emit = defineEmits(["playLottie", "pauseLottie"]); +const emit = defineEmits(["playLottie", "pauseLottie", "sendJson"]); const vorname = defineModel("vorname"); const nachname = defineModel("nachname"); const funktionZeileEins = defineModel("funktionZeileEins"); const funktionZeileZwei = defineModel("funktionZeileZwei"); const BBEcke = defineModel("BBEcke"); -import jsonDraft from "../assets/boilerplate.json"; function startAnimation() { emit("playLottie", true); @@ -18,34 +17,7 @@ function pauseAnimation() { } function sendJson() { - jsonDraft.metadata[1].value = String(`BB${BBEcke.value}`); - jsonDraft.metadata[2].value = String(vorname.value); - jsonDraft.metadata[3].value = String(nachname.value); - jsonDraft.metadata[4].value = String(funktionZeileEins.value); - jsonDraft.metadata[5].value = String(funktionZeileZwei.value); - let outputPath = `G:/VPMS/00-Temp_Austausch/von_Helmut/Schwertgen, David/Bauchbinde_${nachname.value}.mp4`; - jsonDraft.metadata[6].value = String(outputPath); - //download(JSON.stringify(jsonDraft), `test.json`, "text/plain"); - // write a post request to submit the json to the backend - const token = - "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJkczAzMSIsImlwQWRkcmVzcyI6IjE3Mi4xNi43OC4xMzMiLCJpc3MiOiJodHRwczovL2hlbG11dC5yYmItb25saW5lLmRlIiwidXNlcnJvbGUiOiJBRE1JTiIsImlhdCI6MTY4NTE5NTczMCwidXNlcm5hbWUiOiJkczAzMSJ9.TYMYcg1NzCtQuRJCborwPjc1p__e32Ecmtx55I9MdFZ3Ct88TWbH7A48OzsUNeMDYCLLB0R3O21LxYqno1pMRw"; - - fetch("https://helmut.rbb-online.de/v1/io/jobs", { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${token}`, - }, - body: JSON.stringify(jsonDraft), - }) - .then((response) => { - // Handle the response - console.log(response); - }) - .catch((error) => { - // Handle any errors - console.error(error); - }); + emit("sendJson"); } </script> -- GitLab