blob: 682ea1747670ea6aaa9b43a1e159d66047200543 [file] [log] [blame]
Thomas Vachuskaee79ad32019-03-05 17:26:55 -08001// path painter topology overlay - client side
2//
3// This is the glue that binds our business logic (in ppTopov.js)
4// to the overlay framework.
5
6(function () {
7 'use strict';
8
9 // injected refs
10 var $log, tov, ns, lts, sel;
11
12 // our overlay definition
13 var overlay = {
14 overlayId: 'od-overlay',
15 glyphId: 'm_disjointPaths',
16 tooltip: 'ONLP Data Overlay',
17
18 activate: function () {
19 $log.debug("ONLP data topology overlay ACTIVATED");
20 },
21 deactivate: function () {
22 lts.clear();
23 $log.debug("ONLP data topology overlay DEACTIVATED");
24 },
25
26 // detail panel button definitions
27 buttons: {
28 showOnlpView: {
29 gid: 'chain',
30 tt: 'ONLP data',
31 cb: function (data) {
32 $log.debug('ONLP action invoked on selection:', sel);
33 ns.navTo('onlp', { devId: sel.id });
34 }
35 }
36 },
37
38 hooks: {
39 // hooks for when the selection changes...
40 single: function (data) {
41 $log.debug('selection data:', data);
42 sel = data;
43 tov.addDetailButton('showOnlpView');
44 }
45 }
46 };
47
48 // invoke code to register with the overlay service
49 angular.module('ovOdTopov')
50 .run(['$log', 'TopoOverlayService', 'NavService', 'OnlpDemoTopovService',
51
52 function (_$log_, _tov_, _ns_, _lts_) {
53 $log = _$log_;
54 tov = _tov_;
55 ns = _ns_;
56 lts = _lts_;
57 tov.register(overlay);
58 }]);
59}());