blob: 87dd1bd3a7bebb512ff37213a8c2e55ed75d630e [file] [log] [blame]
Simon Huntb0ec1e52015-01-28 18:13:49 -08001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 ONOS GUI -- Topology Panel Module.
19 Defines functions for manipulating the summary, detail, and instance panels.
20 */
21
22(function () {
23 'use strict';
24
25 // injected refs
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -070026 var $log, $window, $rootScope, fs, ps, gs, flash, wss, bns, mast, ns;
Simon Huntb0ec1e52015-01-28 18:13:49 -080027
Simon Hunt626d2102015-01-29 11:54:50 -080028 // constants
Simon Hunt08f841d02015-02-10 14:39:20 -080029 var pCls = 'topo-p',
30 idSum = 'topo-p-summary',
Simon Hunt626d2102015-01-29 11:54:50 -080031 idDet = 'topo-p-detail',
Simon Hunt626d2102015-01-29 11:54:50 -080032 panelOpts = {
33 width: 260
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -070034 },
Simon Hunt7b41c4a2015-06-10 10:42:01 -070035 sumMax = 240,
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -070036 padTop = 20,
37 devPath = 'device';
Simon Hunt626d2102015-01-29 11:54:50 -080038
Simon Hunt0c6b2d32015-03-26 17:46:29 -070039 // internal state
40 var useDetails = true, // should we show details if we have 'em?
Bri Prebilic Coled8745462015-06-01 16:08:57 -070041 haveDetails = false, // do we have details that we could show?
Bri Prebilic Cole0a6ffb62015-06-04 09:32:12 -070042 sumFromTop, // summary panel distance from top of screen
43 unbindWatch;
Simon Huntb0ec1e52015-01-28 18:13:49 -080044
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -070045 // panels
46 var summary, detail;
47
48 // === -----------------------------------------------------
49 // Panel API
50 function createTopoPanel(id, opts) {
51 var p = ps.createPanel(id, opts),
Bri Prebilic Cole35d29712015-05-11 16:01:32 -070052 pid = id,
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -070053 header, body, footer;
54 p.classed(pCls, true);
55
Bri Prebilic Cole35d29712015-05-11 16:01:32 -070056 function panel() {
57 return p;
58 }
59
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -070060 function hAppend(x) {
61 return header.append(x);
62 }
63
64 function bAppend(x) {
65 return body.append(x);
66 }
67
68 function fAppend(x) {
69 return footer.append(x);
70 }
71
72 function setup() {
73 p.empty();
74
75 p.append('div').classed('header', true);
76 p.append('div').classed('body', true);
77 p.append('div').classed('footer', true);
78
79 header = p.el().select('.header');
80 body = p.el().select('.body');
81 footer = p.el().select('.footer');
82 }
83
Bri Prebilic Cole35d29712015-05-11 16:01:32 -070084 function destroy() {
85 ps.destroyPanel(pid);
86 }
87
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -070088 // fromTop is how many pixels from the top of the page the panel is
89 // max is the max height of the panel in pixels
90 // only adjusts if the body content would be 10px or larger
91 function adjustHeight(fromTop, max) {
92 var totalPHeight, avSpace,
93 overflow = 0,
94 pdg = 30;
95
96 if (!fromTop) {
97 $log.warn('adjustHeight: height from top of page not given');
98 return null;
99 } else if (!body || !p) {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700100 $log.warn('adjustHeight: panel contents are not defined');
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700101 return null;
102 }
103
104 p.el().style('height', null);
105 body.style('height', null);
106
107 totalPHeight = fromTop + p.height();
108 avSpace = fs.windowSize(pdg).height;
109
110 if (totalPHeight >= avSpace) {
111 overflow = totalPHeight - avSpace;
112 }
113
114 function _adjustBody(height) {
115 if (height < 10) {
116 return false;
117 } else {
118 body.style('height', height + 'px');
119 }
120 return true;
121 }
122
123 if (!_adjustBody(fs.noPxStyle(body, 'height') - overflow)) {
124 return;
125 }
126
127 if (max && p.height() > max) {
128 _adjustBody(fs.noPxStyle(body, 'height') - (p.height() - max));
129 }
130 }
131
132 return {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700133 panel: panel,
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700134 setup: setup,
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700135 destroy: destroy,
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700136 appendHeader: hAppend,
137 appendBody: bAppend,
138 appendFooter: fAppend,
139 adjustHeight: adjustHeight
140 };
141 }
142
Simon Hunt08f841d02015-02-10 14:39:20 -0800143 // === -----------------------------------------------------
144 // Utility functions
Simon Hunt626d2102015-01-29 11:54:50 -0800145
Simon Hunt4b668592015-01-29 17:33:53 -0800146 function addSep(tbody) {
147 tbody.append('tr').append('td').attr('colspan', 2).append('hr');
148 }
149
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700150 function addBtnFooter() {
151 detail.appendFooter('hr');
152 detail.appendFooter('div').classed('actionBtns', true);
153 }
154
Simon Hunt4b668592015-01-29 17:33:53 -0800155 function addProp(tbody, label, value) {
Simon Hunte25c5a22015-04-02 14:37:12 -0700156 var tr = tbody.append('tr'),
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -0700157 lab;
158 if (typeof label === 'string') {
Simon Hunte25c5a22015-04-02 14:37:12 -0700159 lab = label.replace(/_/g, ' ');
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -0700160 } else {
161 lab = label;
162 }
Simon Hunt4b668592015-01-29 17:33:53 -0800163
164 function addCell(cls, txt) {
Simon Hunta36f03b2015-04-01 15:22:49 -0700165 tr.append('td').attr('class', cls).html(txt);
Simon Hunt4b668592015-01-29 17:33:53 -0800166 }
Simon Hunte25c5a22015-04-02 14:37:12 -0700167 addCell('label', lab + ' :');
Simon Hunt4b668592015-01-29 17:33:53 -0800168 addCell('value', value);
169 }
170
Simon Hunt08f841d02015-02-10 14:39:20 -0800171 function listProps(tbody, data) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700172 data.propOrder.forEach(function (p) {
Simon Hunt08f841d02015-02-10 14:39:20 -0800173 if (p === '-') {
174 addSep(tbody);
175 } else {
176 addProp(tbody, p, data.props[p]);
177 }
178 });
179 }
180
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700181 function watchWindow() {
Bri Prebilic Cole0a6ffb62015-06-04 09:32:12 -0700182 unbindWatch = $rootScope.$watchCollection(
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700183 function () {
184 return {
185 h: $window.innerHeight,
186 w: $window.innerWidth
187 };
188 }, function () {
189 summary.adjustHeight(sumFromTop, sumMax);
190 detail.adjustHeight(detail.ypos.current);
191 }
192 );
193 }
194
Simon Hunt08f841d02015-02-10 14:39:20 -0800195 // === -----------------------------------------------------
196 // Functions for populating the summary panel
197
198 function populateSummary(data) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700199 summary.setup();
Simon Hunt08f841d02015-02-10 14:39:20 -0800200
Bri Prebilic Cole8d3de3d2015-05-15 16:02:59 -0700201 var svg = summary.appendHeader('div')
202 .classed('icon', true)
203 .append('svg'),
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700204 title = summary.appendHeader('h2'),
205 table = summary.appendBody('table'),
Simon Hunt08f841d02015-02-10 14:39:20 -0800206 tbody = table.append('tbody');
207
208 gs.addGlyph(svg, 'node', 40);
209 gs.addGlyph(svg, 'bird', 24, true, [8,12]);
210
Simon Hunt0af1ec32015-07-24 12:17:55 -0700211 title.text(data.title);
Simon Hunt08f841d02015-02-10 14:39:20 -0800212 listProps(tbody, data);
213 }
214
215 // === -----------------------------------------------------
216 // Functions for populating the detail panel
217
218 function displaySingle(data) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700219 detail.setup();
Simon Hunt08f841d02015-02-10 14:39:20 -0800220
Bri Prebilic Cole8d3de3d2015-05-15 16:02:59 -0700221 var svg = detail.appendHeader('div')
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -0700222 .classed('icon clickable', true)
Bri Prebilic Cole8d3de3d2015-05-15 16:02:59 -0700223 .append('svg'),
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -0700224 title = detail.appendHeader('h2')
225 .classed('clickable', true),
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700226 table = detail.appendBody('table'),
Simon Hunt08f841d02015-02-10 14:39:20 -0800227 tbody = table.append('tbody');
228
229 gs.addGlyph(svg, (data.type || 'unknown'), 40);
230 title.text(data.id);
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -0700231 svg.on('click', function () {
232 ns.navTo(devPath, { devId: data.id });
233 });
234 title.on('click', function () {
235 ns.navTo(devPath, { devId: data.id });
236 });
237
Simon Hunt08f841d02015-02-10 14:39:20 -0800238 listProps(tbody, data);
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700239 addBtnFooter();
Simon Hunt08f841d02015-02-10 14:39:20 -0800240 }
241
242 function displayMulti(ids) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700243 detail.setup();
Simon Hunt08f841d02015-02-10 14:39:20 -0800244
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700245 var title = detail.appendHeader('h3'),
246 table = detail.appendBody('table'),
Simon Hunt08f841d02015-02-10 14:39:20 -0800247 tbody = table.append('tbody');
248
249 title.text('Selected Nodes');
250 ids.forEach(function (d, i) {
251 addProp(tbody, i+1, d);
252 });
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700253 addBtnFooter();
Simon Hunt08f841d02015-02-10 14:39:20 -0800254 }
255
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -0700256 function addAction(o) {
257 var btnDiv = d3.select('#' + idDet)
258 .select('.actionBtns')
259 .append('div')
260 .classed('actionBtn', true);
261 bns.button(btnDiv, idDet + o.id, o.gid, o.cb, o.tt);
Simon Hunt08f841d02015-02-10 14:39:20 -0800262 }
263
Simon Hunta36f03b2015-04-01 15:22:49 -0700264 var friendlyIndex = {
265 device: 1,
266 host: 0
267 };
268
269 function friendly(d) {
270 var i = friendlyIndex[d.class] || 0;
271 return (d.labels && d.labels[i]) || '';
272 }
273
274 function linkSummary(d) {
275 var o = d && d.online ? 'online' : 'offline';
276 return d ? d.type + ' / ' + o : '-';
277 }
278
Simon Hunte25c5a22015-04-02 14:37:12 -0700279 // provided to change presentation of internal type name
280 var linkTypePres = {
281 hostLink: 'edge link'
282 };
283
284 function linkType(d) {
285 return linkTypePres[d.type()] || d.type();
286 }
287
288 var coreOrder = [
289 'Type', '-',
290 'A_type', 'A_id', 'A_label', 'A_port', '-',
291 'B_type', 'B_id', 'B_label', 'B_port', '-'
292 ],
293 edgeOrder = [
294 'Type', '-',
295 'A_type', 'A_id', 'A_label', '-',
296 'B_type', 'B_id', 'B_label', 'B_port'
297 ];
298
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700299 function displayLink(data) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700300 detail.setup();
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700301
Bri Prebilic Cole8d3de3d2015-05-15 16:02:59 -0700302 var svg = detail.appendHeader('div')
303 .classed('icon', true)
304 .append('svg'),
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700305 title = detail.appendHeader('h2'),
306 table = detail.appendBody('table'),
Simon Hunte25c5a22015-04-02 14:37:12 -0700307 tbody = table.append('tbody'),
308 edgeLink = data.type() === 'hostLink',
309 order = edgeLink ? edgeOrder : coreOrder;
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700310
311 gs.addGlyph(svg, 'ports', 40);
312 title.text('Link');
Simon Hunta36f03b2015-04-01 15:22:49 -0700313
Simon Hunta36f03b2015-04-01 15:22:49 -0700314
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700315 listProps(tbody, {
Simon Hunta36f03b2015-04-01 15:22:49 -0700316 propOrder: order,
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700317 props: {
Simon Hunte25c5a22015-04-02 14:37:12 -0700318 Type: linkType(data),
Simon Hunta36f03b2015-04-01 15:22:49 -0700319
320 A_type: data.source.class,
321 A_id: data.source.id,
322 A_label: friendly(data.source),
323 A_port: data.srcPort,
324
325 B_type: data.target.class,
326 B_id: data.target.id,
327 B_label: friendly(data.target),
328 B_port: data.tgtPort
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700329 }
330 });
Simon Hunta36f03b2015-04-01 15:22:49 -0700331
Simon Hunte25c5a22015-04-02 14:37:12 -0700332 if (!edgeLink) {
333 addProp(tbody, 'A &rarr; B', linkSummary(data.fromSource));
334 addProp(tbody, 'B &rarr; A', linkSummary(data.fromTarget));
335 }
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700336 }
337
338 function displayNothing() {
339 haveDetails = false;
340 hideDetailPanel();
341 }
342
343 function displaySomething() {
344 haveDetails = true;
345 if (useDetails) {
346 showDetailPanel();
347 }
348 }
349
Simon Hunt08f841d02015-02-10 14:39:20 -0800350 // === -----------------------------------------------------
351 // Event Handlers
352
353 function showSummary(data) {
354 populateSummary(data);
355 showSummaryPanel();
356 }
357
Simon Hunt36a58c62015-04-08 11:00:07 -0700358 function toggleSummary(x) {
Simon Huntee7a3ce2015-04-09 13:28:37 -0700359 var kev = (x === 'keyev'),
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700360 on = kev ? !summary.panel().isVisible() : !!x,
Simon Huntee7a3ce2015-04-09 13:28:37 -0700361 verb = on ? 'Show' : 'Hide';
Simon Hunt36a58c62015-04-08 11:00:07 -0700362
363 if (on) {
Simon Hunta0eb0a82015-02-11 12:30:06 -0800364 // ask server to start sending summary data.
Simon Hunt237676b52015-03-10 19:04:26 -0700365 wss.sendEvent('requestSummary');
Simon Hunta0eb0a82015-02-11 12:30:06 -0800366 // note: the summary panel will appear, once data arrives
Simon Hunt36a58c62015-04-08 11:00:07 -0700367 } else {
368 hideSummaryPanel();
Simon Hunt6036b192015-02-11 11:20:26 -0800369 }
Simon Huntee7a3ce2015-04-09 13:28:37 -0700370 flash.flash(verb + ' summary panel');
371 return on;
Simon Hunt6036b192015-02-11 11:20:26 -0800372 }
Simon Hunt08f841d02015-02-10 14:39:20 -0800373
374 // === -----------------------------------------------------
375 // === LOGIC For showing/hiding summary and detail panels...
376
Simon Hunt626d2102015-01-29 11:54:50 -0800377 function showSummaryPanel() {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700378 function _show() {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700379 summary.panel().show();
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700380 summary.adjustHeight(sumFromTop, sumMax);
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700381 }
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700382 if (detail.panel().isVisible()) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700383 detail.down(_show);
Simon Hunt6036b192015-02-11 11:20:26 -0800384 } else {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700385 _show();
Simon Hunt6036b192015-02-11 11:20:26 -0800386 }
Simon Huntc252aa62015-02-10 16:45:39 -0800387 }
388
389 function hideSummaryPanel() {
Simon Hunta0eb0a82015-02-11 12:30:06 -0800390 // instruct server to stop sending summary data
Simon Hunt237676b52015-03-10 19:04:26 -0700391 wss.sendEvent("cancelSummary");
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700392 summary.panel().hide(detail.up);
Simon Hunt4b668592015-01-29 17:33:53 -0800393 }
Simon Hunt626d2102015-01-29 11:54:50 -0800394
Simon Hunt08f841d02015-02-10 14:39:20 -0800395 function showDetailPanel() {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700396 if (summary.panel().isVisible()) {
397 detail.down(detail.panel().show);
Simon Hunt6036b192015-02-11 11:20:26 -0800398 } else {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700399 detail.up(detail.panel().show);
Simon Hunt6036b192015-02-11 11:20:26 -0800400 }
Simon Hunt08f841d02015-02-10 14:39:20 -0800401 }
402
403 function hideDetailPanel() {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700404 detail.panel().hide();
Simon Hunt08f841d02015-02-10 14:39:20 -0800405 }
406
Simon Hunt6036b192015-02-11 11:20:26 -0800407 // ==========================
Simon Hunt08f841d02015-02-10 14:39:20 -0800408
Simon Hunt6036b192015-02-11 11:20:26 -0800409 function augmentDetailPanel() {
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700410 var d = detail,
411 downPos = sumFromTop + sumMax + 20;
412 d.ypos = { up: sumFromTop, down: downPos, current: downPos};
Simon Hunt6036b192015-02-11 11:20:26 -0800413
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700414 d._move = function (y, cb) {
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700415 var yp = d.ypos,
416 endCb;
417
418 if (fs.isF(cb)) {
419 endCb = function () {
420 cb();
421 d.adjustHeight(d.ypos.current);
422 }
423 } else {
424 endCb = function () {
425 d.adjustHeight(d.ypos.current);
426 }
427 }
Simon Hunt6036b192015-02-11 11:20:26 -0800428 if (yp.current !== y) {
429 yp.current = y;
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700430 d.panel().el().transition().duration(300)
Simon Hunt6036b192015-02-11 11:20:26 -0800431 .each('end', endCb)
432 .style('top', yp.current + 'px');
433 } else {
434 endCb();
435 }
436 };
437
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700438 d.down = function (cb) { d._move(d.ypos.down, cb); };
439 d.up = function (cb) { d._move(d.ypos.up, cb); };
Simon Hunt6036b192015-02-11 11:20:26 -0800440 }
Simon Hunt08f841d02015-02-10 14:39:20 -0800441
Simon Hunt239e5882015-04-23 15:07:04 -0700442 function toggleUseDetailsFlag(x) {
Simon Huntee7a3ce2015-04-09 13:28:37 -0700443 var kev = (x === 'keyev'),
444 verb;
445
446 useDetails = kev ? !useDetails : !!x;
447 verb = useDetails ? 'Enable' : 'Disable';
448
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700449 if (useDetails) {
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700450 if (haveDetails) {
451 showDetailPanel();
452 }
453 } else {
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700454 hideDetailPanel();
455 }
Simon Huntee7a3ce2015-04-09 13:28:37 -0700456 flash.flash(verb + ' details panel');
457 return useDetails;
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700458 }
459
Simon Hunt4b668592015-01-29 17:33:53 -0800460 // ==========================
461
Simon Hunt237676b52015-03-10 19:04:26 -0700462 function initPanels() {
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700463 sumFromTop = mast.mastHeight() + padTop;
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700464 summary = createTopoPanel(idSum, panelOpts);
465 detail = createTopoPanel(idDet, panelOpts);
Simon Hunt6036b192015-02-11 11:20:26 -0800466
467 augmentDetailPanel();
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700468 watchWindow();
Simon Hunt4b668592015-01-29 17:33:53 -0800469 }
470
471 function destroyPanels() {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700472 summary.destroy();
473 summary = null;
474
475 detail.destroy();
476 detail = null;
Simon Hunt239e5882015-04-23 15:07:04 -0700477 haveDetails = false;
Bri Prebilic Cole0a6ffb62015-06-04 09:32:12 -0700478 unbindWatch();
Simon Hunt626d2102015-01-29 11:54:50 -0800479 }
480
481 // ==========================
482
Simon Huntb0ec1e52015-01-28 18:13:49 -0800483 angular.module('ovTopo')
484 .factory('TopoPanelService',
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700485 ['$log', '$window', '$rootScope', 'FnService', 'PanelService', 'GlyphService',
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700486 'FlashService', 'WebSocketService', 'ButtonService', 'MastService',
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -0700487 'NavService',
Simon Huntb0ec1e52015-01-28 18:13:49 -0800488
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700489 function (_$log_, _$window_, _$rootScope_,
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -0700490 _fs_, _ps_, _gs_, _flash_, _wss_, _bns_, _mast_, _ns_) {
Simon Huntb0ec1e52015-01-28 18:13:49 -0800491 $log = _$log_;
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700492 $window = _$window_;
493 $rootScope = _$rootScope_;
Simon Hunt6036b192015-02-11 11:20:26 -0800494 fs = _fs_;
Simon Huntb0ec1e52015-01-28 18:13:49 -0800495 ps = _ps_;
Simon Huntc9b73162015-01-29 14:02:15 -0800496 gs = _gs_;
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700497 flash = _flash_;
Simon Hunt237676b52015-03-10 19:04:26 -0700498 wss = _wss_;
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -0700499 bns = _bns_;
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700500 mast = _mast_;
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -0700501 ns = _ns_;
Simon Huntb0ec1e52015-01-28 18:13:49 -0800502
Simon Huntb0ec1e52015-01-28 18:13:49 -0800503 return {
504 initPanels: initPanels,
Simon Hunt626d2102015-01-29 11:54:50 -0800505 destroyPanels: destroyPanels,
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700506 createTopoPanel: createTopoPanel,
Simon Hunt08f841d02015-02-10 14:39:20 -0800507
508 showSummary: showSummary,
Simon Hunt6036b192015-02-11 11:20:26 -0800509 toggleSummary: toggleSummary,
Simon Hunt08f841d02015-02-10 14:39:20 -0800510
Simon Hunt239e5882015-04-23 15:07:04 -0700511 toggleUseDetailsFlag: toggleUseDetailsFlag,
Simon Hunt08f841d02015-02-10 14:39:20 -0800512 displaySingle: displaySingle,
513 displayMulti: displayMulti,
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700514 displayLink: displayLink,
515 displayNothing: displayNothing,
516 displaySomething: displaySomething,
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700517 addAction: addAction,
Simon Hunt08f841d02015-02-10 14:39:20 -0800518
Simon Huntc252aa62015-02-10 16:45:39 -0800519 hideSummaryPanel: hideSummaryPanel,
Simon Hunt08f841d02015-02-10 14:39:20 -0800520
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700521 detailVisible: function () { return detail.panel().isVisible(); },
522 summaryVisible: function () { return summary.panel().isVisible(); }
Simon Huntb0ec1e52015-01-28 18:13:49 -0800523 };
524 }]);
525}());