From 322013e4cc8cd80c4b36d9e0943775c9286ef83d Mon Sep 17 00:00:00 2001 From: AmyangXYZ Date: Sun, 4 Feb 2024 12:51:14 -0500 Subject: [PATCH] add stats subscribe/report and clean codes --- src/components/NodeStats.vue | 32 ++++++---- src/components/TopoEditToolbox.vue | 6 +- src/core/network.ts | 34 +++++++---- src/core/nodes/end_system.ts | 41 +++---------- src/core/nodes/five_g_gnb.ts | 47 -------------- src/core/nodes/five_g_ue.ts | 47 -------------- src/core/nodes/node.ts | 98 ++++++++++++++++++++++++++++-- src/core/nodes/tsch.ts | 47 -------------- src/core/nodes/tsn.ts | 49 --------------- src/core/typedefs/message.ts | 11 +++- src/core/typedefs/node.ts | 2 - src/core/typedefs/stats.ts | 6 ++ src/hooks/useDrawTopology.ts | 11 +--- src/hooks/useStates.ts | 3 +- src/topologies/5G-TSN-TSCH.json | 7 ++- src/views/HomeView.vue | 2 +- 16 files changed, 172 insertions(+), 271 deletions(-) create mode 100644 src/core/typedefs/stats.ts diff --git a/src/components/NodeStats.vue b/src/components/NodeStats.vue index 64159ed..ddc673e 100644 --- a/src/components/NodeStats.vue +++ b/src/components/NodeStats.vue @@ -2,11 +2,11 @@ import sensortag from '@/assets/sensortag.png' import tsn_switch from '@/assets/tsn_switch.png' import five_g_gnb from '@/assets/five_g_gnb.png' -import { Network, SelectedNode } from '@/hooks/useStates' +import { Network } from '@/hooks/useStates' import { NODE_TYPE, NODE_TYPE_DISPLAY_NAME } from '@/core/typedefs' import { Picture } from '@element-plus/icons-vue' -const images: { [type: number]: string } = { +const avatars: { [type: number]: string } = { [NODE_TYPE.TSCH]: sensortag, [NODE_TYPE.TSN]: tsn_switch, [NODE_TYPE.FIVE_G_GNB]: five_g_gnb @@ -14,23 +14,33 @@ const images: { [type: number]: string } = {