diff --git a/src/components/EditorWindow.vue b/src/components/EditorWindow.vue index 22e5519..7b65018 100644 --- a/src/components/EditorWindow.vue +++ b/src/components/EditorWindow.vue @@ -4,7 +4,7 @@ import { ref, onMounted } from 'vue' import HeaderBlock from './HeaderBlock.vue'; import { Network, type Data } from 'vis-network' import { getGraph, updateNode } from './client'; -import type { Graph, GraphApplication, GraphEdge, GraphNode } from './models'; +import type { Graph, GraphApplication, GraphDoor, GraphEdge, GraphNode } from './models'; const network = ref() @@ -144,6 +144,14 @@ function removeApplicationToSelectedNode(name: string) { selectedNode.value.applications = selectedNode.value.applications.filter(function (it: GraphApplication): boolean { return it.name != name }) } +function addDoorToSelectedNode() { + selectedNode.value.doors.push({ code: "", name: "", show: false }) +} + +function removeDoorToSelectedNode(code: string) { + selectedNode.value.doors = selectedNode.value.doors.filter(function (it: GraphDoor): boolean { return it.code != code }) +} + function selectNode(node: GraphNode) { console.log("Select node:", node) updatedNodeID.value = node.code @@ -204,11 +212,6 @@ async function addSelectedNode() { selectNode(nodes[0]) } -async function clearSelectedNode() { - console.log("Clear node") - selectNode(emptyNode) -} - function nodeHeader(node: GraphNode): string { return "[" + node.code + "] - " + node.name } @@ -247,7 +250,9 @@ function showGraph(show: boolean) {
- + +
+
+

Двери: {{ selectedNode.doors.length }} + +

+
+
+ + - + - + +
+

Приложения: {{ selectedNode.applications.length }} @@ -331,14 +350,7 @@ function showGraph(show: boolean) {
-
-
-
- -
-
-

@@ -456,7 +468,7 @@ function showGraph(show: boolean) { } .node-name-edit-field { - width: 220px; + width: 200px; } .application-add-button { @@ -468,9 +480,9 @@ function showGraph(show: boolean) { .application-remove-button { position: absolute; - left: -25px; - width: 23px; - height: 23px; + left: -15px; + width: 20px; + height: 20px; } @@ -624,4 +636,8 @@ function showGraph(show: boolean) { .checkbox-green.focused .checkbox-green-switch:after { box-shadow: inset 0px 0px 4px #ff5623; } + +.tb-5 { + margin: 5px 0; +}