Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Simon Hunt
2014-10-30 21:31:44 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3c29c14284202bc449c87757c5abb7b70a6fa61b
3c29c142
1 parent
580163da
Added port numbers to port labels. Still needs fine tuning, but good enough for the demo.
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
10 deletions
web/gui/src/main/webapp/network.js
web/gui/src/main/webapp/onos.css
web/gui/src/main/webapp/network.js
View file @
3c29c14
...
...
@@ -89,9 +89,9 @@
marginLR
:
3
,
marginTB
:
2
,
port
:
{
gap
:
2
,
width
:
1
2
,
height
:
1
2
gap
:
3
,
width
:
1
8
,
height
:
1
4
}
},
icons
:
{
...
...
@@ -315,6 +315,7 @@
portLabelsOn
=
!
portLabelsOn
;
var
portVis
=
portLabelsOn
?
'visible'
:
'hidden'
;
d3
.
selectAll
(
'.port'
).
style
(
'visibility'
,
portVis
);
d3
.
selectAll
(
'.portText'
).
style
(
'visibility'
,
portVis
);
}
function
unpin
()
{
...
...
@@ -577,30 +578,46 @@
class
:
'portLayer'
});
var
portVis
=
portLabelsOn
?
'visible'
:
'hidden'
;
var
portVis
=
portLabelsOn
?
'visible'
:
'hidden'
,
pw
=
config
.
labels
.
port
.
width
,
ph
=
config
.
labels
.
port
.
height
;
network
.
link
.
filter
(
'.infra'
).
each
(
function
(
d
,
i
)
{
network
.
linkSrcPort
.
append
(
'rect'
).
attr
({
id
:
'srcPort-'
+
d
.
id
,
class
:
'port'
,
width
:
12
,
height
:
12
,
width
:
pw
,
height
:
ph
,
x
:
i
*
20
,
y
:
0
})
.
style
(
'visibility'
,
portVis
)
.
append
(
'text'
).
text
(
d
.
srcPort
);
.
style
(
'visibility'
,
portVis
);
network
.
linkTgtPort
.
append
(
'rect'
).
attr
({
id
:
'tgtPort-'
+
d
.
id
,
class
:
'port'
,
width
:
12
,
height
:
12
,
width
:
pw
,
height
:
ph
,
x
:
i
*
20
,
y
:
20
})
.
style
(
'visibility'
,
portVis
);
network
.
linkSrcPort
.
append
(
'text'
).
attr
({
id
:
'srcText-'
+
d
.
id
,
class
:
'portText'
,
x
:
i
*
20
,
y
:
0
}).
text
(
d
.
srcPort
)
.
style
(
'visibility'
,
portVis
);
network
.
linkTgtPort
.
append
(
'text'
).
attr
({
id
:
'tgtText-'
+
d
.
id
,
class
:
'portText'
,
x
:
i
*
20
,
y
:
20
}).
text
(
d
.
tgtPort
)
.
style
(
'visibility'
,
portVis
);
});
// ...............................................................
...
...
@@ -982,6 +999,15 @@
.
attr
(
'x'
,
pxt
-
portHalfW
)
.
attr
(
'y'
,
pyt
-
portHalfH
);
// TODO: fit label rect to size of port number.
d3
.
select
(
'#srcText-'
+
d
.
id
)
.
attr
(
'x'
,
pxs
-
5
)
.
attr
(
'y'
,
pys
+
3
);
d3
.
select
(
'#tgtText-'
+
d
.
id
)
.
attr
(
'x'
,
pxt
-
5
)
.
attr
(
'y'
,
pyt
+
3
);
});
// position each node by translating the node (group) by x,y
...
...
web/gui/src/main/webapp/onos.css
View file @
3c29c14
...
...
@@ -112,6 +112,14 @@ svg g.portLayer rect.port {
fill
:
white
;
}
svg
g
.portLayer
text
{
stroke
:
#888
;
font-size
:
8pt
;
text-align
:
center
;
font-weight
:
normal
;
pointer-events
:
none
;
}
svg
.node.device
rect
{
stroke-width
:
1.5px
;
...
...
Please
register
or
login
to post a comment