Skip to content
Snippets Groups Projects
Verified Commit 81024d32 authored by Kirill Stytsenko's avatar Kirill Stytsenko
Browse files

Change API urls from "localhost" to nuxt-proxied urls

parent 9d19942a
No related branches found
No related tags found
4 merge requests!23Sprint results,!18Merge Conflicts,!15Sprint ended, merge into master,!13UI Database/Tables CRUD
......@@ -107,7 +107,7 @@ export default {
})
}
try {
const res = await this.$axios.post(`http://localhost:9094/api/database/${this.$route.params.db_id}/table`, data)
const res = await this.$axios.post(`/api/tables/api/database/${this.$route.params.db_id}/table`, data)
if (res.status === 201) {
this.$toast.success('Table created.')
this.$root.$emit('table-create', res.data)
......
......@@ -87,7 +87,7 @@ export default {
if (typeof this.panelIndex !== 'undefined') {
const tableId = this.tables[this.panelIndex].id
try {
const res = await this.$axios.get(`http://localhost:9094/api/database/${this.$route.params.db_id}/table/${tableId}`)
const res = await this.$axios.get(`/api/tables/api/database/${this.$route.params.db_id}/table/${tableId}`)
this.tableDetails = res.data[0] // It's a list with one element
} catch (err) {
this.$toast.error('Could not get table details.')
......@@ -106,7 +106,7 @@ export default {
let res
try {
res = await this.$axios.get(
`http://localhost:9094/api/database/${this.$route.params.db_id}/table`)
`/api/tables/api/database/${this.$route.params.db_id}/table`)
this.tables = res.data
} catch (err) {
this.$toast.error('Could not list tables.')
......@@ -115,7 +115,7 @@ export default {
async deleteTable () {
try {
await this.$axios.delete(
`http://localhost:9094/api/database/${this.$route.params.db_id}/table/${this.deleteTableId}`)
`/api/tables/api/database/${this.$route.params.db_id}/table/${this.deleteTableId}`)
this.refresh()
} catch (err) {
this.$toast.error('Could not delete table.')
......
......@@ -62,7 +62,7 @@ export default {
let res
let containerId
try {
res = await this.$axios.post('http://localhost:9091/api/container/', {
res = await this.$axios.post('/api/container/', {
name: this.database,
repository: this.engine.repo,
tag: this.engine.tag
......@@ -77,7 +77,7 @@ export default {
// start the container
try {
res = await this.$axios.put(`http://localhost:9091/api/container/${containerId}`, {
res = await this.$axios.put(`/api/container/${containerId}`, {
action: 'START'
})
} catch (err) {
......@@ -92,7 +92,7 @@ export default {
// create the DB
try {
res = await this.$axios.post('http://localhost:9092/api/database/', {
res = await this.$axios.post('/api/database/', {
name: this.database,
containerId
})
......
......@@ -66,7 +66,7 @@ export default {
methods: {
async refresh () {
this.createDbDialog = false
const res = await this.$axios.get('http://localhost:9092/api/database/')
const res = await this.$axios.get('/api/database/')
this.databases = res.data
},
trim (s) {
......
......@@ -43,7 +43,7 @@ export default {
},
async mounted () {
try {
const res = await this.$axios.get(`http://localhost:9092/api/database/${this.$route.params.db_id}`)
const res = await this.$axios.get(`/api/database/${this.$route.params.db_id}`)
this.db = res.data
} catch (err) {
this.$toast.error('Could not load database.')
......@@ -52,8 +52,7 @@ export default {
methods: {
async deleteDatabase () {
try {
await this.$axios.delete(
`http://localhost:9092/api/database/${this.$route.params.db_id}`)
await this.$axios.delete(`/api/database/${this.$route.params.db_id}`)
this.$router.push({ path: '/databases' })
this.$toast.success(`Database "${this.db.name}" deleted.`)
} catch (err) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment