From de3e38f2f7a8791375257bea20d774d02c92d686 Mon Sep 17 00:00:00 2001 From: haim-kermany Date: Wed, 18 Oct 2023 12:16:37 +0300 Subject: [PATCH] overview --- pkg/drawio/createMapFile.go | 6 +++--- pkg/drawio/iconTreeNode.go | 5 ----- pkg/drawio/styles.go | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/pkg/drawio/createMapFile.go b/pkg/drawio/createMapFile.go index 585c10543..e9a71dff8 100644 --- a/pkg/drawio/createMapFile.go +++ b/pkg/drawio/createMapFile.go @@ -19,7 +19,7 @@ type drawioData struct { MiniIconSize int RootID uint IDsPrefix string - canTypeHavaAMiniIcon map[reflect.Type]bool + canTypeHaveAMiniIcon map[reflect.Type]bool Nodes []TreeNodeInterface } @@ -58,7 +58,7 @@ func orderNodesForDrawio(nodes []TreeNodeInterface) []TreeNodeInterface { // if the ni is connected to a vsi that has more than one ni, than the ni displayed as ni icon, and without mini icons // same with resIp and vpe -func getTypeHasMiniIcon(nodes []TreeNodeInterface) map[reflect.Type]bool { +func getCanTypeHaveMiniIcon(nodes []TreeNodeInterface) map[reflect.Type]bool { typeHasMiniIcon := map[reflect.Type]bool{} for _, tn := range nodes { if reflect.TypeOf(tn).Elem() == reflect.TypeOf(VsiTreeNode{}) { @@ -82,7 +82,7 @@ func CreateDrawioConnectivityMapFile(network SquareTreeNodeInterface, outputFile miniIconSize, network.ID(), idsPrefix, - getTypeHasMiniIcon(allNodes), + getCanTypeHaveMiniIcon(allNodes), orderNodesForDrawio(allNodes), } diff --git a/pkg/drawio/iconTreeNode.go b/pkg/drawio/iconTreeNode.go index b8acd2720..a17523e44 100644 --- a/pkg/drawio/iconTreeNode.go +++ b/pkg/drawio/iconTreeNode.go @@ -73,11 +73,6 @@ func (tn *abstractIconTreeNode) absoluteRouterGeometry() (x, y int) { return absoluteGeometry(tn) } -// ///////////////////////////////////////////////////////////////////////////////////////////// -type NIorRIPTreeNode struct { - abstractIconTreeNode -} - // /////////////////////////////////////////// type NITreeNode struct { abstractIconTreeNode diff --git a/pkg/drawio/styles.go b/pkg/drawio/styles.go index 805562e7c..2f4ec6262 100644 --- a/pkg/drawio/styles.go +++ b/pkg/drawio/styles.go @@ -90,7 +90,7 @@ var decoreStyles = map[reflect.Type]string{ } func (data *drawioData) HasMiniIcon(tn TreeNodeInterface) bool { - if data.canTypeHavaAMiniIcon[reflect.TypeOf(tn).Elem()] && tn.(IconTreeNodeInterface).hasMiniIcon() { + if data.canTypeHaveAMiniIcon[reflect.TypeOf(tn).Elem()] && tn.(IconTreeNodeInterface).hasMiniIcon() { return true } return false @@ -99,7 +99,7 @@ func (data *drawioData) Style(tn TreeNodeInterface) string { tnType := reflect.TypeOf(tn).Elem() if tnType == reflect.TypeOf(ConnectivityTreeNode{}) { return connectivityStyle(tn.(*ConnectivityTreeNode)) - } else if data.canTypeHavaAMiniIcon[tnType] && !tn.(IconTreeNodeInterface).hasMiniIcon() { + } else if data.canTypeHaveAMiniIcon[tnType] && !tn.(IconTreeNodeInterface).hasMiniIcon() { return miniStyles[tnType] } return styles[tnType]