make the start button work
This commit is contained in:
29
src/App.vue
29
src/App.vue
@@ -19,22 +19,30 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
axios.get('http://localhost/api/tables').then((resp) => allTables.value=resp.data)
|
axios.get('http://localhost/api/tables').then((resp) => allTables.value = resp.data)
|
||||||
axios.get('http://localhost/api/active_tables').then((resp) => activeTables.value=resp.data)
|
axios.get('http://localhost/api/active_tables').then((resp) => activeTables.value = resp.data)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function startTable(tableId: number) {
|
||||||
|
const activate = axios.get(`http://localhost/api/tables/${tableId}:start`);
|
||||||
|
activate.then((resp) => axios.get('http://localhost/api/tables')).then((resp) => allTables.value = resp.data)
|
||||||
|
activate.then((resp) => axios.get('http://localhost/api/active_tables')).then((resp) => activeTables.value = resp.data)
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.ActiveTables {
|
.ActiveTables {
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ATTables {
|
.ATTables {
|
||||||
padding-left: 50px;
|
padding-left: 50px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -46,11 +54,11 @@ onMounted(() => {
|
|||||||
|
|
||||||
<template #content>
|
<template #content>
|
||||||
<DataTable class="ATTables" style="" :exportable="false" :value="activeTables">
|
<DataTable class="ATTables" style="" :exportable="false" :value="activeTables">
|
||||||
<Column field="table_name" header="Table Name"/>
|
<Column field="table_name" header="Table Name" />
|
||||||
<Column field="table_link" header="Table Link"/>
|
<Column field="table_link" header="Table Link" />
|
||||||
<Column header="Close">
|
<Column header="Close">
|
||||||
<template #body="slotProps">
|
<template #body="slotProps">
|
||||||
<Button label="Close"/>
|
<Button label="Close" />
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
</DataTable>
|
</DataTable>
|
||||||
@@ -64,11 +72,11 @@ onMounted(() => {
|
|||||||
|
|
||||||
<template #content>
|
<template #content>
|
||||||
<DataTable class="ATTables" style="" :exportable="false" :value="allTables">
|
<DataTable class="ATTables" style="" :exportable="false" :value="allTables">
|
||||||
<Column field="table_name" header="Table Name"/>
|
<Column field="table_name" header="Table Name" />
|
||||||
<Column field="table_link" header="Table Link"/>
|
<Column field="table_link" header="Table Link" />
|
||||||
<Column header="Close">
|
<Column header="Close">
|
||||||
<template #body="slotProps">
|
<template #body="slotProps">
|
||||||
<Button label="Close"/>
|
<Button label="Start" @click="startTable(slotProps.data.id)" />
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
</DataTable>
|
</DataTable>
|
||||||
@@ -76,4 +84,3 @@ onMounted(() => {
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user