Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support vpe #200

Merged
merged 140 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 136 commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
22d5c6d
first implementation
haim-kermany Aug 27, 2023
45f7677
GroupPointTreeNode
haim-kermany Aug 28, 2023
fa2e4f3
layout group point
haim-kermany Aug 28, 2023
a5690c9
calc icon Location
haim-kermany Aug 30, 2023
cac5744
NewGroupedConnection()
haim-kermany Aug 30, 2023
724f483
fip to groups
haim-kermany Aug 31, 2023
0fa40d3
gw router to grouping
haim-kermany Aug 31, 2023
dfc07c4
external icon
haim-kermany Sep 5, 2023
fe55b17
icons Only
haim-kermany Sep 6, 2023
b486e73
only icons src/dst
haim-kermany Sep 6, 2023
ffc7d3e
first implementation
haim-kermany Sep 7, 2023
ad4c89b
routers
haim-kermany Sep 7, 2023
5861910
set routers
haim-kermany Sep 7, 2023
79c6285
cleanup
haim-kermany Sep 7, 2023
9a5e797
sgs
haim-kermany Sep 10, 2023
fcd916d
cidr
haim-kermany Sep 10, 2023
56a2445
cleanup details()
haim-kermany Sep 10, 2023
f3c7fd9
DrawioGenerator
haim-kermany Sep 10, 2023
4c72299
DrawioGenerator
haim-kermany Sep 10, 2023
222c923
removing allTreeNodes
haim-kermany Sep 10, 2023
076835f
clean global vars
haim-kermany Sep 10, 2023
528a184
fix is connected
haim-kermany Sep 11, 2023
581ec49
remove drawioResource
haim-kermany Sep 11, 2023
cbaec5c
DrawioGenerator struct
haim-kermany Sep 12, 2023
7fd1104
new file
haim-kermany Sep 12, 2023
5da7ea5
oimt IBMGenerator
haim-kermany Sep 12, 2023
7e8ecfe
gofmt
haim-kermany Sep 12, 2023
514639a
lint
haim-kermany Sep 12, 2023
e41cf29
removing Init()
haim-kermany Sep 13, 2023
f0eda76
gp can only be icons[]
haim-kermany Sep 14, 2023
cd2983a
subnet Conn
haim-kermany Sep 14, 2023
ddb75bb
handleGroupingLinesOverBorders()
haim-kermany Sep 18, 2023
70afa3b
fix offset
haim-kermany Sep 18, 2023
f4e5964
group square
haim-kermany Sep 18, 2023
d1eda59
Merge branch 'main' into drawio-support-squares-connectivity
haim-kermany Sep 18, 2023
4c3780f
createGroupingSquares()
haim-kermany Sep 19, 2023
2639e56
Merge branch 'main' into create_drawio_in_ibmvpc
haim-kermany Sep 19, 2023
7a8a770
remove double code
haim-kermany Sep 19, 2023
b12a6ef
lint
haim-kermany Sep 19, 2023
a70132b
comment
haim-kermany Sep 19, 2023
10a4483
first implementation
haim-kermany Sep 19, 2023
fe1a018
naming endpoint
haim-kermany Sep 19, 2023
9e7ee2e
connLabel
haim-kermany Sep 19, 2023
bc777c8
add test
haim-kermany Sep 20, 2023
0575b87
Merge branch 'main' into create_drawio_in_ibmvpc
haim-kermany Sep 20, 2023
97d2aa4
Merge branch 'create_drawio_in_ibmvpc' into support-grouping-in-drawio
haim-kermany Sep 20, 2023
5fc6523
Merge branch 'main' into drawio-support-squares-connectivity
haim-kermany Sep 20, 2023
651c330
Merge branch 'drawio-support-squares-connectivity' into support-group…
haim-kermany Sep 20, 2023
6f27658
create groupSquares
haim-kermany Sep 20, 2023
6059e7e
GenerateDrawioTreeNode() for edges
haim-kermany Sep 20, 2023
fe59ba8
adding group points
haim-kermany Sep 21, 2023
77cccc9
setGroupingIconsLocations()
haim-kermany Sep 21, 2023
4f8b624
connectGroupies()
haim-kermany Sep 21, 2023
5b48094
right icon size
haim-kermany Sep 24, 2023
403ef31
fix groupies direction
haim-kermany Sep 24, 2023
1bf27ca
debugging
haim-kermany Sep 27, 2023
3a68610
Merge branch 'main' into create_drawio_in_ibmvpc
haim-kermany Sep 27, 2023
032a0ef
code review
haim-kermany Sep 27, 2023
bab774d
Merge branch 'create_drawio_in_ibmvpc' into support-grouping-in-drawio
haim-kermany Sep 27, 2023
a9791f0
Merge branch 'main' into support-grouping-in-drawio
haim-kermany Sep 27, 2023
2247f0f
block from parse args
haim-kermany Sep 27, 2023
c3c38dc
remove unused
haim-kermany Sep 27, 2023
1852466
Merge branch 'support-grouping-in-drawio' into support-grouping-in-dr…
haim-kermany Sep 27, 2023
51bffd3
stronger overlapping
haim-kermany Sep 27, 2023
0fb28fb
fix setIconsMap()
haim-kermany Sep 28, 2023
ef64cbd
Merge branch 'main' into support-grouping-in-drawio
haim-kermany Sep 28, 2023
da6f198
code review
haim-kermany Sep 28, 2023
d1be689
lint
haim-kermany Sep 28, 2023
1b145c4
Merge branch 'support-grouping-in-drawio' into support-grouping-in-dr…
haim-kermany Sep 28, 2023
d41830b
all tests
haim-kermany Sep 28, 2023
db4e092
code review
haim-kermany Sep 28, 2023
3ac8e51
Merge branch 'support-grouping-in-drawio' into support-grouping-in-dr…
haim-kermany Sep 28, 2023
090c808
fix icon location
haim-kermany Sep 28, 2023
a63f6ea
code review
haim-kermany Sep 28, 2023
0403f0d
Merge branch 'support-grouping-in-drawio' into support-grouping-in-dr…
haim-kermany Sep 28, 2023
6db5fb7
use offsets for squares
haim-kermany Oct 1, 2023
6ec8845
square offset
haim-kermany Oct 1, 2023
4eed40c
fix gp overlap
haim-kermany Oct 1, 2023
2d6a765
fix inheritenc
haim-kermany Oct 1, 2023
7889d63
Merge branch 'main' into support-grouping-in-drawio
haim-kermany Oct 1, 2023
e308467
Merge branch 'support-grouping-in-drawio' into support-grouping-in-dr…
haim-kermany Oct 1, 2023
9d4c4dd
set consts
haim-kermany Oct 3, 2023
c99e406
Merge branch 'main' into support-grouping-in-drawio-groupedEndpointsE…
haim-kermany Oct 3, 2023
e76a22e
simplify edge map
haim-kermany Oct 3, 2023
0cb10b9
visibility
haim-kermany Oct 4, 2023
3ca4a07
moving overlapping icons
haim-kermany Oct 4, 2023
755573d
set visibility
haim-kermany Oct 5, 2023
f697adc
rewrite code
haim-kermany Oct 5, 2023
2ca5584
calcGroupsOrder()
haim-kermany Oct 5, 2023
eb9175e
nonGroupedIcons
haim-kermany Oct 5, 2023
9cb9621
fixing rowIndex++
haim-kermany Oct 8, 2023
fc3e86a
Merge branch 'main' into support-grouping-in-drawio-groupedEndpointsE…
haim-kermany Oct 8, 2023
a200d4d
adding tests
haim-kermany Oct 8, 2023
ffc3984
clean test
haim-kermany Oct 8, 2023
2fa8f1c
comments
haim-kermany Oct 9, 2023
c737d90
fix group counting
haim-kermany Oct 9, 2023
04468db
no erows on groupPoint
haim-kermany Oct 9, 2023
0ecf707
simplify calcGroupsOrder()
haim-kermany Oct 9, 2023
1dce7ff
rearange code
haim-kermany Oct 10, 2023
edc25c0
rearange code
haim-kermany Oct 10, 2023
845f587
rewrite code
haim-kermany Oct 10, 2023
eba5e71
review
haim-kermany Oct 10, 2023
a660c4c
Merge branch 'main' into support-grouping-in-drawio-groupedEndpointsE…
haim-kermany Oct 10, 2023
ddb3934
fmt
haim-kermany Oct 10, 2023
6182047
lint
haim-kermany Oct 10, 2023
82d3e08
Merge branch 'main' into support-grouping-in-drawio-groupedEndpointsE…
haim-kermany Oct 11, 2023
29786ae
Merge branch 'main' into support-grouping-in-drawio-groupedEndpointsE…
haim-kermany Oct 15, 2023
fe08216
fix for not supporting vpe
haim-kermany Oct 15, 2023
49c9b97
lint
haim-kermany Oct 15, 2023
1cb28f2
put vsi bigger than ni
haim-kermany Oct 15, 2023
262a211
vpe styles
haim-kermany Oct 15, 2023
2f0a4bd
miniIcon
haim-kermany Oct 15, 2023
5385408
miniIcon
haim-kermany Oct 15, 2023
e03d5d8
initial rip
haim-kermany Oct 15, 2023
0b6d4cd
resIPs
haim-kermany Oct 16, 2023
0610857
resIP on drawio
haim-kermany Oct 16, 2023
653fecb
vpelayout
haim-kermany Oct 16, 2023
59a7bbe
vpe test
haim-kermany Oct 16, 2023
d9fce40
drawio generator support
haim-kermany Oct 16, 2023
0ae935c
multi nis example
haim-kermany Oct 16, 2023
bb24fb4
code review
haim-kermany Oct 16, 2023
dd3384b
comments
haim-kermany Oct 16, 2023
c937e0c
code review
haim-kermany Oct 16, 2023
85a99bf
Merge branch 'support-grouping-in-drawio-groupedEndpointsElems' into …
haim-kermany Oct 17, 2023
a643614
add test
haim-kermany Oct 17, 2023
b175f25
small fix
haim-kermany Oct 17, 2023
5ac3853
an all test
haim-kermany Oct 17, 2023
520868c
merge main
haim-kermany Oct 17, 2023
e6f23b7
remove NIorRIPTreeNode
haim-kermany Oct 17, 2023
6aa5d7a
hasMiniIcon()
haim-kermany Oct 17, 2023
3267c3e
mini icons style
haim-kermany Oct 18, 2023
d16972a
remove HasVSIs
haim-kermany Oct 18, 2023
54af62a
rewrite calcGroupsVisibility
haim-kermany Oct 18, 2023
de3e38f
overview
haim-kermany Oct 18, 2023
622e1af
lint
haim-kermany Oct 18, 2023
0e44b16
Merge branch 'main' into support-vpe
haim-kermany Oct 18, 2023
1bb82f3
Merge branch 'main' into support-vpe
haim-kermany Oct 19, 2023
f6d8a1d
code review
haim-kermany Oct 19, 2023
45c1f10
static methods
haim-kermany Oct 23, 2023
2d1cd65
code review
haim-kermany Oct 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/drawio/abstractTreeNode.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "strings"
const (
minID = 100
nextIDStep = 10
niVsiID = 1
miniIconID = 1
niFipID = 2
textID = 3
tagID = 4
Expand Down
12 changes: 5 additions & 7 deletions pkg/drawio/connectivityMap.drawio.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@
<mxGeometry width="{{$node.IconSize}}" height="{{$node.IconSize}}" x="{{$node.X}}" y="{{$node.Y}}" as="geometry"/>
</mxCell>
{{ end }}
{{ if $data.HasMiniIcon $node }}
<mxCell id="{{$data.IDsPrefix}}-{{$node.MiniIconID}}" value="" style="{{$data.MiniIconStyle $node}}" parent="{{$data.IDsPrefix}}-{{$node.ID}}" vertex="1">
<mxGeometry x="{{$data.MiniIconXOffset}}" y="{{$data.MiniIconYOffset}}" width="{{$data.MiniIconSize}}" height="{{$data.MiniIconSize}}" as="geometry"/>
</mxCell>
{{ end }}
{{ if $node.IsNI }}
{{ if $node.HasVsi }}
{{ if $data.ShowNIIcon }}
<mxCell id="{{$data.IDsPrefix}}-{{$node.VsiID}}" value="" style="{{$data.VsiStyle}}" parent="{{$data.IDsPrefix}}-{{$node.ID}}" vertex="1">
<mxGeometry x="{{$data.VSIXOffset}}" y="{{$data.VSIYOffset}}" width="{{$data.VSISize}}" height="{{$data.VSISize}}" as="geometry"/>
</mxCell>
{{ end }}
{{ end }}
{{ if $node.HasFip }}
<mxCell id="{{$data.IDsPrefix}}-{{$node.FipID}}" value="{{$node.Fip}}" style="{{$data.FIPStyle}}" parent="{{$data.IDsPrefix}}-{{$node.ID}}" vertex="1">
<mxGeometry x="{{$data.FipXOffset}}" y="{{$data.FipYOffset}}" width="{{$node.IconSize}}" height="{{$node.IconSize}}" as="geometry"/>
Expand Down
53 changes: 37 additions & 16 deletions pkg/drawio/createMapFile.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ import (
var drawioTemplate string

type drawioData struct {
FipXOffset int
FipYOffset int
VSIXOffset int
VSIYOffset int
VSISize int
RootID uint
IDsPrefix string
// ShowNIIcon says if to display the NI as an NI image, or a VSI image
// the rule is that if we have a vsi icon, then we display the NI icon as an NI image
ShowNIIcon bool
Nodes []TreeNodeInterface
FipXOffset int
FipYOffset int
MiniIconXOffset int
MiniIconYOffset int
MiniIconSize int
RootID uint
IDsPrefix string
canTypeHaveAMiniIcon map[reflect.Type]bool
zivnevo marked this conversation as resolved.
Show resolved Hide resolved
Nodes []TreeNodeInterface
}

// orderNodesForDrawio() sort the nodes for the drawio canvas
Expand Down Expand Up @@ -52,19 +50,42 @@ func orderNodesForDrawio(nodes []TreeNodeInterface) []TreeNodeInterface {
return orderedNodes
}

// mini icons:
// some icons might have mini icons (ni and resIp). the rule is:
// if there are no vsi icon in the canvas, all the ni are displayed as vsi icon, and without mini icons
// if there is a vsi icon in the canvas, than:
// if the ni is connected to a vsi that has only one ni, than the ni displayed as vsi icon, with an ni mini icons
// 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 getCanTypeHaveMiniIcon(nodes []TreeNodeInterface) map[reflect.Type]bool {
typeHasMiniIcon := map[reflect.Type]bool{}
for _, tn := range nodes {
if reflect.TypeOf(tn).Elem() == reflect.TypeOf(VsiTreeNode{}) {
typeHasMiniIcon[reflect.TypeOf(NITreeNode{})] = true
}
if reflect.TypeOf(tn).Elem() == reflect.TypeOf(VpeTreeNode{}) {
typeHasMiniIcon[reflect.TypeOf(ResIPTreeNode{})] = true
}
}
return typeHasMiniIcon
}

func CreateDrawioConnectivityMapFile(network SquareTreeNodeInterface, outputFile string) error {
newLayout(network).layout()
allNodes := getAllNodes(network)
data := &drawioData{
fipXOffset,
fipYOffset,
vsiXOffset,
vsiYOffset,
vsiIconSize,
miniIconXOffset,
miniIconYOffset,
miniIconSize,
network.ID(),
idsPrefix,
network.HasVSIs(),
orderNodesForDrawio(allNodes)}
getCanTypeHaveMiniIcon(allNodes),
orderNodesForDrawio(allNodes),
}

return writeDrawioFile(data, outputFile)
}

Expand Down
Loading
Loading