From 232670f161862ca1174bdaaf488522687f32878f Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Sun, 2 Apr 2023 22:07:11 +0200 Subject: [PATCH] wip --- client/src/components/NiceForm.vue | 35 +++++++++++++++++-- client/src/definitions.ts | 4 +-- .../pages/edit/[subsystem]/[entity]/[id].vue | 4 ++- .../pages/edit/[subsystem]/[entity]/index.vue | 4 ++- 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/client/src/components/NiceForm.vue b/client/src/components/NiceForm.vue index f2aa438..fac22d0 100644 --- a/client/src/components/NiceForm.vue +++ b/client/src/components/NiceForm.vue @@ -1,4 +1,6 @@ diff --git a/client/src/definitions.ts b/client/src/definitions.ts index 290e02b..d486a78 100644 --- a/client/src/definitions.ts +++ b/client/src/definitions.ts @@ -20,11 +20,11 @@ export const editTypes: { [key: string]: {[key: string]: any} } = { "interfaces": { title: "Interfaces", fields: [ - {key: "name", label: "Name", component: () => TextBox }, + {key: "name", label: "Name", component: () => TextBox, default: "placeholder"}, {key: "type", label: "Type", component: () => PillBar, props: {options: [{name: 'Hardware', selected: true}, {name: 'VLAN'}, {name: 'Bond'}, {name: 'Brdige'}]}}, {key: "hardware_interface", label: "Hardware Interface", component: () => TextBox }, {key: "vlan_id", label: "VLAN ID", component: () => NumberBox, props: {min: 1, max: 4094} }, - {key: "bond_members", label: "Nond Members", component: () => TextBox }, + {key: "bond_members", label: "Bond Members", component: () => TextBox, if: () => true }, {key: "bridge_members", label: "Bridge Memebers", component: () => TextBox }, {key: "addressing_mode", label: "Addressing Mode", component: () => PillBar, props: {options: [{name: 'None', selected: true}, {name: 'Static'}, {name: 'DHCP'}]}}, {key: "address", label: "Address", component: () => TextBox }, diff --git a/client/src/pages/edit/[subsystem]/[entity]/[id].vue b/client/src/pages/edit/[subsystem]/[entity]/[id].vue index 01b8f28..49d531d 100644 --- a/client/src/pages/edit/[subsystem]/[entity]/[id].vue +++ b/client/src/pages/edit/[subsystem]/[entity]/[id].vue @@ -5,6 +5,8 @@ import { editTypes } from "../../../../definitions"; const props = $defineProps<{subsystem: string, entity: string, id: string}>(); const { subsystem, entity, id } = $(props); +let data = $ref({} as {}); + async function update() { } @@ -16,7 +18,7 @@ async function update() { - +
diff --git a/client/src/pages/edit/[subsystem]/[entity]/index.vue b/client/src/pages/edit/[subsystem]/[entity]/index.vue index 4d4bba8..32e74fd 100644 --- a/client/src/pages/edit/[subsystem]/[entity]/index.vue +++ b/client/src/pages/edit/[subsystem]/[entity]/index.vue @@ -4,6 +4,8 @@ import { editTypes } from "../../../../definitions"; const props = $defineProps<{subsystem: string, entity: string}>(); const { subsystem, entity } = $(props); +let data = $ref({}); + async function create() { } @@ -15,7 +17,7 @@ async function create() { - +