[AETHER-1243] Adding more host icons and changing the default icon.
Changed default icon to look like server; name is still m_endstation.
New icons are:
- m_terminal (old endstation icon)
- m_tower
- m_slrCamera
- m_videoCamera
- m_cellPhone
- m_endstation1 (alternate server icon)
- m_endstation2 (alternate server icon)
Also enabled other existing icons to serve as host icons, e.g. m_microwave.
Fixed an issue with host icon being different in the detail pane.
To set the icon type, you can use the 'annotate-host' command with 'uiType' annotation, e.g.
annotate-host 00:00:00:00:00:01/None uiType videoCamera
Alternately, use netcfg to configure the 'uiType' attribute.
Change-Id: I5b7e338f3c12319da34012c5a28de8c9a48f0b15
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
index 93f41a6..1709476 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
@@ -566,7 +566,7 @@
private String glyphForHost(Annotations annot) {
String uiType = annot.value(AnnotationKeys.UI_TYPE);
- return isNullOrEmpty(uiType) ? DEFAULT_HOST_GLYPH : uiType;
+ return isNullOrEmpty(uiType) ? DEFAULT_HOST_GLYPH : "m_" + uiType;
}
// Generates a property panel model for a host details response
diff --git a/web/gui/src/main/webapp/app/fw/svg/glyphData.js b/web/gui/src/main/webapp/app/fw/svg/glyphData.js
index 9667aeb..4de1351 100644
--- a/web/gui/src/main/webapp/app/fw/svg/glyphData.js
+++ b/web/gui/src/main/webapp/app/fw/svg/glyphData.js
@@ -991,7 +991,7 @@
'c5,0,7.2,3.1,7.2,6.3s-1.6,5-3.7,7.5-2.6,4.1-2.5,6.3v1.1H47.2Z' +
'm-1,6a2.5,2.5,0,0,1,2.6-2.7A2.7,2.7,0,1,1,46.3,55.3Z',
- m_endstation: 'M75,49.5H25a1.8,1.8,0,0,1-1.8-1.8V27.1' +
+ m_terminal: 'M75,49.5H25a1.8,1.8,0,0,1-1.8-1.8V27.1' +
'A1.8,1.8,0,0,1,25,25.3H75a1.8,1.8,0,0,1,1.8,1.8V47.7' +
'A1.8,1.8,0,0,1,75,49.5ZM26.9,45.8H73.1V28.9H26.9V45.8Z' +
'M35.5,43.2H30.7a1.8,1.8,0,1,1,0-3.7h4.8A1.8,1.8,0,1,1,35.5,43.2Z' +
@@ -1016,6 +1016,15 @@
'c-6.2-4.7-9.7-10.9-9.7-17.5,0-13.8,15.1-25,33.6-25' +
'S83.6,32,83.6,45.8Z',
+ m_endstation: 'M10 10H90V35H10ZM14 14V31H86V14ZM18 18H50V27H18ZM21 21V24H47V21ZM70 18H79V27H70ZM73 21V24H76V21ZM10 40M10 40H90V65H10ZM14 44V61H86V44ZM18 48H50V57H18ZM21 51V54H47V51ZM70 48H79V57H70ZM73 51V54H76V51ZM10 70M10 70H90V95H10ZM14 74V91H86V74ZM18 78H50V87H18ZM21 81V84H47V81ZM70 78H79V87H70ZM73 81V84H76V81ZM10 100',
+ m_endstation2: 'M75 49.5H25A1.8 1.8 0 0123.2 47.7V27.1A1.8 1.8 0 0125 25.3H75A1.8 1.8 0 0176.8 27.1V47.7A1.8 1.8 0 0175 49.5ZM26.9 45.8H73.1V28.9H26.9V45.8ZM35.5 43.2H30.7A1.8 1.8 0 1130.7 39.5H35.5A1.8 1.8 0 1135.5 43.2ZM35 35H30.7A1.8 1.8 0 1130.7 31.3H35.5A1.8 1.8 0 1136 35ZM40 78H25A1.8 1.8 0 0123.2 76.2V55.6A1.8 1.8 0 0125 53.8H75A1.8 1.8 0 0176.8 55.6V76.2A1.8 1.8 0 0175 78ZM26.9 74.3H73.1V57.4H26.9V74.3ZM35.5 71.7H30.7A1.8 1.8 0 1130.7 68H35.5A1.8 1.8 0 1135.5 71.7ZM35 63.5H30.7A1.8 1.8 0 1130.7 59.8H35.5A1.8 1.8 0 1136 63.5Z',
+ m_endstation1: 'M87.5 44.5H12.5A2.7 1.8 0 019.8 42.7V22.1A2.7 1.8 0 0112.5 20.3H87.5A2.7 1.8 0 0190.2 22.1V42.7A2.7 1.8 0 0187.5 44.5ZM15.35 40.8H84.65V23.9H15.35V40.8ZM28.25 38.2H21.05A2.7 1.8 0 1121.05 34.5H28.25A2.7 1.8 0 1128.25 38.2ZM27.5 30H21.05A2.7 1.8 0 1121.05 26.3H28.25A2.7 1.8 0 1129 30ZM35 73H12.449A2.7 1.8 0 019.8 71.2V50.6A2.7 1.8 0 0112.5 48.8H87.5A2.7 1.8 0 0190.2 50.6V71.2A2.7 1.8 0 0187.5 73ZM15.35 69.3H84.65V52.4H15.35V69.3ZM28.25 66.7H21.05A2.7 1.8 0 1121.05 63H28.25A2.7 1.8 0 1128.25 66.7ZM27.5 58.5H21.05A2.7 1.8 0 1121.05 54.8H28.25A2.7 1.8 0 1129 58.5Z',
+
+ m_tower: 'M26 97.5L52 39L78 97.5H68.9L52 58.5L35.1 97.5ZM68.9 45.5A1.3 1.3 90 0035.1 45.5H39A1.3 1.3 90 0165 45.5ZM74.1 45.5L78 45.5A1.3 1.3 90 0026 45.5H29.9A1.3 1.3 90 0174.1 45.5L78 45.5ZM85.8 45.5A1.3 1.3 90 0016.9 45.5H20.8A1.3 1.3 90 0181.9 45.5ZM40 90L64 90L65 93H39ZM44 81H60L61 84H43ZM48 72H56L57 75H47Z',
+ m_slrCamera: 'M70 48A1 1 0 0030 48A1 1 0 0070 48M34 48A1 1 0 0166 48A1 1 0 0134 48M15 30A5 5 0 0120 25H30A5 5 0 0035 20A6 6 0 0140 15H60A6 6 0 0165 20A5 5 0 0070 25H80A5 5 0 0185 30V70A5 5 0 0180 75H20A5 5 0 0115 70V30M19 30V70L20 71H80L81 70V30L80 29H70A10 10 0 0160 20L60 20H40L40 20A10 10 0 0130 29H20ZM28 36A1 1 0 0023 36A1 1 0 0028 36',
+ m_videoCamera: 'M30 25A5 5 0 0135 20H80A5 5 0 0185 25V50A5 5 0 0180 55H35A5 5 0 0130 50ZM35 25V25V50H80V25ZM30 30L10 25V50L30 45V40L14 44V31L30 35M47 33A1 1 0 0040 33A1 1 0 0047 33M60 55V70A5 5 0 0065 75H90V70H65V55ZM55 55C55 58 57 60 60 60H60V55ZM65 60C68 60 70 58 70 55H65Z',
+ m_cellPhone: 'M20 15A5 5 0 0125 10H55A5 5 0 0160 15V80A5 5 0 0155 85H25A5 5 0 0120 80ZM24 15V80L25 81H55L56 80V15L55 14H25ZM35 16H45V18H35ZM43 77A1 1 0 0037 77A1 1 0 0043 77M26 20L54 20V73H26V73ZM28 22V71H52V22ZM65 35C73 42 73 53 65 60L65 55C69 51 69 44 65 40ZM65 30V25C83 40 83 55 65 70V65C78 53 78 42 65 30M65 20V15C95 30 95 65 65 80V75C89 60 89 35 65 20',
+
m_otn: m_otn_base,
m_roadm_otn: m_otn_base + m_octagon,
diff --git a/web/gui/src/main/webapp/app/view/topo/topoD3.js b/web/gui/src/main/webapp/app/view/topo/topoD3.js
index d89efd7..d969bb7 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoD3.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoD3.js
@@ -88,11 +88,11 @@
};
function mapDeviceTypeToGlyph(type) {
- return remappedDeviceTypes[type] || type || 'unknown';
+ return remappedDeviceTypes[type] || ('m_' + type) || 'unknown';
}
function mapHostTypeToGlyph(type) {
- return remappedHostTypes[type] || type || 'unknown';
+ return remappedHostTypes[type] || ('m_' + type) || 'unknown';
}
function badgeStatus(badge) {