diff --git a/frontend/src/boot/axios.js b/frontend/src/boot/axios.js index 8523d48..ea842da 100644 --- a/frontend/src/boot/axios.js +++ b/frontend/src/boot/axios.js @@ -1,7 +1,8 @@ import axios from "axios"; const axiosInstance = axios.create({ - baseURL: process.env.API + baseURL: process.env.API, + timeout: 3000 }); console.log("process.env.DEV: "+process.env.DEV); console.log("process.env.API: "+process.env.API); diff --git a/frontend/src/pages/Cache.vue b/frontend/src/pages/Cache.vue index e3126cf..5409e0a 100644 --- a/frontend/src/pages/Cache.vue +++ b/frontend/src/pages/Cache.vue @@ -1,75 +1,108 @@ @@ -81,7 +114,7 @@ name: "Cache", data() { return { - // stationComponent: null, + //endStation: {}, scrolldown: false, isNewCache: this.$route.params.id === undefined, tempCache: {}, @@ -122,6 +155,19 @@ // swapComponent: function (component) { // this.stationComponent = component; // }, + editEndStation() { + console.log("editEndStation()"); + const station = this.cache.endStation; + console.log(station); + if (station.hasOwnProperty('id')) { + //this.$router.push({ path: '/station/'+station.id}); + } else { + // TODO Stationen bearbeitbar machen bevor sie abgeschickt werden. Am besten Station Objekt als Übergabe Parameter bei Router + this.$store.commit('cacheCollector/SET_TEMPSTATION', station); + this.$router.push({path: `/tempstation/${index}`}); // add parameter + } + + }, cacheToStore() { // push tempCache to Store console.log("set Cache"); @@ -129,20 +175,20 @@ // this.SET_CACHE(JSON.parse(JSON.stringify(this.tempCache))); }, addStation() { - this.$router.push({ path: '/station' }); + this.$router.push({path: '/station'}); //this.swapComponent(station); // create Station and add it to array tempCache.stationen }, editStation(index) { - console.log("editStation("+index+")"); + console.log("editStation(" + index + ")"); const station = this.cache.stationen[index]; - console.log(station) - if (station.hasOwnProperty('id') ) { + console.log(station); + if (station.hasOwnProperty('id')) { //this.$router.push({ path: '/station/'+station.id}); } else { // TODO Stationen bearbeitbar machen bevor sie abgeschickt werden. Am besten Station Objekt als Übergabe Parameter bei Router this.$store.commit('cacheCollector/SET_TEMPSTATION', station); - this.$router.push({ path: `/station-l/${index}` }); // add parameter + this.$router.push({path: `/tempstation/${index}`}); // add parameter } }, deleteStation(index) { @@ -153,12 +199,14 @@ // commit to store, send to api, if success -> reset store if (this.isNewCache) { console.log(this.cache); - console.log(JSON.stringify(this.cache)); + let cache = this.cache; + cache.stationen.push(this.endStation); + this.$axios.post('/api/createCache', this.cache) .then((response) => { console.log("POST api/createCache: " + response.statusText); this.$store.commit('cacheCollector/RESET_NEW_CACHE'); - this.$router.push({ path: '/overview' }); + this.$router.push({path: '/overview'}); }).catch((error) => { // Error let msg; @@ -179,16 +227,17 @@ console.log('Error', error.message); } console.log(error.config); - this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: msg, title: title, }); + this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {message: msg, title: title,}); }) - } else { + } else { // TODO update existing Cache } - }, + }, }, computed: { ...mapGetters({ - cache: 'cacheCollector/GET_CACHE' + cache: 'cacheCollector/GET_CACHE', + endStation: 'cacheCollector/GET_ENDSTATION' }), // computedCache: { // set(value) { diff --git a/frontend/src/pages/CacheStart.vue b/frontend/src/pages/CacheStart.vue index 2ee2846..ec4394b 100644 --- a/frontend/src/pages/CacheStart.vue +++ b/frontend/src/pages/CacheStart.vue @@ -23,7 +23,7 @@ return { //TODO Lageplan einbinden cacheID: "", cacheName: "", - code: "8/6", + code: "8/7", instruction: "Bitte begib Dich zu der auf der Karte angezeigten Position. An dieser Position wirst Du einen QR-Code finden. Wenn du ihn gefunden hast, drücke den Knopf zum Starten des QR-Scanners und gib uns die Berechtigung, Deine Kamera zu öffnen. Nachdem Du den QR-Code gescannt hast, erhältst du ein Rätsel zur Position der nächsten Station. Die Lösung zu dem Rätsel ist also das Versteck des nächsten QR-Codes." } }, diff --git a/frontend/src/pages/Login.vue b/frontend/src/pages/Login.vue index 649de1c..881b3d7 100644 --- a/frontend/src/pages/Login.vue +++ b/frontend/src/pages/Login.vue @@ -25,12 +25,18 @@ + > + + - - - -
Fehler
-
- - - Es konnten keine übereinstimmenden Zugangsdaten in der Datenbank gefunden werden. - - - - - -
-
@@ -68,13 +59,13 @@ export default { data() { return { + loading: false, user: { email: "volkmann@geocaching.de", password: "0123456789", //token: "", // evalAuthentication: false }, - credentialsDialog: false, }; }, // beforeMount: { @@ -97,7 +88,7 @@ }, methods: { login: function () { - + this.loading = true; const data = { email: this.user.email, password: this.user.password @@ -135,7 +126,9 @@ } console.log(error.config); this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: message, title: header, }); - }) + }).finally(() => { + this.loading = false; + }) }, evalAuthentication: function () { this.$store.commit('auth/SET_AUTHENTICATED'); diff --git a/frontend/src/pages/StationEdit.vue b/frontend/src/pages/StationEdit.vue index f51add4..78b29a4 100644 --- a/frontend/src/pages/StationEdit.vue +++ b/frontend/src/pages/StationEdit.vue @@ -3,14 +3,16 @@

Neue Station

+ ['bold', 'italic', 'strike', 'underline'], + ['undo', 'redo'], + ['hr', 'link'], + ['fullscreen'], + ]" + v-model="station.description" min-height="10rem"/> - - - + + +

Location

- +

Lösung

- - + +
@@ -37,6 +40,7 @@