merge
This commit is contained in:
commit
3d78f0bc42
@ -64,6 +64,8 @@ module.exports = function (ctx) {
|
|||||||
'QExpansionItem',
|
'QExpansionItem',
|
||||||
'QParallax',
|
'QParallax',
|
||||||
'QEditor',
|
'QEditor',
|
||||||
|
'QSelect',
|
||||||
|
'QField',
|
||||||
],
|
],
|
||||||
|
|
||||||
directives: [
|
directives: [
|
||||||
|
|||||||
@ -1,19 +1,76 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="q-pa-md">
|
<form>
|
||||||
<p class="text-h6">Cache erstellen/bearbeiten</p>
|
<div class="q-pa-md q-gutter-y-md">
|
||||||
<p>Cache Name</p>
|
<p class="text-h5">Cache erstellen/bearbeiten</p>
|
||||||
<p>Cache Beschreibung</p>
|
<q-input class="col" dense stack-label filled v-model="text" label="Name"/>
|
||||||
<p>Cache Punkte</p>
|
<q-input
|
||||||
<p>Stationen</p>
|
v-model="description"
|
||||||
|
dense
|
||||||
|
stack-label
|
||||||
|
filled
|
||||||
|
autogrow
|
||||||
|
type="textarea"
|
||||||
|
label="Beschreibung"
|
||||||
|
/>
|
||||||
|
<q-input class="col" dense stack-label filled v-model="text" label="Punktewert"/>
|
||||||
|
<p class="text-h6">Stationen</p>
|
||||||
|
<q-list bordered separator class="rounded-borders" >
|
||||||
|
|
||||||
|
<q-item>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-avatar color="primary" text-color="white">
|
||||||
|
1
|
||||||
|
</q-avatar>
|
||||||
|
</q-item-section>
|
||||||
|
|
||||||
|
<q-item-section top>
|
||||||
|
<q-item-label lines="1">
|
||||||
|
<!--<span class="text-weight-medium">[quasarframework/quasar]</span>-->
|
||||||
|
<span class="text-grey-8">Beschreibung:</span>
|
||||||
|
</q-item-label>
|
||||||
|
<q-item-label lines="1" class="q-mt-xs text-body2">
|
||||||
|
<span class="cursor-pointer">Dies ist der Anfang der Beschreibung...</span>
|
||||||
|
</q-item-label>
|
||||||
|
</q-item-section>
|
||||||
|
|
||||||
|
<q-item-section side>
|
||||||
|
<div class="text-grey-8 q-gutter-xs">
|
||||||
|
<q-btn class="" color="" flat dense round icon="delete" />
|
||||||
|
<q-btn class="" color="" flat dense round icon="edit" />
|
||||||
|
</div>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
|
||||||
|
</q-list>
|
||||||
|
<div class="row reverse">
|
||||||
|
<q-btn @click="addStation" unelevated color="primary" label="Station hinzufügen" icon-right="add"/>
|
||||||
|
</div>
|
||||||
|
<div class="row q-mt-xl">
|
||||||
|
<q-btn @click="saveCache" class="full-width" unelevated stack color="positive" label="Cache speichern" icon="save_alt"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "Cache"
|
name: "Cache",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
text: ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addStation() {
|
||||||
|
|
||||||
|
},
|
||||||
|
saveCache() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -119,7 +119,9 @@
|
|||||||
this.$axios.get('http://localhost:8080/api/startCache', { params })
|
this.$axios.get('http://localhost:8080/api/startCache', { params })
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log("Angefangen: " + response.data);
|
console.log("Angefangen: " + response.data);
|
||||||
this.$router.push({ path: `/station/${cacheID}` })
|
let stationID = response.data.aktuelleStation.id;
|
||||||
|
console.log(stationID);
|
||||||
|
this.$router.push({ path: `/station/${stationID}` })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,33 +1,38 @@
|
|||||||
<template>
|
<template>
|
||||||
<q-page class="q-ma-md">
|
<div class="q-ma-md">
|
||||||
<h4 class="text-h4">Neue Station</h4>
|
<p class="text-h5">Neue Station</p>
|
||||||
<q-editor
|
<q-editor
|
||||||
:toolbar="[
|
:toolbar="[
|
||||||
['bold', 'italic', 'strike', 'underline'],
|
['bold', 'italic', 'strike', 'underline'],
|
||||||
['undo', 'redo']
|
['undo', 'redo']
|
||||||
]"
|
]"
|
||||||
v-model="description" min-height="10rem" />
|
v-model="station.description" min-height="10rem" />
|
||||||
<!--<q-input-->
|
<!--<q-input-->
|
||||||
<!--v-model="description"-->
|
<!--v-model="description"-->
|
||||||
<!--filled-->
|
<!--filled-->
|
||||||
<!--type="textarea"-->
|
<!--type="textarea"-->
|
||||||
<!--/>-->
|
<!--/>-->
|
||||||
<p class="text-h5 q-mt-md">Location</p>
|
<p class="text-h6 q-mt-md">Location</p>
|
||||||
<q-img transition="fade"
|
<q-img transition="fade"
|
||||||
class="q-mb-md "
|
class="q-mb-md "
|
||||||
:ratio="16/9"
|
:ratio="16/9"
|
||||||
src="https://www.buga2019.de/we-bilder/3.Gartenausstellung/Gelaendeplan/190320_Gelaendeplan-quadratisch.jpg"
|
src="https://www.buga2019.de/we-bilder/3.Gartenausstellung/Gelaendeplan/190320_Gelaendeplan-quadratisch.jpg"
|
||||||
></q-img>
|
></q-img>
|
||||||
<div class="row q-col-gutter-md">
|
<div class="row q-col-gutter-md">
|
||||||
<q-input class="col" dense stack-label filled v-model="text" label="Längengrad/Breitengrad" />
|
<q-input class="col" dense stack-label filled v-model="latlang" @input="separateLatlang" label="Längengrad/Breitengrad" />
|
||||||
<div class="col-shrink">
|
<div class="col-shrink">
|
||||||
<q-btn unelevated color="primary" class="full-height" icon="my_location"/>
|
<q-btn unelevated color="primary" class="full-height" icon="my_location"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-h5 q-mt-md">Lösung</p>
|
<p class="text-h6 q-mt-md">Lösung</p>
|
||||||
<q-input class="col" dense stack-label filled v-model="text" label="Lösung" />
|
<q-input class="col" dense stack-label filled v-model="station.solution" label="Lösung" />
|
||||||
<q-input class="col q-mt-md" dense stack-label filled v-model="text" label="Code" readonly/>
|
<q-input class="col q-mt-md" dense stack-label filled v-model="station.code" label="Code" readonly/>
|
||||||
</q-page>
|
<div class="row reverse q-mt-md q-gutter-x-md">
|
||||||
|
<q-btn @click="addStation" unelevated color="primary" label="Speichern" icon-right="add"/>
|
||||||
|
<q-btn @click="dismiss" unelevated color="negative" label="verwerfen" icon-right="delete"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -37,7 +42,15 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
description: "Rätsel, Aufgabe und Informationen zur Station.",
|
description: "Rätsel, Aufgabe und Informationen zur Station.",
|
||||||
text:"v-model !!"
|
text:"v-model !!",
|
||||||
|
latlang: "",
|
||||||
|
station: {
|
||||||
|
description: "description",
|
||||||
|
lattitude: 0.06470,
|
||||||
|
longitude: 0.05551,
|
||||||
|
solution: "solution",
|
||||||
|
code: 357547
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created: function() {
|
created: function() {
|
||||||
@ -45,11 +58,33 @@
|
|||||||
beforeMount: function() {
|
beforeMount: function() {
|
||||||
},
|
},
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
console.log("'id' from url: "+this.$route.params.id)
|
console.log("'id' from url: "+this.$route.params.id);
|
||||||
|
this.concatLatlang();
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
// concatLatlang() {
|
||||||
|
// return this.station.lattitude+", "+this.station.longitude
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
separateLatlang() {
|
||||||
|
//console.log("separateLatlang()");
|
||||||
|
if (this.latlang.includes(',')) {
|
||||||
|
this.station.lattitude = this.latlang.substr(0, this.latlang.indexOf(',')).trim();
|
||||||
|
this.station.longitude = this.latlang.substr(this.latlang.indexOf(',')+1, this.latlang.length).trim();
|
||||||
|
console.log(this.latlang);
|
||||||
|
console.log(this.station.lattitude + ", " + this.station.longitude);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
concatLatlang() {
|
||||||
|
this.latlang = this.station.lattitude+", "+this.station.longitude;
|
||||||
|
},
|
||||||
|
addStation() {
|
||||||
|
|
||||||
|
},
|
||||||
|
dismiss() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
4
frontend/src/store/cacheCollector/actions.js
Normal file
4
frontend/src/store/cacheCollector/actions.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/*
|
||||||
|
export function someAction (context) {
|
||||||
|
}
|
||||||
|
*/
|
||||||
4
frontend/src/store/cacheCollector/getters.js
Normal file
4
frontend/src/store/cacheCollector/getters.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/*
|
||||||
|
export function someGetter (state) {
|
||||||
|
}
|
||||||
|
*/
|
||||||
12
frontend/src/store/cacheCollector/index.js
Normal file
12
frontend/src/store/cacheCollector/index.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import state from './state'
|
||||||
|
import * as getters from './getters'
|
||||||
|
import * as mutations from './mutations'
|
||||||
|
import * as actions from './actions'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
namespaced: true,
|
||||||
|
state,
|
||||||
|
getters,
|
||||||
|
mutations,
|
||||||
|
actions
|
||||||
|
}
|
||||||
4
frontend/src/store/cacheCollector/mutations.js
Normal file
4
frontend/src/store/cacheCollector/mutations.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/*
|
||||||
|
export function someMutation (state) {
|
||||||
|
}
|
||||||
|
*/
|
||||||
3
frontend/src/store/cacheCollector/state.js
Normal file
3
frontend/src/store/cacheCollector/state.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export default {
|
||||||
|
//
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@ import Vue from "vue";
|
|||||||
import Vuex from "vuex";
|
import Vuex from "vuex";
|
||||||
import Axios from "axios";
|
import Axios from "axios";
|
||||||
import auth from "./auth"
|
import auth from "./auth"
|
||||||
|
import cacheCollector from "./cacheCollector"
|
||||||
|
|
||||||
// import example from './module-example'
|
// import example from './module-example'
|
||||||
|
|
||||||
@ -12,24 +13,11 @@ Vue.use(Vuex, Axios);
|
|||||||
* directly export the Store instantiation
|
* directly export the Store instantiation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// export default function(/* { ssrContext } */) {
|
|
||||||
// const Store = new Vuex.Store({
|
|
||||||
// modules: {
|
|
||||||
// // example
|
|
||||||
// },
|
|
||||||
//
|
|
||||||
// // enable strict mode (adds overhead!)
|
|
||||||
// // for dev mode only
|
|
||||||
// strict: process.env.DEV
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// return Store;
|
|
||||||
// }
|
|
||||||
|
|
||||||
export default function (/* { ssrContext } */) {
|
export default function (/* { ssrContext } */) {
|
||||||
const Store = new Vuex.Store({
|
const Store = new Vuex.Store({
|
||||||
modules: {
|
modules: {
|
||||||
auth
|
auth,
|
||||||
|
cacheCollector
|
||||||
},
|
},
|
||||||
|
|
||||||
// enable strict mode (adds overhead!)
|
// enable strict mode (adds overhead!)
|
||||||
@ -47,6 +35,10 @@ export default function (/* { ssrContext } */) {
|
|||||||
module.hot.accept(['./auth'], () => {
|
module.hot.accept(['./auth'], () => {
|
||||||
const auth = require('./auth').default;
|
const auth = require('./auth').default;
|
||||||
store.hotUpdate({ modules: { auth: newAuth } })
|
store.hotUpdate({ modules: { auth: newAuth } })
|
||||||
|
});
|
||||||
|
module.hot.accept(['./cacheCollector'], () => {
|
||||||
|
const cacheCollector = require('./cacheCollector').default;
|
||||||
|
store.hotUpdate({ modules: { cacheCollector: newCacheCollector } })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -109,7 +109,7 @@ public class Controller {
|
|||||||
CacheAccesDefinition cacheAccesDefinition = cacheAccesDefinitionOptional.get();
|
CacheAccesDefinition cacheAccesDefinition = cacheAccesDefinitionOptional.get();
|
||||||
bearbeitet.setCacheAccesDefinition(cacheAccesDefinition);
|
bearbeitet.setCacheAccesDefinition(cacheAccesDefinition);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalParameterException("There is no cacheAccesDefinition with the ID " + 0);
|
return ResponseEntity.status(404).body("There is no cacheAccesDefinition with the ID " + 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bearbeitetRepository.save(bearbeitet);
|
bearbeitetRepository.save(bearbeitet);
|
||||||
@ -240,6 +240,9 @@ public class Controller {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseEntity checkAdmin(@RequestParam String token) {
|
public ResponseEntity checkAdmin(@RequestParam String token) {
|
||||||
User user = userRepository.findByUsername(token.substring(0, token.indexOf("$")));
|
User user = userRepository.findByUsername(token.substring(0, token.indexOf("$")));
|
||||||
|
if (user == null) {
|
||||||
|
return ResponseEntity.status(404).body("User was not found");
|
||||||
|
}
|
||||||
for (Role role : user.getRoles()) {
|
for (Role role : user.getRoles()) {
|
||||||
if (role.getId() == 0) { // is admin
|
if (role.getId() == 0) { // is admin
|
||||||
return ResponseEntity.status(200).body("User is Admin");
|
return ResponseEntity.status(200).body("User is Admin");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user