From 2f72f4cca04a47754de05a86f1ed714782841f85 Mon Sep 17 00:00:00 2001 From: AmyangXYZ Date: Sat, 6 Jan 2024 11:06:36 -0500 Subject: [PATCH] improve log and link/packet curve --- public/topologies/example.json | 21 ++++++++++ src/components/NodeStats.vue | 4 +- src/core/network.ts | 42 +++++++++++-------- src/core/typedefs.ts | 10 +++++ src/hooks/useDrawTopology.ts | 75 +++++++++++++++++----------------- src/hooks/useStates.ts | 2 +- 6 files changed, 97 insertions(+), 57 deletions(-) create mode 100644 public/topologies/example.json diff --git a/public/topologies/example.json b/public/topologies/example.json new file mode 100644 index 0000000..e3722bc --- /dev/null +++ b/public/topologies/example.json @@ -0,0 +1,21 @@ +{ + "name": "example", + "nodes": [ + { + "id": 1, + "type": 2, + "pos": [ + 0, + 0 + ] + }, + { + "id": 1, + "type": 2, + "pos": [ + 0, + 0 + ] + } + ] +} \ No newline at end of file diff --git a/src/components/NodeStats.vue b/src/components/NodeStats.vue index 0a3c36d..88feeb6 100644 --- a/src/components/NodeStats.vue +++ b/src/components/NodeStats.vue @@ -2,7 +2,7 @@ import rpi4 from '@/assets/rpi4.png' import sensortag from '@/assets/sensortag.png' import { Network, SelectedNode } from '@/hooks/useStates' -import { NODE_TYPE } from '@/core/typedefs' +import { NODE_TYPE, NODE_TYPE_DISPLAY_NAME } from '@/core/typedefs'