Topo2: Reset node position and unpin
Refactored NodeModel
Added class to the surrounding rect for selected class
Renamed Panels to avoid conflict with classic topo
Topo2: Details Panel for single device selection
Topo2: Added Equalize Masters keyboard shortcut
Topo2: Toggle Link Port highlighting
Topo2: Node Labels was returning empty string
if friendly name was null
Topo2: Reset map zoom and panning
Change-Id: I0a949b2f8205e1abcfcac5aaec65c18d76e77cff
diff --git a/web/gui/src/main/webapp/app/view/topo2/topo2Device.js b/web/gui/src/main/webapp/app/view/topo2/topo2Device.js
index 12b0a13..0d0d691 100644
--- a/web/gui/src/main/webapp/app/view/topo2/topo2Device.js
+++ b/web/gui/src/main/webapp/app/view/topo2/topo2Device.js
@@ -34,10 +34,10 @@
var DeviceCollection = Collection.extend({
model: Model,
comparator: function (a, b) {
- var order = region.get('layerOrder'),
- aLayer = a.get('layer'),
- bLayer = b.get('layer');
- return order.indexOf(aLayer - order.indexOf(bLayer));
+ // var order = region.get('layerOrder'),
+ // aLayer = a.get('id'),
+ // bLayer = b.get('layer');
+ // return order.indexOf(aLayer - order.indexOf(bLayer));
}
});
@@ -54,11 +54,10 @@
return deviceCollection;
}
-
angular.module('ovTopo2')
.factory('Topo2DeviceService',
- ['Topo2Collection', 'Topo2NodeModel',
- function (_c_, _nm_) {
+ ['Topo2Collection', 'Topo2NodeModel', 'Topo2DeviceDetailsPanel',
+ function (_c_, _nm_, detailsPanel) {
Collection = _c_;
@@ -67,11 +66,27 @@
this.super = this.constructor.__super__;
this.super.initialize.apply(this, arguments);
},
+ events: {
+ 'click': 'onClick'
+ },
nodeType: 'device',
icon: function () {
var type = this.get('type');
return remappedDeviceTypes[type] || type || 'unknown';
},
+ onClick: function () {
+
+ if (this.get('selected')) {
+ this.set('selected', false);
+ detailsPanel.hide();
+ } else {
+ this.set('selected', true);
+ detailsPanel.updateDetails(this.get('id'), this.get('nodeType'));
+ detailsPanel.show();
+ }
+
+ this.el.attr('class', this.svgClassName());
+ },
onExit: function () {
var node = this.el;
node.select('use')