Revert "GUI: Added ESLint to gulp tasks GUI: Linted files Fixed an error in the build script"
This reverts commit 46c5f1087d76d93497a1e8e5593564991ccb6682.
Change-Id: I1464fdd1df075e93f885e3c1fbd02f0cc563fd4f
diff --git a/web/gui/src/main/webapp/app/view/topo/topo.js b/web/gui/src/main/webapp/app/view/topo/topo.js
index e495cb4..29f149f 100644
--- a/web/gui/src/main/webapp/app/view/topo/topo.js
+++ b/web/gui/src/main/webapp/app/view/topo/topo.js
@@ -25,13 +25,13 @@
'ngCookies',
'onosUtil',
'onosSvg',
- 'onosRemote',
+ 'onosRemote'
];
// references to injected services
- var $scope, $log, $loc, $timeout,
+ var $scope, $log, $loc, $timeout, $cookies,
fs, ks, zs, gs, ms, sus, flash, wss, ps, th, tds, t3s, tes, tfs, tps,
- tis, tms, tss, tls, tos, fltr, ttbs, tspr, tov;
+ tis, tms, tss, tls, tts, tos, fltr, ttbs, tspr, ttip, tov;
// DOM elements
var ovtopo, svg, defs, zoomLayer, mapG, spriteG, forceG, noDevsLayer;
@@ -68,7 +68,7 @@
E: [equalizeMasters, 'Equalize mastership roles'],
- // -- instance color palette debug
+ //-- instance color palette debug
// 9: function () { sus.cat7().testCard(svg); },
// topology overlay selections
@@ -83,10 +83,10 @@
_keyListener: ttbs.keyListener,
_helpFormat: [
- ['I', 'O', 'D', 'H', 'M', 'P', 'dash', 'B', 'G', 'S'],
+ ['I', 'O', 'D', 'H', 'M', 'P', 'dash', 'B', 'G', 'S' ],
['X', 'Z', 'N', 'L', 'shift-L', 'U', 'R', '-', 'E', '-', 'dot'],
- [], // this column reserved for overlay actions
- ],
+ [] // this column reserved for overlay actions
+ ]
};
if (fs.isO(overlayKeys)) {
@@ -100,7 +100,7 @@
['shift-click', 'Toggle selection state'],
['drag', 'Reposition (and pin) device / host'],
['cmd-scroll', 'Zoom in / out'],
- ['cmd-drag', 'Pan'],
+ ['cmd-drag', 'Pan']
]);
}
@@ -183,7 +183,7 @@
function handleEscape() {
if (tis.showMaster()) {
// if an instance is selected, cancel the affinity mapping
- tis.cancelAffinity();
+ tis.cancelAffinity()
} else if (tov.hooks.escape()) {
// else if the overlay consumed the ESC event...
@@ -234,7 +234,7 @@
function setUpToolbar() {
ttbs.init({
getActionEntry: getActionEntry,
- setUpKeys: setUpKeys,
+ setUpKeys: setUpKeys
});
ttbs.createToolbar();
}
@@ -259,7 +259,7 @@
var sc = zoomer.scale(),
tr = zoomer.translate();
- ps.setPrefs('topo_zoom', { tx: tr[0], ty: tr[1], sc: sc });
+ ps.setPrefs('topo_zoom', {tx:tr[0], ty:tr[1], sc:sc});
// keep the map lines constant width while zooming
mapG.style('stroke-width', (2.0 / sc) + 'px');
@@ -273,7 +273,7 @@
svg: svg,
zoomLayer: zoomLayer,
zoomEnabled: zoomEnabled,
- zoomCallback: zoomCallback,
+ zoomCallback: zoomCallback
});
}
@@ -289,7 +289,7 @@
var g, box;
noDevsLayer = svg.append('g').attr({
id: 'topo-noDevsLayer',
- transform: sus.translate(500, 500),
+ transform: sus.translate(500,500)
});
// Note, SVG viewbox is '0 0 1000 1000', defined in topo.html.
// We are translating this layer to have its origin at the center
@@ -297,7 +297,7 @@
g = noDevsLayer.append('g');
gs.addGlyph(g, 'bird', 100).attr('class', 'noDevsBird');
g.append('text').text('No devices are connected')
- .attr({ x: 120, y: 80 });
+ .attr({ x: 120, y: 80});
box = g.node().getBBox();
box.x -= box.width/2;
@@ -348,7 +348,7 @@
australia: function (c) {
return c.properties.adm0_a3 === 'AUS';
- },
+ }
};
var tintOn = 0,
@@ -357,19 +357,19 @@
light: {
sea: 'aliceblue',
land: 'white',
- outline: '#ddd',
+ outline: '#ddd'
},
dark: {
sea: '#001830',
land: '#232331',
- outline: '#3a3a3a',
- },
+ outline: '#3a3a3a'
+ }
};
function shading() {
return tintOn ? {
palette: shadePalette[th.theme()],
- flip: shadeFlip,
+ flip: shadeFlip
} : '';
}
@@ -386,7 +386,7 @@
mapid: 'usa',
mapscale: 1,
mapfilepath: '*continental_us',
- tint: 'off',
+ tint: 'off'
},
$loc.search()
);
@@ -410,7 +410,7 @@
if (mapG.empty()) {
mapG = zoomLayer.append('g').attr('id', 'topo-map');
} else {
- mapG.each(function (d, i) {
+ mapG.each(function(d,i) {
d3.selectAll(this.childNodes).remove();
});
}
@@ -422,13 +422,13 @@
promise = ms.loadMapRegionInto(mapG, {
countryFilter: cfilter,
adjustScale: mapScale,
- shading: shading(),
+ shading: shading()
});
} else {
promise = ms.loadMapInto(mapG, mapFilePath, mapId, {
adjustScale: mapScale,
- shading: shading(),
+ shading: shading()
});
}
@@ -437,7 +437,7 @@
}
function mapReshader() {
- $log.debug('... Re-shading map ...');
+ $log.debug('... Re-shading map ...')
ms.reshade(shading());
}
@@ -460,7 +460,7 @@
var prefs = ps.getPrefs('topo_sprites', { sprites: '' }, $loc.search()),
sprId = prefs.sprites;
- spriteG = zoomLayer.append('g').attr('id', 'topo-sprites');
+ spriteG = zoomLayer.append ('g').attr('id', 'topo-sprites');
if (sprId) {
ps.setPrefs('topo_sprites', prefs);
tspr.loadSprites(spriteG, defs, sprId);
@@ -536,21 +536,21 @@
angular.module('ovTopo', moduleDependencies)
.controller('OvTopoCtrl', ['$scope', '$log', '$location', '$timeout',
- 'FnService', 'MastService', 'KeyService', 'ZoomService',
+ '$cookies', 'FnService', 'MastService', 'KeyService', 'ZoomService',
'GlyphService', 'MapService', 'SvgUtilService', 'FlashService',
'WebSocketService', 'PrefsService', 'ThemeService',
'TopoDialogService', 'TopoD3Service',
'TopoEventService', 'TopoForceService', 'TopoPanelService',
'TopoInstService', 'TopoSelectService', 'TopoLinkService',
- 'TopoObliqueService', 'TopoFilterService',
+ 'TopoTrafficService', 'TopoObliqueService', 'TopoFilterService',
'TopoToolbarService', 'TopoMapService', 'TopoSpriteService',
- 'TopoOverlayService',
+ 'TooltipService', 'TopoOverlayService',
- function (_$scope_, _$log_, _$loc_, _$timeout_, _fs_, mast, _ks_,
+ function (_$scope_, _$log_, _$loc_, _$timeout_, _$cookies_, _fs_, mast, _ks_,
_zs_, _gs_, _ms_, _sus_, _flash_, _wss_, _ps_, _th_,
_tds_, _t3s_, _tes_,
- _tfs_, _tps_, _tis_, _tss_, _tls_, _tos_, _fltr_,
- _ttbs_, _tms_, _tspr_, _tov_) {
+ _tfs_, _tps_, _tis_, _tss_, _tls_, _tts_, _tos_, _fltr_,
+ _ttbs_, _tms_, _tspr_, _ttip_, _tov_) {
var params = _$loc_.search(),
selOverlay = params.overlayId,
@@ -563,13 +563,14 @@
zoomLayer: function () { return zoomLayer; },
zoomer: function () { return zoomer; },
opacifyMap: opacifyMap,
- topoStartDone: topoStartDone,
+ topoStartDone: topoStartDone
};
$scope = _$scope_;
$log = _$log_;
$loc = _$loc_;
$timeout = _$timeout_;
+ $cookies = _$cookies_;
fs = _fs_;
ks = _ks_;
zs = _zs_;
@@ -590,18 +591,20 @@
tps = _tps_;
tis = _tis_;
tms = _tms_;
+ tss = _tss_;
tls = _tls_;
+ tts = _tts_;
tos = _tos_;
fltr = _fltr_;
ttbs = _ttbs_;
tspr = _tspr_;
+ ttip = _ttip_;
tov = _tov_;
- tss = _tss_;
tms.start({
toggleMap: toggleMap,
currentMap: currentMap,
- setMap: setMap,
+ setMap: setMap
});
// pull intent data from the query string...
@@ -610,7 +613,7 @@
key: params.key,
appId: params.appId,
appName: params.appName,
- intentType: params.intentType,
+ intentType: params.intentType
};
}
@@ -646,7 +649,7 @@
setUpNoDevs();
setUpMap().then(
function (proj) {
- var z = ps.getPrefs('topo_zoom', { tx: 0, ty: 0, sc: 1 });
+ var z = ps.getPrefs('topo_zoom', { tx:0, ty:0, sc:1 });
zoomer.panZoom([z.tx, z.ty], z.sc);
$log.debug('** Zoom restored:', z);
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 c5c3b1f..3d232ee 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoD3.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoD3.js
@@ -23,7 +23,7 @@
'use strict';
// injected refs
- var sus, is, ts, ps, ttbs;
+ var $log, fs, sus, is, ts, ps, ttbs;
// api to topoForce
var zoomer, api;
@@ -46,7 +46,7 @@
badgeConfig = {
radius: 12,
yoff: 5,
- gdelta: 10,
+ gdelta: 10
},
halfDevIcon = devIconDim / 2,
devBadgeOff = { dx: -halfDevIcon, dy: -halfDevIcon },
@@ -55,7 +55,7 @@
status = {
i: 'badgeInfo',
w: 'badgeWarn',
- e: 'badgeError',
+ e: 'badgeError'
};
// NOTE: this type of hack should go away once we have implemented
@@ -77,7 +77,7 @@
var remappedHostTypes = {
router: 'm_router',
endstation: 'm_endstation',
- bgpSpeaker: 'm_bgpSpeaker',
+ bgpSpeaker: 'm_bgpSpeaker'
};
function mapDeviceTypeToGlyph(type) {
@@ -100,13 +100,13 @@
var dColTheme = {
light: {
online: '#444444',
- offline: '#cccccc',
+ offline: '#cccccc'
},
dark: {
// TODO: theme
online: '#444444',
- offline: '#cccccc',
- },
+ offline: '#cccccc'
+ }
};
function devGlyphColor(d) {
@@ -119,13 +119,13 @@
function setDeviceColor(d) {
// want to color the square rectangle (no longer the 'use' glyph)
- d.el.selectAll('rect').filter(function (d, i) { return i === 1; })
+ d.el.selectAll('rect').filter(function (d, i) {return i === 1;})
.style('fill', devGlyphColor(d));
}
function incDevLabIndex() {
setDevLabIndex(deviceLabelIndex+1);
- switch (deviceLabelIndex) {
+ switch(deviceLabelIndex) {
case 0: return 'Hide device labels';
case 1: return 'Show friendly device labels';
case 2: return 'Show device ID labels';
@@ -141,7 +141,7 @@
function incHostLabIndex() {
setHostLabIndex(hostLabelIndex+1);
- switch (hostLabelIndex) {
+ switch(hostLabelIndex) {
case 0: return 'Show friendly host labels';
case 1: return 'Show host IP Addresses';
case 2: return 'Show host MAC Addresses';
@@ -180,8 +180,8 @@
x: -dim/2,
y: -dim/2,
width: dim + labelWidth,
- height: dim,
- };
+ height: dim
+ }
}
function updateDeviceRendering(d) {
@@ -239,7 +239,7 @@
width: bcgd * 2,
height: bcgd * 2,
transform: sus.translate(-bcgd, -bcgd),
- 'xlink:href': '#' + bdg.gid,
+ 'xlink:href': '#' + bdg.gid
});
}
}
@@ -279,14 +279,14 @@
var node = d3.select(this),
glyphId = mapDeviceTypeToGlyph(d.type),
label = trimLabel(deviceLabel(d)),
- rect, crect, glyph, labelWidth;
+ rect, crect, text, glyph, labelWidth;
d.el = node;
rect = node.append('rect');
crect = node.append('rect');
- node.append('text').text(label)
+ text = node.append('text').text(label)
.attr('text-anchor', 'left')
.attr('y', '0.3em')
.attr('x', halfDevIcon + labelPad);
@@ -462,13 +462,13 @@
});
if (idx === -1) {
- labels.push({ id: newId, x: newX, y: newY });
+ labels.push({id: newId, x: newX, y: newY});
} else {
- labels[idx] = { id: newId, x: newX, y: newY };
+ labels[idx] = {id: newId, x: newX, y: newY};
}
- return { x: newX, y: newY };
- };
+ return {x: newX, y: newY};
+ }
}
var getLabelPos = generateLabelFunction();
@@ -518,7 +518,7 @@
return {
x: movedX,
- y: movedY,
+ y: movedY
};
}
@@ -545,7 +545,7 @@
x2: mid.x + moveAmtX,
y2: mid.y + moveAmtY,
stroke: api.linkConfig()[ts.theme()].baseColor,
- transform: 'rotate(' + angle + ',' + mid.x + ',' + mid.y + ')',
+ transform: 'rotate(' + angle + ',' + mid.x + ',' + mid.y + ')'
};
}
@@ -554,7 +554,7 @@
dist = 20;
return {
x: point.x + dist,
- y: point.y + dist,
+ y: point.y + dist
};
}
@@ -568,7 +568,7 @@
var el = d3.select(this);
el.attr({
- transform: function (d) { return calcGroupPos(d.linkCoords); },
+ transform: function (d) { return calcGroupPos(d.linkCoords); }
});
el.select('line')
.attr(hashAttrs(d.linkCoords));
@@ -583,7 +583,7 @@
.append('g')
.attr({
transform: function (d) { return calcGroupPos(d.linkCoords); },
- id: function (d) { return 'pair-' + d.id; },
+ id: function (d) { return 'pair-' + d.id; }
})
.classed('numLinkLabel', true);
@@ -608,10 +608,12 @@
angular.module('ovTopo')
.factory('TopoD3Service',
- ['SvgUtilService', 'IconService', 'ThemeService',
+ ['$log', 'FnService', 'SvgUtilService', 'IconService', 'ThemeService',
'PrefsService', 'TopoToolbarService',
- function (_sus_, _is_, _ts_, _ps_, _ttbs_) {
+ function (_$log_, _fs_, _sus_, _is_, _ts_, _ps_, _ttbs_) {
+ $log = _$log_;
+ fs = _fs_;
sus = _sus_;
is = _is_;
ts = _ts_;
@@ -652,7 +654,7 @@
applyLinkLabels: applyLinkLabels,
transformLabel: transformLabel,
applyPortLabels: applyPortLabels,
- applyNumLinkLabels: applyNumLinkLabels,
+ applyNumLinkLabels: applyNumLinkLabels
};
}]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoDialog.js b/web/gui/src/main/webapp/app/view/topo/topoDialog.js
index 18c83e9..425dad0 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoDialog.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoDialog.js
@@ -25,7 +25,7 @@
// constants
var idDialog = 'topo-p-dialog',
opts = {
- cssCls: 'topo-p',
+ cssCls: 'topo-p'
};
// ==========================
@@ -38,7 +38,7 @@
return {
openDialog: function () { return ds.openDialog(idDialog, opts); },
closeDialog: ds.closeDialog,
- createDiv: ds.createDiv,
+ createDiv: ds.createDiv
};
}]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoEvent.js b/web/gui/src/main/webapp/app/view/topo/topoEvent.js
index 01b2891..2a93895 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoEvent.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoEvent.js
@@ -27,7 +27,7 @@
'use strict';
// injected refs
- var $log, wss, tps, tis, tfs, tss, tov, tspr;
+ var $log, $interval, wss, tps, tis, tfs, tss, tov, tspr;
// internal state
var handlerMap,
@@ -61,7 +61,7 @@
topoStartDone: tfs,
spriteListResponse: tspr,
- spriteDataResponse: tspr,
+ spriteDataResponse: tspr
};
}
@@ -74,13 +74,14 @@
angular.module('ovTopo')
.factory('TopoEventService',
- ['$log', 'WebSocketService',
+ ['$log', '$interval', 'WebSocketService',
'TopoPanelService', 'TopoInstService', 'TopoForceService',
'TopoSelectService', 'TopoOverlayService', 'TopoSpriteService',
- function (_$log_, _wss_,
+ function (_$log_, _$interval_, _wss_,
_tps_, _tis_, _tfs_, _tss_, _tov_, _tspr_) {
$log = _$log_;
+ $interval = _$interval_;
wss = _wss_;
tps = _tps_;
tis = _tis_;
@@ -114,7 +115,7 @@
return {
bindHandlers: bindHandlers,
start: start,
- stop: stop,
+ stop: stop
};
}]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoFilter.js b/web/gui/src/main/webapp/app/view/topo/topoFilter.js
index db5b3c3..b877fce 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoFilter.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoFilter.js
@@ -24,7 +24,7 @@
'use strict';
// injected refs
- var flash;
+ var $log, fs, flash, tps, tts;
// api to topoForce
var api;
@@ -39,40 +39,40 @@
var layerLookup = {
host: {
endstation: 'pkt', // default, if host event does not define type
- router: 'pkt',
- bgpSpeaker: 'pkt',
+ router: 'pkt',
+ bgpSpeaker: 'pkt'
},
device: {
switch: 'pkt',
router: 'pkt',
roadm: 'opt',
- otn: 'opt',
+ otn: 'opt'
},
link: {
hostLink: 'pkt',
direct: 'pkt',
indirect: '',
tunnel: '',
- optical: 'opt',
- },
+ optical: 'opt'
+ }
},
// order of layer cycling in button
dispatch = [
{
type: 'all',
action: function () { suppressLayers(false); },
- msg: 'All Layers Shown',
+ msg: 'All Layers Shown'
},
{
type: 'pkt',
action: function () { showLayer('pkt'); },
- msg: 'Packet Layer Shown',
+ msg: 'Packet Layer Shown'
},
{
type: 'opt',
action: function () { showLayer('opt'); },
- msg: 'Optical Layer Shown',
- },
+ msg: 'Optical Layer Shown'
+ }
],
layer = 0;
@@ -123,9 +123,18 @@
// === MODULE DEFINITION ===
angular.module('ovTopo')
- .factory('TopoFilterService', ['FlashService',
- function (_flash_) {
+ .factory('TopoFilterService',
+ ['$log', 'FnService',
+ 'FlashService',
+ 'TopoPanelService',
+ 'TopoTrafficService',
+
+ function (_$log_, _fs_, _flash_, _tps_, _tts_) {
+ $log = _$log_;
+ fs = _fs_;
flash = _flash_;
+ tps = _tps_;
+ tts = _tts_;
function initFilter(_api_) {
api = _api_;
@@ -136,8 +145,7 @@
clickAction: clickAction,
selected: selected,
- inLayer: inLayer,
+ inLayer: inLayer
};
- },
- ]);
+ }]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoForce.js b/web/gui/src/main/webapp/app/view/topo/topoForce.js
index c149f7b..f38fa56 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoForce.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoForce.js
@@ -31,42 +31,42 @@
light: {
baseColor: '#939598',
inColor: '#66f',
- outColor: '#f00',
+ outColor: '#f00'
},
dark: {
// TODO : theme
baseColor: '#939598',
inColor: '#66f',
- outColor: '#f00',
+ outColor: '#f00'
},
inWidth: 12,
- outWidth: 10,
+ outWidth: 10
};
// internal state
- var settings, // merged default settings and options
- force, // force layout object
- drag, // drag behavior handler
+ var settings, // merged default settings and options
+ force, // force layout object
+ drag, // drag behavior handler
network = {
nodes: [],
links: [],
linksByDevice: {},
lookup: {},
- revLinkToKey: {},
+ revLinkToKey: {}
},
- lu, // shorthand for lookup
- rlk, // shorthand for revLinktoKey
- showHosts = false, // whether hosts are displayed
- showOffline = true, // whether offline devices are displayed
- nodeLock = false, // whether nodes can be dragged or not (locked)
- fTimer, // timer for delayed force layout
- fNodesTimer, // timer for delayed nodes update
- fLinksTimer, // timer for delayed links update
- dim, // the dimensions of the force layout [w,h]
- linkNums = [], // array of link number labels
- devIconDim = 36, // node target dimension
- devIconDimMin = 20, // node minimum dimension when zoomed out
- devIconDimMax = 40, // node maximum dimension when zoomed in
+ lu, // shorthand for lookup
+ rlk, // shorthand for revLinktoKey
+ showHosts = false, // whether hosts are displayed
+ showOffline = true, // whether offline devices are displayed
+ nodeLock = false, // whether nodes can be dragged or not (locked)
+ fTimer, // timer for delayed force layout
+ fNodesTimer, // timer for delayed nodes update
+ fLinksTimer, // timer for delayed links update
+ dim, // the dimensions of the force layout [w,h]
+ linkNums = [], // array of link number labels
+ devIconDim = 36, // node target dimension
+ devIconDimMin = 20, // node minimum dimension when zoomed out
+ devIconDimMax = 40, // node maximum dimension when zoomed in
portLabelDim = 30;
// SVG elements;
@@ -83,23 +83,23 @@
// note: key is node.class
device: -8000,
host: -5000,
- _def_: -12000,
+ _def_: -12000
},
linkDistance: {
// note: key is link.type
direct: 100,
optical: 120,
hostLink: 3,
- _def_: 50,
+ _def_: 50
},
linkStrength: {
// note: key is link.type
// range: {0.0 ... 1.0}
- // direct: 1.0,
- // optical: 1.0,
- // hostLink: 1.0,
- _def_: 1.0,
- },
+ //direct: 1.0,
+ //optical: 1.0,
+ //hostLink: 1.0,
+ _def_: 1.0
+ }
};
@@ -171,7 +171,7 @@
lnk = tms.createHostLink(data);
if (lnk) {
- d.linkData = lnk; // cache ref on its host
+ d.linkData = lnk; // cache ref on its host
network.links.push(lnk);
lu[d.ingress] = lnk;
lu[d.egress] = lnk;
@@ -308,7 +308,7 @@
network.linksByDevice[found].push(ldata);
ldata.devicePair = found;
} else {
- network.linksByDevice[key] = [ldata];
+ network.linksByDevice[key] = [ ldata ];
ldata.devicePair = key;
}
}
@@ -318,7 +318,7 @@
ldata.fromTarget = link;
rlk[link.id] = ldata.key;
// possible solution to el being undefined in restyleLinkElement:
- // _updateLinks();
+ //_updateLinks();
restyleLinkElement(ldata);
}
@@ -468,15 +468,15 @@
y: d.y,
equivLoc: {
lng: ll[0],
- lat: ll[1],
- },
+ lat: ll[1]
+ }
};
}
d.metaUi = metaUi;
wss.sendEvent('updateMeta', {
id: d.id,
class: d.class,
- memento: metaUi,
+ memento: metaUi
});
}
@@ -557,7 +557,7 @@
}
function supAmt(less) {
- return less ? 'suppressed' : 'suppressedmax';
+ return less ? "suppressed" : "suppressedmax";
}
function suppressLayers(b, less) {
@@ -665,6 +665,8 @@
// IMPLEMENTATION NOTE: _updateNodes() should NOT stop, start, or resume
// the force layout; that needs to be determined and implemented elsewhere
function _updateNodes() {
+
+ var scale = uplink.zoomer().scale();
// select all the nodes in the layout:
node = nodeG.selectAll('.node')
.data(network.nodes, function (d) { return d.id; });
@@ -683,7 +685,7 @@
// Need to guard against NaN here ??
return sus.translate(d.x, d.y);
},
- opacity: 0,
+ opacity: 0
})
.call(drag)
.on('mouseover', tss.nodeMouseOver)
@@ -719,7 +721,7 @@
x1: link.source.x,
y1: link.source.y,
x2: link.target.x,
- y2: link.target.y,
+ y2: link.target.y
};
}
@@ -740,7 +742,7 @@
x1: pos.x1 + (mult * dy / length),
y1: pos.y1 + (mult * -dx / length),
x2: pos.x2 + (mult * dy / length),
- y2: pos.y2 + (mult * -dx / length),
+ y2: pos.y2 + (mult * -dx / length)
};
}
@@ -783,7 +785,7 @@
linkNums.push({
id: key,
num: numLinks,
- linkCoords: linkArr[0].position,
+ linkCoords: linkArr[0].position
});
} else {
linkSrcId = null;
@@ -832,14 +834,14 @@
x2: function (d) { return d.position.x2; },
y2: function (d) { return d.position.y2; },
stroke: linkConfig[th].inColor,
- 'stroke-width': linkConfig.inWidth,
+ 'stroke-width': linkConfig.inWidth
});
// augment links
entering.each(td3.linkEntering);
// operate on both existing and new links:
- // link.each(...)
+ //link.each(...)
// add labels for how many links are in a thick line
td3.applyNumLinkLabels(linkNums, numLinkLblsG);
@@ -856,7 +858,7 @@
.duration(1500)
.attr({
'stroke-dasharray': '3 12',
- 'stroke-width': linkConfig.outWidth,
+ 'stroke-width': linkConfig.outWidth
})
.style('opacity', 0.0)
.remove();
@@ -878,7 +880,7 @@
$timeout.cancel(fTimer);
}
fTimer = $timeout(function () {
- $log.debug('Starting force-layout');
+ $log.debug("Starting force-layout");
force.start();
}, 200);
}
@@ -890,13 +892,13 @@
var dx = isNaN(d.x) ? 0 : d.x,
dy = isNaN(d.y) ? 0 : d.y;
return sus.translate(dx, dy);
- },
+ }
},
linkAttr: {
x1: function (d) { return d.position.x1; },
y1: function (d) { return d.position.y1; },
x2: function (d) { return d.position.x2; },
- y2: function (d) { return d.position.y2; },
+ y2: function (d) { return d.position.y2; }
},
linkLabelAttr: {
transform: function (d) {
@@ -904,8 +906,8 @@
if (lnk) {
return td3.transformLabel(lnk.position, d.key);
}
- },
- },
+ }
+ }
};
function tick() {
@@ -989,7 +991,7 @@
id: 'lab-' + d.key,
key: d.key,
label: d.label,
- ldata: d,
+ ldata: d
});
}
});
@@ -1006,7 +1008,7 @@
projection: uplink.projection,
network: network,
restyleLinkElement: restyleLinkElement,
- removeLinkElement: removeLinkElement,
+ removeLinkElement: removeLinkElement
};
}
@@ -1022,7 +1024,7 @@
updateLinkLabelModel: updateLinkLabelModel,
linkConfig: function () { return linkConfig; },
deviceScale: deviceScale,
- linkWidthScale: linkWidthScale,
+ linkWidthScale: linkWidthScale
};
}
@@ -1031,7 +1033,7 @@
node: function () { return node; },
zoomingOrPanning: zoomingOrPanning,
updateDeviceColors: td3.updateDeviceColors,
- deselectAllLinks: tls.deselectAllLinks,
+ deselectAllLinks: tls.deselectAllLinks
};
}
@@ -1039,7 +1041,7 @@
return {
hovered: tss.hovered,
somethingSelected: tss.somethingSelected,
- selectOrder: tss.selectOrder,
+ selectOrder: tss.selectOrder
};
}
@@ -1055,15 +1057,15 @@
updateNodes: updateNodes,
supLayers: suppressLayers,
unsupNode: unsuppressNode,
- unsupLink: unsuppressLink,
+ unsupLink: unsuppressLink
};
}
function mkObliqueApi(uplink, fltr) {
return {
- force: function () { return force; },
+ force: function() { return force; },
zoomLayer: uplink.zoomLayer,
- nodeGBBox: function () { return nodeG.node().getBBox(); },
+ nodeGBBox: function() { return nodeG.node().getBBox(); },
node: function () { return node; },
link: function () { return link; },
linkLabel: function () { return linkLabel; },
@@ -1079,14 +1081,14 @@
calcLinkPos: calcPosition,
applyNumLinkLabels: function () {
td3.applyNumLinkLabels(linkNums, numLinkLblsG);
- },
+ }
};
}
function mkFilterApi() {
return {
node: function () { return node; },
- link: function () { return link; },
+ link: function () { return link; }
};
}
@@ -1096,7 +1098,7 @@
zoomer: uplink.zoomer(),
network: network,
portLabelG: function () { return portLabelG; },
- showHosts: function () { return showHosts; },
+ showHosts: function () { return showHosts; }
};
}
@@ -1262,7 +1264,7 @@
addLink: addLink,
updateLink: updateLink,
removeLink: removeLink,
- topoStartDone: topoStartDone,
+ topoStartDone: topoStartDone
};
}]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoInst.js b/web/gui/src/main/webapp/app/view/topo/topoInst.js
index 7a51b2b..4146407 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoInst.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoInst.js
@@ -36,7 +36,7 @@
idIns = 'topo-p-instance',
instOpts = {
edge: 'left',
- width: 20,
+ width: 20
};
// internal state
@@ -141,24 +141,24 @@
instSvg = {
width: 170,
height: 85,
- viewBox: '0 0 170 85',
+ viewBox: '0 0 170 85'
},
headRect = {
x: rox,
y: roy,
width: rw,
- height: rhh,
+ height: rhh
},
bodyRect = {
x: rox,
y: roy + rhh,
width: rw,
- height: rbh,
+ height: rbh
},
titleAttr = {
class: 'instTitle',
x: tx,
- y: 27,
+ y: 27
};
var onoses = oiBox.el().selectAll('.onosInst')
@@ -225,7 +225,7 @@
svg.append('text').attr({
class: 'instLabel ' + id,
x: tx,
- y: ty,
+ y: ty
}).text(label);
ty += 18;
}
@@ -342,7 +342,7 @@
show: showInsts,
hide: hideInsts,
toggle: toggleInsts,
- showMaster: function () { return oiShowMaster; },
+ showMaster: function () { return oiShowMaster; }
};
}]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoLink.js b/web/gui/src/main/webapp/app/view/topo/topoLink.js
index 2bccbe4..a7b5bc7 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoLink.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoLink.js
@@ -23,15 +23,15 @@
'use strict';
// injected refs
- var $log, fs, flash, tss, tps, tov;
+ var $log, fs, sus, ts, flash, tss, tps, tov;
// internal state
var api,
td3,
network,
- showPorts = true, // enable port highlighting by default
- enhancedLink = null, // the link over which the mouse is hovering
- selectedLinks = {}; // the links which are already selected
+ showPorts = true, // enable port highlighting by default
+ enhancedLink = null, // the link over which the mouse is hovering
+ selectedLinks = {}; // the links which are already selected
// SVG elements;
var svg;
@@ -45,7 +45,7 @@
tr = api.zoomer.translate(),
mx = (m[0] - tr[0]) / sc,
my = (m[1] - tr[1]) / sc;
- return { x: mx, y: my };
+ return {x: mx, y: my};
}
@@ -74,7 +74,7 @@
return; // skip hidden hosts
}
- dist = mdist({ x: d.x, y: d.y }, mouse);
+ dist = mdist({x: d.x, y: d.y}, mouse);
if (dist < minDist && dist < proximity) {
minDist = dist;
nearest = d;
@@ -101,7 +101,7 @@
(sq(y2-y1) + sq(x2-x1)),
x4 = x3 - k * (y2-y1),
y4 = y3 + k * (x2-x1);
- return { x: x4, y: y4 };
+ return {x:x4, y:y4};
}
function lineHit(line, p, m) {
@@ -179,7 +179,7 @@
point = locatePortLabel(d);
angular.extend(point, {
id: 'topo-port-tgt',
- num: d.tgtPort,
+ num: d.tgtPort
});
data.push(point);
@@ -187,7 +187,7 @@
point = locatePortLabel(d, 1);
angular.extend(point, {
id: 'topo-port-src',
- num: d.srcPort,
+ num: d.srcPort
});
data.push(point);
}
@@ -209,7 +209,7 @@
dy = farY - nearY,
k = offset / dist(dx, dy);
- return { x: k * dx + nearX, y: k * dy + nearY };
+ return {x: k * dx + nearX, y: k * dy + nearY};
}
function selectLink(ldata) {
@@ -248,7 +248,7 @@
if (!d.el) return;
d.el.classed('selected', true);
- selectedLinks[d.key] = { key: d };
+ selectedLinks[d.key] = {key : d};
tps.displayLink(d, tov.hooks.modifyLinkData);
tps.displaySomething();
@@ -317,12 +317,14 @@
angular.module('ovTopo')
.factory('TopoLinkService',
- ['$log', 'FnService', 'FlashService', 'TopoSelectService',
- 'TopoPanelService', 'TopoOverlayService',
+ ['$log', 'FnService', 'SvgUtilService', 'ThemeService', 'FlashService',
+ 'TopoSelectService', 'TopoPanelService', 'TopoOverlayService',
- function (_$log_, _fs_, _flash_, _tss_, _tps_, _tov_) {
+ function (_$log_, _fs_, _sus_, _ts_, _flash_, _tss_, _tps_, _tov_) {
$log = _$log_;
fs = _fs_;
+ sus = _sus_;
+ ts = _ts_;
flash = _flash_;
tss = _tss_;
tps = _tps_;
@@ -349,7 +351,7 @@
initLink: initLink,
destroyLink: destroyLink,
togglePorts: togglePorts,
- deselectAllLinks: deselectAllLinks,
+ deselectAllLinks: deselectAllLinks
};
}]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoMap.js b/web/gui/src/main/webapp/app/view/topo/topoMap.js
index 2095f0d..9418d17 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoMap.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoMap.js
@@ -23,13 +23,13 @@
'use strict';
// injected refs
- var $log, wss, tds, delegate;
+ var $log, $loc, fs, flash, wss, tds, delegate;
// constants
var mapRequest = 'mapSelectorRequest';
// internal state
- var order, maps, map, mapItems, msgHandlers;
+ var order, maps, map, mapItems, tintCheck, msgHandlers;
// === ---------------------------
// === Helper functions
@@ -60,7 +60,7 @@
mapid: map.id,
mapscale: map.scale,
mapfilepath: map.filePath,
- tint: 'off',
+ tint: 'off'
// tint: tintCheck.property('checked') ? 'on' : 'off'
};
setMap(p);
@@ -98,7 +98,7 @@
}
p.append('span').text('Enable map tint');
*/
-
+
return content;
}
@@ -131,15 +131,19 @@
angular.module('ovTopo')
.factory('TopoMapService',
- ['$log', 'WebSocketService', 'TopoDialogService',
+ ['$log', '$location', 'FnService', 'FlashService', 'WebSocketService',
+ 'TopoDialogService',
- function (_$log_, _wss_, _tds_) {
+ function (_$log_, _$loc_, _fs_, _flash_, _wss_, _tds_) {
$log = _$log_;
+ $loc = _$loc_;
+ fs = _fs_;
+ flash = _flash_;
wss = _wss_;
tds = _tds_;
msgHandlers = {
- mapSelectorResponse: handleMapResponse,
+ mapSelectorResponse: handleMapResponse
};
return {
@@ -150,7 +154,7 @@
openMapSelection: openMapSelection,
closeMapSelection: closeMapSelection,
start: start,
- stop: stop,
+ stop: stop
};
}]);
diff --git a/web/gui/src/main/webapp/app/view/topo/topoModel.js b/web/gui/src/main/webapp/app/view/topo/topoModel.js
index eadbb43..e841907 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoModel.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoModel.js
@@ -38,7 +38,7 @@
// shorthand
var lu, rlk, nodes, links, linksByDevice;
- var dim; // dimensions of layout [w,h]
+ var dim; // dimensions of layout [w,h]
// configuration 'constants'
var defaultLinkType = 'direct',
@@ -90,14 +90,14 @@
function rand() {
return {
x: rnd.randDim(dim[0]),
- y: rnd.randDim(dim[1]),
+ y: rnd.randDim(dim[1])
};
}
function near(node) {
return {
x: node.x + nearDist + rnd.spread(nearDist),
- y: node.y + nearDist + rnd.spread(nearDist),
+ y: node.y + nearDist + rnd.spread(nearDist)
};
}
@@ -181,7 +181,7 @@
// hostlink target is edge switch
return lnk.target.online;
},
- linkWidth: function () { return 1; },
+ linkWidth: function () { return 1; }
});
return lnk;
}
@@ -203,7 +203,7 @@
x1: 0,
y1: 0,
x2: 0,
- y2: 0,
+ y2: 0
},
// functions to aggregate dual link state
@@ -230,7 +230,7 @@
wt = (t && t.linkWidth) || 0;
return lnk.position.multiLink ? 5 : Math.max(ws, wt);
},
- extra: link.extra,
+ extra: link.extra
});
return lnk;
}
@@ -244,13 +244,13 @@
if (sMiss || dMiss) {
$log.error('Node(s) not on map for link:' + sMiss + dMiss);
- // logicError('Node(s) not on map for link:\n' + sMiss + dMiss);
+ //logicError('Node(s) not on map for link:\n' + sMiss + dMiss);
return null;
}
return {
source: srcNode,
- target: dstNode,
+ target: dstNode
};
}
@@ -306,7 +306,7 @@
result.updateWith = function (data) {
angular.extend(rawLink, data);
api.restyleLinkElement(ldata);
- };
+ }
}
} else if (op === 'remove') {
if (!ldata) {
@@ -349,7 +349,7 @@
} else {
api.removeLinkElement(ldata);
}
- };
+ }
}
}
}
@@ -466,7 +466,7 @@
findHosts: findHosts,
findAttachedHosts: findAttachedHosts,
findAttachedLinks: findAttachedLinks,
- findBadLinks: findBadLinks,
- };
+ findBadLinks: findBadLinks
+ }
}]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoOblique.js b/web/gui/src/main/webapp/app/view/topo/topoOblique.js
index 63027db..f3ac25b 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoOblique.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoOblique.js
@@ -24,7 +24,7 @@
'use strict';
// injected refs
- var sus, flash;
+ var $log, fs, sus, flash;
// api to topoForce
var api;
@@ -43,14 +43,14 @@
*/
// configuration
- var xsky = -.7, // x skew y factor
- xsk = -35, // x skew angle
- ysc = .5, // y scale
+ var xsky = -.7, // x skew y factor
+ xsk = -35, // x skew angle
+ ysc = .5, // y scale
pad = 50,
time = 1500,
fill = {
- pkt: 'rgba(130,130,170,0.3)', // blue-ish
- opt: 'rgba(170,130,170,0.3)', // magenta-ish
+ pkt: 'rgba(130,130,170,0.3)', // blue-ish
+ opt: 'rgba(170,130,170,0.3)' // magenta-ish
};
// internal state
@@ -74,7 +74,7 @@
}
function noXform() {
- return sus.skewX(0) + sus.translate(0, 0) + sus.scale(1, 1);
+ return sus.skewX(0) + sus.translate(0,0) + sus.scale(1,1);
}
function padBox(box, p) {
@@ -105,7 +105,7 @@
ay = xy.y - oy,
x = ax + ay * xsky,
y = (ay + yt) * ysc;
- return { x: ox + x, y: oy + y };
+ return {x: ox + x, y: oy + y};
};
showPlane('pkt', box, -1);
@@ -136,7 +136,7 @@
if (xffn) {
api.nodes().forEach(function (d) {
- var oldxy = { x: d.x, y: d.y },
+ var oldxy = {x: d.x, y: d.y},
coords = xffn(oldxy, dir(d));
d.oldxy = oldxy;
d.px = d.x = coords.x;
@@ -144,7 +144,7 @@
});
} else {
api.nodes().forEach(function (d) {
- var old = d.oldxy || { x: d.x, y: d.y };
+ var old = d.oldxy || {x: d.x, y: d.y};
d.px = d.x = old.x;
d.py = d.y = old.y;
delete d.oldxy;
@@ -191,7 +191,7 @@
var id = planeId(tag),
g = api.zoomLayer().insert('g', '#topo-G')
.attr('id', id)
- .attr('transform', sus.translate(ox, oy));
+ .attr('transform', sus.translate(ox,oy));
g.append('rect')
.attr('fill', fill[tag])
.attr('opacity', 0);
@@ -220,9 +220,11 @@
angular.module('ovTopo')
.factory('TopoObliqueService',
- ['SvgUtilService', 'FlashService',
+ ['$log', 'FnService', 'SvgUtilService', 'FlashService',
- function (_sus_, _flash_) {
+ function (_$log_, _fs_, _sus_, _flash_) {
+ $log = _$log_;
+ fs = _fs_;
sus = _sus_;
flash = _flash_;
@@ -249,7 +251,7 @@
destroyOblique: destroyOblique,
isOblique: function () { return oblique; },
- toggleOblique: toggleOblique,
+ toggleOblique: toggleOblique
};
}]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoOverlay.js b/web/gui/src/main/webapp/app/view/topo/topoOverlay.js
index d86af89..f953911 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoOverlay.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoOverlay.js
@@ -126,7 +126,7 @@
if (sicb && aicb && aicb(intentType)) {
result.push({
id: ovid,
- tt: ov.tooltip || '%' + ovid + '%',
+ tt: ov.tooltip || '%' + ovid + '%'
});
}
});
@@ -145,7 +145,7 @@
tooltip: (ov.tooltip || '(no tooltip)'),
cb: function () {
tbSelection(ov.overlayId, switchFn);
- },
+ }
});
map[ov.overlayId] = idx++;
});
@@ -185,28 +185,28 @@
showDeviceView: {
gid: 'switch',
tt: 'Show Device View',
- path: 'device',
+ path: 'device'
},
showFlowView: {
gid: 'flowTable',
tt: 'Show Flow View for this Device',
- path: 'flow',
+ path: 'flow'
},
showPortView: {
gid: 'portTable',
tt: 'Show Port View for this Device',
- path: 'port',
+ path: 'port'
},
showGroupView: {
gid: 'groupTable',
tt: 'Show Group View for this Device',
- path: 'group',
+ path: 'group'
},
showMeterView: {
gid: 'meterTable',
tt: 'Show Meter View for this Device',
- path: 'meter',
- },
+ path: 'meter'
+ }
};
// retrieves a button definition from the current overlay and generates
@@ -221,7 +221,7 @@
id: current.mkId(id),
gid: current.mkGid(b.gid),
tt: b.tt,
- cb: f,
+ cb: f
} : null;
}
@@ -238,7 +238,7 @@
id: 'core-' + id,
gid: gid,
tt: tt,
- cb: function () { ns.navTo(path, { devId: devId }); },
+ cb: function () { ns.navTo(path, {devId: devId }); }
});
} else if (btn = _getButtonDef(id, data)) {
tps.addAction(btn);
@@ -253,7 +253,7 @@
id: current.mkId(id),
gid: current.mkGid(b.gid),
cb: b.cb,
- tt: b.tt,
+ tt: b.tt
});
}
}
@@ -318,7 +318,7 @@
tss = _tss_;
}
- // process highlight event with optional delay
+ //process highlight event with optional delay
function showHighlights(data) {
function doHighlight() {
_showHighlights(data);
@@ -446,11 +446,11 @@
mouseOver: mouseOverHook,
mouseOut: mouseOutHook,
modifyLinkData: modifyLinkDataHook,
- showIntent: showIntentHook,
+ showIntent: showIntentHook
},
- showHighlights: showHighlights,
- };
+ showHighlights: showHighlights
+ }
}]);
-}());
+}());
\ No newline at end of file
diff --git a/web/gui/src/main/webapp/app/view/topo/topoPanel.js b/web/gui/src/main/webapp/app/view/topo/topoPanel.js
index 18af617..8f8eef5 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoPanel.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoPanel.js
@@ -30,17 +30,17 @@
idSum = 'topo-p-summary',
idDet = 'topo-p-detail',
panelOpts = {
- width: 260, // summary and detail panel width
+ width: 260 // summary and detail panel width
},
- sumMax = 226, // summary panel max height
- padTop = 16, // summary panel padding below masthead
- padding = 16, // panel internal padding
+ sumMax = 226, // summary panel max height
+ padTop = 16, // summary panel padding below masthead
+ padding = 16, // panel internal padding
padFudge = padTop + 2 * padding;
// internal state
- var useDetails = true, // should we show details if we have 'em?
- haveDetails = false, // do we have details that we could show?
- sumFromTop, // summary panel distance from top of screen
+ var useDetails = true, // should we show details if we have 'em?
+ haveDetails = false, // do we have details that we could show?
+ sumFromTop, // summary panel distance from top of screen
unbindWatch;
// panels
@@ -140,7 +140,7 @@
appendHeader: hAppend,
appendBody: bAppend,
appendFooter: fAppend,
- adjustHeight: adjustHeight,
+ adjustHeight: adjustHeight
};
}
@@ -195,7 +195,7 @@
function () {
return {
h: $window.innerHeight,
- w: $window.innerWidth,
+ w: $window.innerWidth
};
}, function () {
var h = summary.adjustHeight(sumFromTop, sumMax),
@@ -220,7 +220,7 @@
table = summary.appendBody('table'),
tbody = table.append('tbody');
- gs.addGlyph(svg, 'bird', 24, 0, [1, 1]);
+ gs.addGlyph(svg, 'bird', 24, 0, [1,1]);
title.text(data.title);
listProps(tbody, data);
@@ -231,7 +231,7 @@
var navPathIdKey = {
device: 'devId',
- host: 'hostId',
+ host: 'hostId'
};
function displaySingle(data) {
@@ -291,7 +291,7 @@
var friendlyIndex = {
device: 1,
- host: 0,
+ host: 0
};
function friendly(d) {
@@ -306,7 +306,7 @@
// provided to change presentation of internal type name
var linkTypePres = {
- hostLink: 'edge link',
+ hostLink: 'edge link'
};
function linkType(d) {
@@ -320,12 +320,12 @@
var coreOrder = [
'Type', 'Expected', '-',
'A_type', 'A_id', 'A_label', 'A_port', '-',
- 'B_type', 'B_id', 'B_label', 'B_port',
+ 'B_type', 'B_id', 'B_label', 'B_port'
],
edgeOrder = [
'Type', '-',
'A_type', 'A_id', 'A_label', '-',
- 'B_type', 'B_id', 'B_label', 'B_port',
+ 'B_type', 'B_id', 'B_label', 'B_port'
];
function displayLink(data, modifyCb) {
@@ -344,7 +344,7 @@
title.text('Link');
var linkData = {
- propOrder: order.slice(0), // makes a copy of the array
+ propOrder: order.slice(0), // makes a copy of the array
props: {
Type: linkType(data),
Expected: linkExpected(data),
@@ -357,8 +357,8 @@
B_type: data.target.class,
B_id: data.target.id,
B_label: friendly(data.target),
- B_port: data.tgtPort,
- },
+ B_port: data.tgtPort
+ }
};
listProps(tbody, modifyCb(linkData, data.extra));
@@ -422,7 +422,7 @@
function hideSummaryPanel() {
// instruct server to stop sending summary data
- wss.sendEvent('cancelSummary');
+ wss.sendEvent("cancelSummary");
summary.panel().hide(detail.up);
}
@@ -443,7 +443,7 @@
function augmentDetailPanel() {
var d = detail,
downPos = sumFromTop + sumMax + padFudge;
- d.ypos = { up: sumFromTop, down: downPos, current: downPos };
+ d.ypos = { up: sumFromTop, down: downPos, current: downPos};
d._move = function (y, cb) {
var yp = d.ypos,
@@ -453,11 +453,11 @@
endCb = function () {
cb();
d.adjustHeight(d.ypos.current);
- };
+ }
} else {
endCb = function () {
d.adjustHeight(d.ypos.current);
- };
+ }
}
if (yp.current !== y) {
yp.current = y;
@@ -552,7 +552,7 @@
addAction: addAction,
detailVisible: function () { return detail.panel().isVisible(); },
- summaryVisible: function () { return summary.panel().isVisible(); },
+ summaryVisible: function () { return summary.panel().isVisible(); }
};
}]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoProtectedIntent.js b/web/gui/src/main/webapp/app/view/topo/topoProtectedIntent.js
index 8625dec..20193dd 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoProtectedIntent.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoProtectedIntent.js
@@ -23,7 +23,7 @@
'use strict';
// injected refs
- var flash, wss;
+ var $log, fs, flash, wss, api;
// internal state
var showingProtectedIntent = null;
@@ -54,20 +54,21 @@
angular.module('ovTopo')
.factory('TopoProtectedIntentsService',
- ['FlashService', 'WebSocketService',
+ ['$log', 'FnService', 'FlashService', 'WebSocketService',
- function (_flash_, _wss_) {
+ function (_$log_, _fs_, _flash_, _wss_) {
+ $log = _$log_;
+ fs = _fs_;
flash = _flash_;
wss = _wss_;
return {
- // TODO: Remove references
- initProtectedIntents: function (_api_) {},
+ initProtectedIntents: function (_api_) { api = _api_; },
destroyProtectedIntents: function () { },
// invoked from toolbar overlay buttons or keystrokes
cancelHighlights: cancelHighlights,
- showProtectedIntent: showProtectedIntent,
+ showProtectedIntent: showProtectedIntent
};
}]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoProtectedIntentOverlay.js b/web/gui/src/main/webapp/app/view/topo/topoProtectedIntentOverlay.js
index bfe9afd..ab9114f 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoProtectedIntentOverlay.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoProtectedIntentOverlay.js
@@ -38,12 +38,12 @@
tooltip: 'Protected Intents Overlay',
activate: function () {
- $log.debug('Protected Intent overlay ACTIVATED');
+ $log.debug("Protected Intent overlay ACTIVATED");
},
deactivate: function () {
tpis.cancelHighlights();
- $log.debug('Protected Intent DEACTIVATED');
+ $log.debug("Protected Intent DEACTIVATED");
},
hooks: {
@@ -60,8 +60,8 @@
showIntent: function (info) {
$log.debug('^^ topoProtectedIntentsOverlay.showintent() ^^', info);
tpis.showProtectedIntent(info);
- },
- },
+ }
+ }
};
// invoke code to register with the overlay service
diff --git a/web/gui/src/main/webapp/app/view/topo/topoSelect.js b/web/gui/src/main/webapp/app/view/topo/topoSelect.js
index 9693755..724b43c 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoSelect.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoSelect.js
@@ -23,7 +23,7 @@
'use strict';
// injected refs
- var fs, wss, tov, tps, tts, sus;
+ var $log, fs, wss, tov, tps, tts, ns, sus, tpis;
// api to topoForce
var api;
@@ -37,11 +37,11 @@
// internal state
var hovered, selections, selectOrder, consumeClick;
- function setInitialState() {
- hovered = null; // the node over which the mouse is hovering
- selections = {}; // currently selected nodes (by id)
- selectOrder = []; // the order in which we made selections
- consumeClick = false; // used to coordinate with SVG click handler
+ function setInitialState () {
+ hovered = null; // the node over which the mouse is hovering
+ selections = {}; // currently selected nodes (by id)
+ selectOrder = []; // the order in which we made selections
+ consumeClick = false; // used to coordinate with SVG click handler
}
// ==========================
@@ -70,7 +70,7 @@
tov.hooks.mouseOver({
id: m.id,
class: m.class,
- type: m.type,
+ type: m.type
});
}
}
@@ -185,7 +185,7 @@
function requestDetails(data) {
wss.sendEvent('requestDetails', {
id: data.id,
- class: data.class,
+ class: data.class
});
}
@@ -210,7 +210,7 @@
function singleSelect() {
var data = getSel(0).obj;
- // the link details are already taken care of in topoLink.js
+ //the link details are already taken care of in topoLink.js
if (data.class === 'link') {
return;
}
@@ -235,14 +235,14 @@
id: 'host-flow-btn',
gid: 'endstation',
cb: tts.addHostIntent,
- tt: 'Create Host-to-Host Flow',
+ tt: 'Create Host-to-Host Flow'
});
} else if (nSel() >= 2) {
tps.addAction({
id: 'mult-src-flow-btn',
gid: 'flows',
cb: tts.addMultiSourceIntent,
- tt: 'Create Multi-Source Flow',
+ tt: 'Create Multi-Source Flow'
});
}
}
@@ -295,7 +295,7 @@
return {
devices: devices,
hosts: hosts,
- types: types,
+ types: types
};
}
@@ -304,16 +304,20 @@
angular.module('ovTopo')
.factory('TopoSelectService',
- ['FnService', 'WebSocketService', 'TopoOverlayService',
- 'TopoPanelService', 'TopoTrafficService', 'SvgUtilService',
+ ['$log', 'FnService', 'WebSocketService', 'TopoOverlayService',
+ 'TopoPanelService', 'TopoTrafficService', 'NavService',
+ 'SvgUtilService', 'TopoProtectedIntentsService',
- function (_fs_, _wss_, _tov_, _tps_, _tts_, _sus_) {
+ function (_$log_, _fs_, _wss_, _tov_, _tps_, _tts_, _ns_, _sus_, _tpis_) {
+ $log = _$log_;
fs = _fs_;
wss = _wss_;
tov = _tov_;
tps = _tps_;
tts = _tts_;
+ ns = _ns_;
sus = _sus_;
+ tpis= _tpis_;
function initSelect(_api_) {
api = _api_;
@@ -343,7 +347,7 @@
clickConsumed: clickConsumed,
selectionContext: selectionContext,
- reselect: reselect,
+ reselect: reselect
};
}]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoSprite.js b/web/gui/src/main/webapp/app/view/topo/topoSprite.js
index 7c63bfa..0a4785f 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoSprite.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoSprite.js
@@ -23,11 +23,11 @@
'use strict';
// injected refs
- var $log, fs, gs, sus, wss;
+ var $log, $http, fs, gs, sus, wss;
// constants
var tssid = 'TopoSpriteService: ',
- fontsize = 20; // default font size 20pt.
+ fontsize = 20; // default font size 20pt.
// internal state
var spriteLayer, defsElement;
@@ -76,9 +76,9 @@
function doSprite(spr, def, pathmeta) {
var pmeta = pathmeta[def.path],
c = spr.class || 'gray1',
- p = spr.pos || [0, 0],
+ p = spr.pos || [0,0],
lab = spr.label,
- dim = def.dim || [40, 40],
+ dim = def.dim || [40,40],
w = dim[0],
h = dim[1],
dy = def.labelyoff || 1,
@@ -97,7 +97,7 @@
attr = {
width: w,
height: h,
- 'xlink:href': '#' + pmeta.u,
+ 'xlink:href': '#' + pmeta.u
};
use = g.append('use').attr(attr);
@@ -113,7 +113,7 @@
width: w,
height: h,
'xlink:href': '#' + pmeta.u,
- transform: sus.translate(v.pos),
+ transform: sus.translate(v.pos)
};
use = g.append('use').attr(attr);
applyStrokeStyle(pmeta.s, use);
@@ -130,10 +130,9 @@
function doLabel(label) {
var c = label.class || 'gray1',
- p = label.pos || [0, 0],
- sz = label.size || 1.0;
-
- spriteLayer.append('g')
+ p = label.pos || [0,0],
+ sz = label.size || 1.0,
+ g = spriteLayer.append('g')
.classed(c, true)
.attr('transform', sus.translate(p))
.append('text')
@@ -175,7 +174,7 @@
load = data.load;
pfx = tssid + '[' + name + ']: ';
- $log.debug('Loading sprites...[' + name + ']', desc);
+ $log.debug("Loading sprites...[" + name + "]", desc);
function no(what) {
warn.push(pfx + 'No ' + what + ' property defined');
@@ -196,7 +195,7 @@
paths.forEach(function (p) {
pathmeta[p.tag] = {
s: p.stroke,
- u: p.glyph || 'spr_' + p.tag,
+ u: p.glyph || 'spr_' + p.tag
};
});
@@ -234,7 +233,7 @@
$log.info(tssid + 'Requesting sprite definition ['+name+']...');
wss.sendEvent('spriteListRequest');
- wss.sendEvent('spriteDataRequest', { name: name });
+ wss.sendEvent('spriteDataRequest', {name: name});
}
// === -----------------------------------------------------
@@ -242,11 +241,12 @@
angular.module('ovTopo')
.factory('TopoSpriteService',
- ['$log', 'FnService', 'GlyphService',
+ ['$log', '$http', 'FnService', 'GlyphService',
'SvgUtilService', 'WebSocketService',
- function (_$log_, _fs_, _gs_, _sus_, _wss_) {
+ function (_$log_, _$http_, _fs_, _gs_, _sus_, _wss_) {
$log = _$log_;
+ $http = _$http_;
fs = _fs_;
gs = _gs_;
sus = _sus_;
@@ -255,7 +255,7 @@
return {
loadSprites: loadSprites,
spriteListResponse: inList,
- spriteDataResponse: inData,
+ spriteDataResponse: inData
};
}]);
diff --git a/web/gui/src/main/webapp/app/view/topo/topoToolbar.js b/web/gui/src/main/webapp/app/view/topo/topoToolbar.js
index 505dabf..82d14ac 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoToolbar.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoToolbar.js
@@ -42,7 +42,7 @@
// key to button mapping data
var k2b = {
- O: { id: 'summary-tog', gid: 'm_summary', isel: true },
+ O: { id: 'summary-tog', gid: 'm_summary', isel: true},
I: { id: 'instance-tog', gid: 'm_uiAttached', isel: true },
D: { id: 'details-tog', gid: 'm_details', isel: true },
H: { id: 'hosts-tog', gid: 'm_endstation', isel: false },
@@ -57,12 +57,12 @@
L: { id: 'cycleLabels-btn', gid: 'm_cycleLabels' },
R: { id: 'resetZoom-btn', gid: 'm_resetZoom' },
- E: { id: 'eqMaster-btn', gid: 'm_eqMaster' },
+ E: { id: 'eqMaster-btn', gid: 'm_eqMaster' }
};
var prohibited = [
'T', 'backSlash', 'slash',
- 'X', // needed until we re-instate X above.
+ 'X' // needed until we re-instate X above.
];
prohibited = prohibited.concat(d3.map(k2b).keys());
@@ -79,8 +79,8 @@
porthl: 1,
bg: 0,
spr: 0,
- ovid: 'traffic', // default to traffic overlay
- toolbar: 0,
+ ovid: 'traffic', // default to traffic overlay
+ toolbar: 0
},
prefsMap = {
summary: 'O',
@@ -90,7 +90,7 @@
offdev: 'M',
porthl: 'P',
bg: 'B',
- spr: 'S',
+ spr: 'S'
// NOTE: toolbar state is handled separately
};
@@ -125,10 +125,10 @@
function initKeyData() {
// TODO: use angular forEach instead of d3.map
keyData = d3.map(k2b);
- keyData.forEach(function (key, value) {
+ keyData.forEach(function(key, value) {
var data = api.getActionEntry(key);
- value.cb = data[0]; // on-click callback
- value.tt = data[1] + ' (' + key + ')'; // tooltip
+ value.cb = data[0]; // on-click callback
+ value.tt = data[1] + ' (' + key + ')'; // tooltip
});
}
@@ -158,7 +158,7 @@
}
function addSecondRow() {
- // addToggle('X');
+ //addToggle('X');
addToggle('Z');
addButton('N');
addButton('L');
@@ -176,7 +176,7 @@
tooltip: 'No Overlay',
cb: function () {
tov.tbSelection(null, switchOverlayActions);
- },
+ }
}];
ovIndex = tov.augmentRbset(rset, switchOverlayActions);
ovRset = toolbar.addRadioSet('topo-overlays', rset);
@@ -317,7 +317,7 @@
toggleToolbar: toggleToolbar,
selectOverlay: selectOverlay,
defaultPrefs: defaultPrefsState,
- fnkey: fnkey,
+ fnkey: fnkey
};
}]);
-}());
+}());
\ No newline at end of file
diff --git a/web/gui/src/main/webapp/app/view/topo/topoTraffic.js b/web/gui/src/main/webapp/app/view/topo/topoTraffic.js
index 6bde992..11a4dba 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoTraffic.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoTraffic.js
@@ -23,7 +23,7 @@
'use strict';
// injected refs
- var $log, flash, wss, api;
+ var $log, fs, flash, wss, api;
/*
API to topoForce
@@ -35,12 +35,12 @@
var allTrafficTypes = [
'flowStatsBytes',
'portStatsBitSec',
- 'portStatsPktSec',
+ 'portStatsPktSec'
],
allTrafficMsgs = [
'Flow Stats (bytes)',
'Port Stats (bits / second)',
- 'Port Stats (packets / second)',
+ 'Port Stats (packets / second)'
];
// internal state
@@ -49,6 +49,7 @@
allTrafficIndex = 0;
+
// === -----------------------------------------------------
// Helper functions
@@ -77,7 +78,7 @@
if (api.somethingSelected()) {
wss.sendEvent('requestDeviceLinkFlows', {
ids: api.selectOrder(),
- hover: hoverValid() ? hov.id : '',
+ hover: hoverValid() ? hov.id : ''
});
}
}
@@ -96,7 +97,7 @@
if (api.somethingSelected()) {
wss.sendEvent('requestRelatedIntents', {
ids: api.selectOrder(),
- hover: hoverValid() ? hov.id : '',
+ hover: hoverValid() ? hov.id : ''
});
}
}
@@ -120,19 +121,19 @@
trafficMode = 'allFlowPort';
hoverMode = null;
wss.sendEvent('requestAllTraffic', {
- trafficType: allTrafficTypes[allTrafficIndex],
+ trafficType: allTrafficTypes[allTrafficIndex]
});
flash.flash(allTrafficMsgs[allTrafficIndex]);
allTrafficIndex = (allTrafficIndex + 1) % 3;
}
- function showDeviceLinkFlows() {
+ function showDeviceLinkFlows () {
trafficMode = hoverMode = 'flows';
requestDeviceLinkFlows();
flash.flash('Device Flows');
}
- function showRelatedIntents() {
+ function showRelatedIntents () {
trafficMode = hoverMode = 'intents';
requestRelatedIntents();
flash.flash('Related Paths');
@@ -174,25 +175,25 @@
// === ------------------------------------------------------
// action buttons on detail panel (multiple selection)
- function addHostIntent() {
+ function addHostIntent () {
var so = api.selectOrder();
wss.sendEvent('addHostIntent', {
one: so[0],
two: so[1],
- ids: so,
+ ids: so
});
trafficMode = 'intents';
hoverMode = null;
flash.flash('Host-to-Host flow added');
}
- function removeIntent(d) {
+ function removeIntent (d) {
$log.debug('Entering removeIntent');
wss.sendEvent('removeIntent', {
appId: d.appId,
appName: d.appName,
key: d.key,
- purge: d.intentPurge,
+ purge: d.intentPurge
});
trafficMode = 'intents';
hoverMode = null;
@@ -200,32 +201,32 @@
flash.flash('Intent ' + txt);
}
- function resubmitIntent(d) {
+ function resubmitIntent (d) {
$log.debug('Entering resubmitIntent');
wss.sendEvent('resubmitIntent', {
appId: d.appId,
appName: d.appName,
key: d.key,
- purge: d.intentPurge,
+ purge: d.intentPurge
});
trafficMode = 'intents';
hoverMode = null;
flash.flash('Intent resubmitted');
}
- function addMultiSourceIntent() {
+ function addMultiSourceIntent () {
var so = api.selectOrder();
wss.sendEvent('addMultiSourceIntent', {
src: so.slice(0, so.length - 1),
dst: so[so.length - 1],
- ids: so,
+ ids: so
});
trafficMode = 'intents';
hoverMode = null;
flash.flash('Multi-Source flow added');
}
- function removeIntents() {
+ function removeIntents () {
$log.debug('Entering removeIntents');
wss.sendEvent('removeIntents', {});
trafficMode = 'intents';
@@ -239,10 +240,11 @@
angular.module('ovTopo')
.factory('TopoTrafficService',
- ['$log', 'FnService', 'WebSocketService',
+ ['$log', 'FnService', 'FlashService', 'WebSocketService',
- function (_$log_, _flash_, _wss_) {
+ function (_$log_, _fs_, _flash_, _wss_) {
$log = _$log_;
+ fs = _fs_;
flash = _flash_;
wss = _wss_;
@@ -269,7 +271,7 @@
addMultiSourceIntent: addMultiSourceIntent,
removeIntent: removeIntent,
resubmitIntent: resubmitIntent,
- removeIntents: removeIntents,
+ removeIntents: removeIntents
};
}]);
}());
diff --git a/web/gui/src/main/webapp/app/view/topo/topoTrafficNew.js b/web/gui/src/main/webapp/app/view/topo/topoTrafficNew.js
index c395e04..7877e93 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoTrafficNew.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoTrafficNew.js
@@ -41,12 +41,12 @@
// NOTE: Traffic glyphs already installed as part of the base ONOS set.
activate: function () {
- $log.debug('Traffic overlay ACTIVATED');
+ $log.debug("Traffic overlay ACTIVATED");
},
deactivate: function () {
tts.cancelTraffic(true);
- $log.debug('Traffic overlay DEACTIVATED');
+ $log.debug("Traffic overlay DEACTIVATED");
},
// detail panel button definitions
@@ -55,14 +55,14 @@
showDeviceFlows: {
gid: 'm_flows',
tt: 'Show Device Flows',
- cb: function (data) { tts.showDeviceLinkFlows(); },
+ cb: function (data) { tts.showDeviceLinkFlows(); }
},
showRelatedTraffic: {
gid: 'm_relatedIntents',
tt: 'Show Related Traffic',
- cb: function (data) { tts.showRelatedIntents(); },
- },
+ cb: function (data) { tts.showRelatedIntents(); }
+ }
},
// key bindings for traffic overlay toolbar buttons
@@ -71,43 +71,43 @@
0: {
cb: function () { tts.cancelTraffic(true); },
tt: 'Cancel traffic monitoring',
- gid: 'm_xMark',
+ gid: 'm_xMark'
},
A: {
cb: function () { tts.showAllTraffic(); },
tt: 'Monitor all traffic',
- gid: 'm_allTraffic',
+ gid: 'm_allTraffic'
},
F: {
cb: function () { tts.showDeviceLinkFlows(); },
tt: 'Show device link flows',
- gid: 'm_flows',
+ gid: 'm_flows'
},
V: {
cb: function () { tts.showRelatedIntents(); },
tt: 'Show all related intents',
- gid: 'm_relatedIntents',
+ gid: 'm_relatedIntents'
},
leftArrow: {
cb: function () { tts.showPrevIntent(); },
tt: 'Show previous related intent',
- gid: 'm_prev',
+ gid: 'm_prev'
},
rightArrow: {
cb: function () { tts.showNextIntent(); },
tt: 'Show next related intent',
- gid: 'm_next',
+ gid: 'm_next'
},
W: {
cb: function () { tts.showSelectedIntentTraffic(); },
tt: 'Monitor traffic of selected intent',
- gid: 'm_intentTraffic',
+ gid: 'm_intentTraffic'
},
_keyOrder: [
- '0', 'A', 'F', 'V', 'leftArrow', 'rightArrow', 'W',
- ],
+ '0', 'A', 'F', 'V', 'leftArrow', 'rightArrow', 'W'
+ ]
},
hooks: {
@@ -146,8 +146,8 @@
showIntent: function (info) {
$log.debug('^^ trafficOverlay.showintent() ^^', info);
tts.selectIntent(info);
- },
- },
+ }
+ }
};
// invoke code to register with the overlay service