Formatting

This commit is contained in:
iamBadgers
2026-04-11 15:47:11 -07:00
parent c7905cdcb5
commit 5ae9afc89f
3 changed files with 40 additions and 27 deletions

View File

@@ -6,7 +6,10 @@
</template> </template>
<template #subtitle> <template #subtitle>
Status: Status:
<Chip :class="table.active ? 'active' : 'inactive'" :label="table.active ? 'active' : 'inactive'" /> <Chip
:class="table.active ? 'active' : 'inactive'"
:label="table.active ? 'active' : 'inactive'"
/>
</template> </template>
<template #footer> <template #footer>
<Button class="button-box" label="Start" /> <Button class="button-box" label="Start" />
@@ -16,26 +19,35 @@
</Card> </Card>
<Card class="detailCard flex"> <Card class="detailCard flex">
<template #title> <template #title> Edit Details </template>
Edit Details
</template>
<template #content> <template #content>
<div class="flex flex-column"> <div class="flex flex-column">
<InputText class="button-box" name="tableName" type="text" placeholder="Table Name" v-model="tableName" /> <InputText
<InputText class="button-box" name="tableLink" type="text" placeholder="Table Link" v-model="tableLink" /> class="button-box"
name="tableName"
type="text"
placeholder="Table Name"
v-model="tableName"
/>
<InputText
class="button-box"
name="tableLink"
type="text"
placeholder="Table Link"
v-model="tableLink"
/>
</div> </div>
</template> </template>
<template #footer> <template #footer>
<Button class="button-box" label="Save" /> <Button class="button-box" label="Save" />
<Button class="button-box" label="Clear" /> <Button class="button-box" label="Clear" />
</template> </template>
</Card> </Card>
</Form> </Form>
</template> </template>
<style> <style>
@import "primeicons/primeicons.css"; @import 'primeicons/primeicons.css';
.active { .active {
--p-chip-color: green; --p-chip-color: green;

View File

@@ -46,23 +46,23 @@ function stopTable(tableId: number) {
} }
function buildButtonModel(id: number) { function buildButtonModel(id: number) {
return [{ return [
label: 'Edit', command: () => { {
label: 'Edit',
command: () => {
route.push({ name: 'edit', params: { id: id } }) route.push({ name: 'edit', params: { id: id } })
} },
}, },
{ label: 'Restart' }, { label: 'Restart' },
{ label: 'Force Stop' }, { label: 'Force Stop' },
{ separator: true }, { separator: true },
{ label: 'Delete' } { label: 'Delete' },
] ]
} }
function createTable() { function createTable() {
axios.post("http://localhost/api/tables", axios.post('http://localhost/api/tables', { table_name: 'table name', table_link: 'table link' })
{ table_name: "table name", table_link: "table link" })
} }
</script> </script>
<style> <style>
@@ -128,8 +128,7 @@ function createTable() {
<template #content> <template #content>
<DataTable class="Tables" :value="allTables"> <DataTable class="Tables" :value="allTables">
<Column field="table_name" header="Table Name"> <Column field="table_name" header="Table Name"> </Column>
</Column>
<Column field="table_link" header="Table Link"> <Column field="table_link" header="Table Link">
<template #body="slotProps"> <template #body="slotProps">
<a v-if="slotProps.data.active" :href="'/' + slotProps.data.table_link"> <a v-if="slotProps.data.active" :href="'/' + slotProps.data.table_link">
@@ -139,12 +138,14 @@ function createTable() {
http://localhost/{{ slotProps.data.table_link }} http://localhost/{{ slotProps.data.table_link }}
</div> </div>
</template> </template>
</Column> </Column>
<Column header="Close"> <Column header="Close">
<template #body="slotProps"> <template #body="slotProps">
<SplitButton label="Start" @click="startTable(slotProps.data.id)" <SplitButton
:model="buildButtonModel(slotProps.data.id)" /> label="Start"
@click="startTable(slotProps.data.id)"
:model="buildButtonModel(slotProps.data.id)"
/>
</template> </template>
</Column> </Column>
</DataTable> </DataTable>

View File

@@ -8,8 +8,8 @@ import TableEditor from './TableEditor.vue'
import 'primeflex/primeflex.css' import 'primeflex/primeflex.css'
const routes = [ const routes = [
{ name: "home", path: '/', component: TableManager }, { name: 'home', path: '/', component: TableManager },
{ name: "edit", path: '/edit/:id', component: TableEditor }, { name: 'edit', path: '/edit/:id', component: TableEditor },
] ]
const router = createRouter({ const router = createRouter({