forked from kristjan/cjvt-valency
some frontend cleanup, backend bug fix (database volumd mount)
This commit is contained in:
@@ -19,7 +19,11 @@ export default {
|
||||
methods: {
|
||||
apiGetFunctors: function () {
|
||||
var component = this
|
||||
this.$http.get(this.$root.store.api_addr + "/api/functors")
|
||||
this.$http.get(
|
||||
this.$root.store.api_addr +
|
||||
"/api/functors/" +
|
||||
this.$root.store.selCorpus
|
||||
)
|
||||
.then(function(response) {
|
||||
component.$root.store.api_error = null
|
||||
component.functors = response.data
|
||||
|
||||
@@ -27,7 +27,11 @@ export default {
|
||||
methods: {
|
||||
apiGetWords: function() {
|
||||
var component = this
|
||||
this.$http.get(this.$root.storeGet("api_addr") + "/api/words")
|
||||
this.$http.get(
|
||||
this.$root.store.api_addr +
|
||||
"/api/words/" +
|
||||
this.$root.store.selCorpus
|
||||
)
|
||||
.then(function(response) {
|
||||
component.$root.store.api_error = null
|
||||
// component.$root.store.has_se = response.data["has_se"]
|
||||
|
||||
@@ -86,7 +86,7 @@ export default {
|
||||
}
|
||||
|
||||
var component = this
|
||||
this.$http.post(this.$root.storeGet("api_addr") + "/api/login",
|
||||
this.$http.post(this.$root.store.api_addr + "/api/login",
|
||||
data, // the data to post
|
||||
{ headers: {
|
||||
'Content-type': 'application/x-www-form-urlencoded',
|
||||
|
||||
@@ -119,8 +119,10 @@ export default {
|
||||
}
|
||||
var component = this
|
||||
this.$http.get(
|
||||
this.$root.storeGet("api_addr") + "/api/functor-frames" +
|
||||
"?functor=" + functor + "&rf=" + reduce_fun)
|
||||
this.$root.store.api_addr +
|
||||
"/api/functor-frames" +
|
||||
"?functor=" + functor + "&rf=" + reduce_fun
|
||||
)
|
||||
.then(function (response) {
|
||||
component.$root.store.api_error = null
|
||||
component.frames = response.data.frames
|
||||
@@ -147,8 +149,9 @@ export default {
|
||||
}
|
||||
var component = this
|
||||
this.$http.get(
|
||||
this.$root.storeGet("api_addr") + "/api/frames" +
|
||||
"?hw=" + hw + "&rf=" + reduce_fun)
|
||||
this.$root.store.api_addr + "/api/frames" +
|
||||
"?hw=" + hw + "&rf=" + reduce_fun
|
||||
)
|
||||
.then(function (response) {
|
||||
component.$root.store.api_error = null
|
||||
component.frames = response.data.frames
|
||||
|
||||
@@ -78,7 +78,7 @@ export default {
|
||||
}
|
||||
|
||||
var component = this
|
||||
this.$http.post(this.$root.storeGet("api_addr") + "/api/new_pass",
|
||||
this.$http.post(this.$root.store.api_addr + "/api/new_pass",
|
||||
data, // the data to post
|
||||
{ headers: {
|
||||
'Content-type': 'application/x-www-form-urlencoded',
|
||||
|
||||
@@ -111,7 +111,7 @@ export default {
|
||||
password: this.credentials.password,
|
||||
email: this.credentials.email,
|
||||
}
|
||||
this.$http.post(this.$root.storeGet("api_addr") + "/api/register",
|
||||
this.$http.post(this.$root.store.api_addr + "/api/register",
|
||||
post_data, // the data to post
|
||||
{ headers: {
|
||||
'Content-type': 'application/json',
|
||||
|
||||
@@ -44,17 +44,6 @@ const store = {
|
||||
has_se: [], // used for appending (se) to certain verbs
|
||||
}
|
||||
|
||||
const store_methods = {
|
||||
storeSet: function(key, val) {
|
||||
store[key] = val
|
||||
},
|
||||
storeGet: function(key) {
|
||||
// returns undefined if not in dict.
|
||||
// check if (variable)
|
||||
return store[key]
|
||||
}
|
||||
}
|
||||
|
||||
const login_methods = {
|
||||
checkToken: function () {
|
||||
var tthis = this
|
||||
@@ -110,7 +99,7 @@ new Vue({
|
||||
data() { return {
|
||||
store: store,
|
||||
}},
|
||||
methods: Object.assign(store_methods, login_methods, other_methods),
|
||||
methods: Object.assign(login_methods, other_methods),
|
||||
beforeCreate: function() {
|
||||
document.title = "Vezljivostni vzorci"
|
||||
if (this.$cookies.isKey("valency_token")) {
|
||||
|
||||
Reference in New Issue
Block a user