aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/web/gui/src/main/webapp/app/view/topo
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/web/gui/src/main/webapp/app/view/topo')
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/view/topo/topo.css10
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/view/topo/topo.js6
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoD3.js70
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoOverlay.js5
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoPanel.js2
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoToolbar.js2
6 files changed, 61 insertions, 34 deletions
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topo.css b/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topo.css
index dda6d5c6..0319b9b7 100644
--- a/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topo.css
+++ b/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topo.css
@@ -82,10 +82,10 @@
#topo-p-detail {
/* Base css from panel.css */
- top: 320px;
+ top: 338px;
}
html[data-platform='iPad'] #topo-p-detail {
- top: 336px;
+ top: 354px;
}
#topo-p-detail .actionBtns .actionBtn {
@@ -452,7 +452,7 @@ html[data-platform='iPad'] #topo-p-detail {
}
#ov-topo svg .node .badge.badgeInfo circle {
- fill: #ccf;
+ fill: #99d;
}
#ov-topo svg .node .badge.badgeWarn circle {
@@ -464,7 +464,7 @@ html[data-platform='iPad'] #topo-p-detail {
}
#ov-topo svg .node .badge use {
- fill: white;
+ fill: white !important;
}
#ov-topo svg .node .badge.badgeInfo use {
@@ -472,7 +472,7 @@ html[data-platform='iPad'] #topo-p-detail {
}
#ov-topo svg .node .badge text {
- fill: white;
+ fill: white !important;
}
#ov-topo svg .node .badge.badgeInfo text {
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topo.js b/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topo.js
index 702584af..3564eb33 100644
--- a/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topo.js
+++ b/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topo.js
@@ -304,6 +304,12 @@
return c.properties.continent === 'South America';
},
+ ns_america: function (c) {
+ return c.properties.custom === 'US-cont' ||
+ c.properties.subregion === 'Central America' ||
+ c.properties.continent === 'South America';
+ },
+
japan: function (c) {
return c.properties.geounit === 'Japan';
},
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoD3.js b/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoD3.js
index 1d2c5b10..5bf2eb4f 100644
--- a/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoD3.js
+++ b/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoD3.js
@@ -200,7 +200,6 @@
};
}
-
function updateDeviceRendering(d) {
var label = trimLabel(deviceLabel(d)),
noLabel = !label,
@@ -237,31 +236,50 @@
// handle badge, if defined
if (bdg) {
- node.select('g.badge').remove();
-
- bsel = node.append('g')
- .classed('badge', true)
- .classed(badgeStatus(bdg), true)
- .attr('transform', sus.translate(dx + dim, dy));
-
- bsel.append('circle')
- .attr('r', bcr);
-
- if (bdg.txt) {
- bsel.append('text')
- .attr('dy', badgeConfig.yoff)
- .attr('text-anchor', 'middle')
- .text(bdg.txt);
- } else if (bdg.gid) {
- bsel.append('use')
- .attr({
- width: bcgd * 2,
- height: bcgd * 2,
- transform: sus.translate(-bcgd, -bcgd),
- 'xlink:href': '#' + bdg.gid
- });
+ renderBadge(node, bdg, { dx: dx + dim, dy: dy });
+ }
+ }
- }
+ function updateHostRendering(d) {
+ var node = d.el,
+ bdg = d.badge;
+
+ updateHostLabel(d);
+
+ // handle badge, if defined
+ if (bdg) {
+ renderBadge(node, bdg, icfg.host.badge);
+ }
+ }
+
+ function renderBadge(node, bdg, boff) {
+ var bsel,
+ bcr = badgeConfig.radius,
+ bcgd = badgeConfig.gdelta;
+
+ node.select('g.badge').remove();
+
+ bsel = node.append('g')
+ .classed('badge', true)
+ .classed(badgeStatus(bdg), true)
+ .attr('transform', sus.translate(boff.dx, boff.dy));
+
+ bsel.append('circle')
+ .attr('r', bcr);
+
+ if (bdg.txt) {
+ bsel.append('text')
+ .attr('dy', badgeConfig.yoff)
+ .attr('text-anchor', 'middle')
+ .text(bdg.txt);
+ } else if (bdg.gid) {
+ bsel.append('use')
+ .attr({
+ width: bcgd * 2,
+ height: bcgd * 2,
+ transform: sus.translate(-bcgd, -bcgd),
+ 'xlink:href': '#' + bdg.gid
+ });
}
}
@@ -292,7 +310,7 @@
}
function hostExisting(d) {
- updateHostLabel(d);
+ updateHostRendering(d);
api.posNode(d, true);
}
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoOverlay.js b/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoOverlay.js
index 2dee4c40..fb7921ad 100644
--- a/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoOverlay.js
+++ b/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoOverlay.js
@@ -312,8 +312,11 @@
}
data.hosts.forEach(function (host) {
- var hdata = api.findNodeById(host.id);
+ var hdata = api.findNodeById(host.id),
+ badgeData = host.badge || null;
+
if (hdata && !hdata.el.empty()) {
+ hdata.badge = badgeData;
if (!host.subdue) {
api.unsupNode(hdata.id, less);
}
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoPanel.js b/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoPanel.js
index 7db17f0d..1b8c2192 100644
--- a/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoPanel.js
+++ b/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoPanel.js
@@ -32,7 +32,7 @@
panelOpts = {
width: 260
},
- sumMax = 240,
+ sumMax = 262,
padTop = 20,
devPath = 'device';
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoToolbar.js b/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoToolbar.js
index 804e2a3c..fbcdaf6d 100644
--- a/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoToolbar.js
+++ b/framework/src/onos/web/gui/src/main/webapp/app/view/topo/topoToolbar.js
@@ -167,7 +167,7 @@
// generate radio button set for overlays; start with 'none'
var rset = [{
- gid: 'topo',
+ gid: 'unknown',
tooltip: 'No Overlay',
cb: function () {
tov.tbSelection(null, switchOverlayActions);