diff --git a/html/index.html b/html/index.html
index bbcbe2e..a34120e 100644
--- a/html/index.html
+++ b/html/index.html
@@ -87,7 +87,7 @@
mdi-arrow-up
-
+
mdi-arrow-down
@@ -157,7 +157,6 @@
new Vue({
el: '#app',
vuetify: new Vuetify(),
- http: { root: '/' },
data() {
return {
configTab: null,
@@ -187,10 +186,12 @@
}
},
credentialsData: {},
+ basePath: '',
}
},
created() {
- this.loadConfig()
+ this.basePath = window.location.pathname.replace(/\/$/, '');
+ this.loadConfig();
},
methods: {
moveProcessingCMD(index, down) {
@@ -199,7 +200,7 @@
this.configData.handling.processing.splice(index + (down ? -1 : 1), 0, entry)
},
loadConfig() {
- this.$http.get('/config').then(response => {
+ this.$http.get(`${this.basePath}/config`).then(response => {
const newConfig = response.body
newConfig.handling.processing = newConfig.handling.processing.map((x) => {
x._id = btoa(JSON.stringify(x))
@@ -208,10 +209,9 @@
this.configData = newConfig
}, response => {
})
- this.$http.get('/credentials').then(response => {
+ this.$http.get(`${this.basePath}/credentials`).then(response => {
this.credentialsData = response.body
- }, response => {
- })
+ });
},
storeConfig() {
const storeConfig = JSON.parse(JSON.stringify(this.configData))
@@ -224,18 +224,18 @@
if (!!x[n] && x[n].length > 0) y[n] = x[n]
return y
})
- this.$http.post('/config', storeConfig).then(response => {
+ this.$http.post(`${this.basePath}/config`, storeConfig).then(response => {
})
- .then(this.$http.post('/restart'))
+ .then(() => this.$http.post(`${this.basePath}/restart`))
.then(() => {
document.body.style = 'display:none'
setTimeout(() => window.location.reload(), 1e3)
- })
+ });
},
storeCredentials() {
- this.$http.post('/credentials', this.credentialsData).then(response => {
+ this.$http.post(`${this.basePath}/credentials`, this.credentialsData).then(response => {
})
- .then(this.$http.post('/restart'))
+ .then(() => this.$http.post(`${this.basePath}/restart`))
.then(() => {
document.body.style = 'display:none'
setTimeout(() => window.location.reload(), 1e3)
@@ -258,4 +258,4 @@