remove references to localhost from axios calls.

This commit is contained in:
iamBadgers
2026-04-20 21:24:16 -07:00
parent 8be9516dfd
commit c7fb2e490e
3 changed files with 11 additions and 10 deletions

View File

@@ -17,7 +17,7 @@ const availableVersion = ref([
]);
function saveTable() {
axios.post('http://localhost/api/tables', { "table_name": table_name.value, "table_link": table_link.value, "version": version.value }).then(() => router.push({ name: "home" }))
axios.post('/api/tables', { "table_name": table_name.value, "table_link": table_link.value, "version": version.value }).then(() => router.push({ name: "home" }))
}
</script>

View File

@@ -76,7 +76,7 @@ onMounted(() => {
if (Number(route.params.id) == 0) {
} else {
axios.get(`http://localhost/api/tables/${route.params.id}`).then((resp) => {
axios.get(`/api/tables/${route.params.id}`).then((resp) => {
table.table_name = resp.data.table_name
table.table_link = resp.data.table_link
table.active = resp.data.active
@@ -90,7 +90,7 @@ watch(
() => route.params.id,
(newValue, oldValue) => {
console.log(newValue)
axios.get(`http://localhost/api/table/${newValue}`).then((resp) => {
axios.get(`/api/table/${newValue}`).then((resp) => {
table.table_name = resp.data.table_name
table.table_link = resp.data.table_link
table.active = resp.data.active

View File

@@ -22,25 +22,25 @@ onMounted(() => {
})
async function loadTables(): Promise<void> {
return axios.get('http://localhost/api/tables/all')
return axios.get('/api/tables/all')
.then((resp) => (allTables.value = resp.data))
.then(() => axios.get('http://localhost/api/tables/active'))
.then(() => axios.get('/api/tables/active'))
.then((resp) => (activeTables.value = resp.data))
}
function startTable(tableId: number) {
axios.post(`http://localhost/api/tables/${tableId}:start`)
axios.post(`/api/tables/${tableId}:start`, { "hard": "False" })
.then(() => loadTables())
}
function stopTable(tableId: number) {
axios.post(`http://localhost/api/tables/${tableId}:stop`)
axios.post(`/api/tables/${tableId}:stop`)
.then(() => loadTables())
}
function deleteTable(tableId: number) {
axios
.delete(`http://localhost/api/tables/${tableId}`)
.delete(`/api/tables/${tableId}`)
.then(() => loadTables())
}
@@ -53,9 +53,10 @@ function buildButtonModel(table: any) {
},
},
{ label: 'Restart' },
{ label: 'Hard Start',
{
label: 'Hard Start',
command: () => {
axios.post(`http://localhost/api/tables/${table.id}:start`, {"hard": "True"}).then(() => loadTables())
axios.post(`/api/tables/${table.id}:start`, { "hard": "True" }).then(() => loadTables())
}
},
{ separator: true },