butons...
This commit is contained in:
33
src/App.vue
33
src/App.vue
@@ -7,6 +7,7 @@ import Button from 'primevue/button'
|
|||||||
import DataTable from "primevue/datatable"
|
import DataTable from "primevue/datatable"
|
||||||
import Column from "primevue/column"
|
import Column from "primevue/column"
|
||||||
import Card from "primevue/card"
|
import Card from "primevue/card"
|
||||||
|
import SplitButton from "primevue/splitbutton"
|
||||||
|
|
||||||
const allTables = ref()
|
const allTables = ref()
|
||||||
const activeTables = ref()
|
const activeTables = ref()
|
||||||
@@ -35,6 +36,13 @@ function stopTable(tableId: number) {
|
|||||||
activate.then((resp) => axios.get('http://localhost/api/active_tables')).then((resp) => activeTables.value = resp.data)
|
activate.then((resp) => axios.get('http://localhost/api/active_tables')).then((resp) => activeTables.value = resp.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const saveButtonSubmenu = [
|
||||||
|
{ label: "Restart" },
|
||||||
|
{ label: "Stop" },
|
||||||
|
{ separator: true },
|
||||||
|
{ label: "Delete" }
|
||||||
|
]
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@@ -46,12 +54,25 @@ function stopTable(tableId: number) {
|
|||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ATTables {
|
.Tables {
|
||||||
|
padding-left: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.AllTables {
|
||||||
|
margin: 20px;
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
padding-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Tables {
|
||||||
padding-left: 50px;
|
padding-left: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-box {
|
.button-box {
|
||||||
padding: 10px;
|
padding-top: 25px;
|
||||||
|
padding-bottom: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -63,7 +84,7 @@ function stopTable(tableId: number) {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #content>
|
<template #content>
|
||||||
<DataTable :exportable="false" :value="activeTables">
|
<DataTable class="Tables" :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">
|
||||||
<template #body="slotProps">
|
<template #body="slotProps">
|
||||||
@@ -79,18 +100,18 @@ function stopTable(tableId: number) {
|
|||||||
</template>
|
</template>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card class="ActiveTables">
|
<Card class="AllTables">
|
||||||
<template #title>
|
<template #title>
|
||||||
<h2>All Tables</h2>
|
<h2>All Tables</h2>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #content>
|
<template #content>
|
||||||
<DataTable class="ATTables" style="" :exportable="false" :value="allTables">
|
<DataTable class="Tables" :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="Start" @click="startTable(slotProps.data.id)" />
|
<SplitButton label="Start" @click="startTable(slotProps.data.id)" :model="saveButtonSubmenu" />
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
</DataTable>
|
</DataTable>
|
||||||
|
|||||||
Reference in New Issue
Block a user