blob: 5f5c118521f987977b3240dfde2e9815d0707547 [file] [log] [blame]
rama-huaweic78f3092016-05-19 18:09:29 +05301// sfcweb topology overlay - client side
2//
3// This is the glue that binds our business logic (in sfcwebTopovDemo.js)
4// to the overlay framework.
5
6(function () {
7 'use strict';
8
9 // injected refs
10 var $log, tov, pps;
11 var longPrefix = 'M15.9,19.1h-8v-13h8V19.1z M90.5,6.1H75.6v13h14.9V6.1' +
12 'z M71.9,6.1H56.9v13h14.9V6.1z M53.2,6.1H38.3v13h14.9V6.1z M34.5,' +
13 '6.1H19.6v13h14.9V6.1z M102.2,6.1h-8v13h8V6.1z' ;
14
15 // our overlay definition
16 var overlay = {
17 // NOTE: this must match the ID defined in SfcWebUiTopovOverlay
18 overlayId: 'SFC-Service-overlay',
19 glyphId: '*star4',
20 tooltip: 'SFC web service Topo Overlay',
21
22 // These glyphs get installed using the overlayId as a prefix.
23 // e.g. 'star4' is installed as 'meowster-overlay-star4'
24 // They can be referenced (from this overlay) as '*star4'
25 // That is, the '*' prefix stands in for 'meowster-overlay-'
26 glyphs: {
27 star4: {
28 vb: '0 0 8 8',
29 d: 'M1,4l2,-1l1,-2l1,2l2,1l-2,1l-1,2l-1,-2z'
rama-huaweic78f3092016-05-19 18:09:29 +053030 }
31 },
32 activate: function () {
33 $log.debug("SFC service topology overlay ACTIVATED");
34 },
35 deactivate: function () {
36 pps.clear();
37 $log.debug("SFC service topology overlay DEACTIVATED");
38 },
39
40 // Key bindings for traffic overlay buttons
41 // NOTE: fully qual. button ID is derived from overlay-id and key-name
42 // FIXME: find better keys for shortest paths & disjoint paths modes
43 keyBindings: {
44 4: {
45 cb: function () {
46 pps.start();
47 },
48 tt: 'Query SFP active list information',
49 gid: 'summary'
50 },
rama-huaweic78f3092016-05-19 18:09:29 +053051
52 _keyOrder: [
Phaneendra Mandab212bc92016-07-08 16:50:11 +053053 '4'
rama-huaweic78f3092016-05-19 18:09:29 +053054 ]
55 }
56
57 };
58
59 // invoke code to register with the overlay service
60 angular.module('ovSfcwebTopov')
61 .run(['$log', 'TopoOverlayService', 'SfcwebTopovDemoService',
62
63 function (_$log_, _tov_, _pps_) {
64 $log = _$log_;
65 tov = _tov_;
66 pps = _pps_;
67 tov.register(overlay);
68 $log.debug('ovSfcwebTopov run');
69 }]);
70
71}());