sfcwebTopovOverlay.js
2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// sfcweb topology overlay - client side
//
// This is the glue that binds our business logic (in sfcwebTopovDemo.js)
// to the overlay framework.
(function () {
'use strict';
// injected refs
var $log, tov, pps;
var longPrefix = 'M15.9,19.1h-8v-13h8V19.1z M90.5,6.1H75.6v13h14.9V6.1' +
'z M71.9,6.1H56.9v13h14.9V6.1z M53.2,6.1H38.3v13h14.9V6.1z M34.5,' +
'6.1H19.6v13h14.9V6.1z M102.2,6.1h-8v13h8V6.1z' ;
// our overlay definition
var overlay = {
// NOTE: this must match the ID defined in SfcWebUiTopovOverlay
overlayId: 'SFC-Service-overlay',
glyphId: '*star4',
tooltip: 'SFC web service Topo Overlay',
// These glyphs get installed using the overlayId as a prefix.
// e.g. 'star4' is installed as 'meowster-overlay-star4'
// They can be referenced (from this overlay) as '*star4'
// That is, the '*' prefix stands in for 'meowster-overlay-'
glyphs: {
star4: {
vb: '0 0 8 8',
d: 'M1,4l2,-1l1,-2l1,2l2,1l-2,1l-1,2l-1,-2z'
},
jp: {
vb: '0 0 110 110',
d: 'M84.3,89.3L58.9,64.2l-1.4,1.4L83,90.7L84.3,89.3z M27,7.6H7.4v19.2H27V7.6z' +
'M59.3,47.1H39.8v19.2h19.5V47.1z M102.1,79.5H82.6v19.2h19.5V79.5z M41.7,47.6L19,25.1l-1.2,1.2l22.7,22.5L41.7,47.6z'
}
},
activate: function () {
$log.debug("SFC service topology overlay ACTIVATED");
},
deactivate: function () {
pps.clear();
$log.debug("SFC service topology overlay DEACTIVATED");
},
// Key bindings for traffic overlay buttons
// NOTE: fully qual. button ID is derived from overlay-id and key-name
// FIXME: find better keys for shortest paths & disjoint paths modes
keyBindings: {
4: {
cb: function () {
pps.start();
},
tt: 'Query SFP active list information',
gid: 'summary'
},
5: {
cb: function () {
pps.configSfp();
},
tt: 'Highlight SFP active list information',
gid: '*jp'
},
_keyOrder: [
'4' , '5'
]
}
};
// invoke code to register with the overlay service
angular.module('ovSfcwebTopov')
.run(['$log', 'TopoOverlayService', 'SfcwebTopovDemoService',
function (_$log_, _tov_, _pps_) {
$log = _$log_;
tov = _tov_;
pps = _pps_;
tov.register(overlay);
$log.debug('ovSfcwebTopov run');
}]);
}());