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() { 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> </script>

View File

@@ -76,7 +76,7 @@ onMounted(() => {
if (Number(route.params.id) == 0) { if (Number(route.params.id) == 0) {
} else { } 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_name = resp.data.table_name
table.table_link = resp.data.table_link table.table_link = resp.data.table_link
table.active = resp.data.active table.active = resp.data.active
@@ -90,7 +90,7 @@ watch(
() => route.params.id, () => route.params.id,
(newValue, oldValue) => { (newValue, oldValue) => {
console.log(newValue) 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_name = resp.data.table_name
table.table_link = resp.data.table_link table.table_link = resp.data.table_link
table.active = resp.data.active table.active = resp.data.active

View File

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