optimized api paths

master
cheetah 2 years ago
parent 6020620ba9
commit b5d18cad59

@ -128,7 +128,7 @@
}, },
methods: { methods: {
loadPresets() { loadPresets() {
this.$http.get('api/deliveryPresets') this.$http.get(window.location.pathname + 'api/deliveryPresets')
.then(response => { .then(response => {
this.presetSearchItems = response.body.map(x => { return { this.presetSearchItems = response.body.map(x => { return {
text: x.name, text: x.name,
@ -138,7 +138,7 @@
}) })
}, },
loadConfig() { loadConfig() {
this.$http.get('config').then(response => { this.$http.get(window.location.pathname + 'config').then(response => {
const newConfig = response.body const newConfig = response.body
newConfig.regions = newConfig.regions.map((x) => { newConfig.regions = newConfig.regions.map((x) => {
x._id = btoa(JSON.stringify(x)) x._id = btoa(JSON.stringify(x))
@ -148,7 +148,7 @@
}, response => { }, response => {
}) })
this.$http.get('Regionalschl_ssel_2022-09-30.json').then(response => { this.$http.get(window.location.pathname + 'Regionalschl_ssel_2022-09-30.json').then(response => {
console.log(response.body.daten) console.log(response.body.daten)
this.regionsSearchItems = response.body.daten.map(x => { return { this.regionsSearchItems = response.body.daten.map(x => { return {
@ -165,9 +165,9 @@
delete a._id delete a._id
return a return a
}) })
this.$http.post('config', storeConfig).then(response => { this.$http.post(window.location.pathname + 'config', storeConfig).then(response => {
}) })
.then(this.$http.post('restart')) .then(this.$http.post(window.location.pathname + 'restart'))
.then(() => { .then(() => {
document.body.style = 'display:none' document.body.style = 'display:none'
setTimeout(() => window.location.reload(), 1e3) setTimeout(() => window.location.reload(), 1e3)
@ -178,7 +178,7 @@
}, },
addAlarm() { addAlarm() {
this.configData.regions.push({ this.configData.regions.push({
name: "Testalarm", name: "Alarm Name",
params: { params: {
"type": "simple", "type": "simple",
"routing": { "routing": {

Loading…
Cancel
Save