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

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

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