From 653005c7fc7854ca98f9f91aca9747f89b9b49be Mon Sep 17 00:00:00 2001 From: Timon Alexander Selnes Date: Sun, 3 Nov 2024 14:23:29 +0100 Subject: [PATCH 1/2] Add connection types to devices (wip), cleanup to follow vue best practises --- client/src/components/FlowCard.vue | 15 +- client/src/components/PageNavigation.vue | 2 +- client/src/components/common/BaseButton.vue | 34 ++--- .../src/components/common/BaseInputField.vue | 42 +++--- client/src/components/common/BaseModal.vue | 40 ++--- .../src/components/devices/DeviceInstance.vue | 41 ++--- client/src/components/devices/DeviceModal.vue | 74 +++++++++ client/src/components/devices/DevicesCard.vue | 13 +- client/src/components/flow/FlowHeader.vue | 13 +- client/src/components/flow/FlowLog.vue | 8 +- client/src/components/flow/FlowLogList.vue | 11 +- client/src/components/flow/FlowNode.vue | 3 +- client/src/components/flow/FlowNodeInput.vue | 3 +- client/src/components/flow/NodesList.vue | 142 +++++++++--------- client/src/components/flow/NodesListItem.vue | 91 +++++------ .../src/components/navigation/NavButton.vue | 16 +- client/src/router/index.ts | 14 +- client/src/services/DevicesService.ts | 20 ++- client/src/types/DeviceTypes.ts | 21 ++- .../{DevicesView.vue => CategoryView.vue} | 86 +++++------ client/src/views/DeviceView.vue | 45 +++--- client/src/views/FlowView.vue | 7 +- 22 files changed, 412 insertions(+), 329 deletions(-) create mode 100644 client/src/components/devices/DeviceModal.vue rename client/src/views/{DevicesView.vue => CategoryView.vue} (98%) diff --git a/client/src/components/FlowCard.vue b/client/src/components/FlowCard.vue index df3683b..4613aab 100644 --- a/client/src/components/FlowCard.vue +++ b/client/src/components/FlowCard.vue @@ -2,16 +2,20 @@ import BaseButton from '@/components/common/BaseButton.vue' import BaseInputField from './common/BaseInputField.vue' import BaseModal from './common/BaseModal.vue' -import type { Flow } from '@/types/FlowType' -import EditPen from '@/icons/EditPen.vue' -import { router } from '@/router' + import PlayIcon from '@/icons/RightArrow.vue' +import EditPen from '@/icons/EditPen.vue' + +import type { Flow } from '@/types/FlowType' import { inject, ref, type Ref } from 'vue' +import { router } from '@/router' const props = defineProps<{ flow: Flow }>() +const showEditFlowForm = ref(false) +const editFlowType = ref(null) const flows = inject>('flows', ref([])) const navigateToFlow = (id: string) => { @@ -19,11 +23,6 @@ const navigateToFlow = (id: string) => { router.push(`${currentPath}/${id}`) } -// Flow editor -const showEditFlowForm = ref(false) - -const editFlowType = ref(null) - const editFlow = (flow: Flow) => { editFlowType.value = { ...flow } ;(document.getElementById(`editFlowForm${flow.id}`) as HTMLDialogElement).showModal() diff --git a/client/src/components/PageNavigation.vue b/client/src/components/PageNavigation.vue index 82c5635..f47388b 100644 --- a/client/src/components/PageNavigation.vue +++ b/client/src/components/PageNavigation.vue @@ -34,7 +34,7 @@ onMounted(() => {

liltest