blob: 153241d1a95eaab3d81e3480c920868fef2a68f3 [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 Coled8745462015-06-01 16:08:57 -070026 var $log, $window, $rootScope, fs, ps, gs, flash, wss, bns, mast;
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,
36 padTop = 20;
Simon Hunt626d2102015-01-29 11:54:50 -080037
Simon Hunt0c6b2d32015-03-26 17:46:29 -070038 // internal state
39 var useDetails = true, // should we show details if we have 'em?
Bri Prebilic Coled8745462015-06-01 16:08:57 -070040 haveDetails = false, // do we have details that we could show?
Bri Prebilic Cole0a6ffb62015-06-04 09:32:12 -070041 sumFromTop, // summary panel distance from top of screen
42 unbindWatch;
Simon Huntb0ec1e52015-01-28 18:13:49 -080043
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -070044 // panels
45 var summary, detail;
46
47 // === -----------------------------------------------------
48 // Panel API
49 function createTopoPanel(id, opts) {
50 var p = ps.createPanel(id, opts),
Bri Prebilic Cole35d29712015-05-11 16:01:32 -070051 pid = id,
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -070052 header, body, footer;
53 p.classed(pCls, true);
54
Bri Prebilic Cole35d29712015-05-11 16:01:32 -070055 function panel() {
56 return p;
57 }
58
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -070059 function hAppend(x) {
60 return header.append(x);
61 }
62
63 function bAppend(x) {
64 return body.append(x);
65 }
66
67 function fAppend(x) {
68 return footer.append(x);
69 }
70
71 function setup() {
72 p.empty();
73
74 p.append('div').classed('header', true);
75 p.append('div').classed('body', true);
76 p.append('div').classed('footer', true);
77
78 header = p.el().select('.header');
79 body = p.el().select('.body');
80 footer = p.el().select('.footer');
81 }
82
Bri Prebilic Cole35d29712015-05-11 16:01:32 -070083 function destroy() {
84 ps.destroyPanel(pid);
85 }
86
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -070087 // fromTop is how many pixels from the top of the page the panel is
88 // max is the max height of the panel in pixels
89 // only adjusts if the body content would be 10px or larger
90 function adjustHeight(fromTop, max) {
91 var totalPHeight, avSpace,
92 overflow = 0,
93 pdg = 30;
94
95 if (!fromTop) {
96 $log.warn('adjustHeight: height from top of page not given');
97 return null;
98 } else if (!body || !p) {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -070099 $log.warn('adjustHeight: panel contents are not defined');
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700100 return null;
101 }
102
103 p.el().style('height', null);
104 body.style('height', null);
105
106 totalPHeight = fromTop + p.height();
107 avSpace = fs.windowSize(pdg).height;
108
109 if (totalPHeight >= avSpace) {
110 overflow = totalPHeight - avSpace;
111 }
112
113 function _adjustBody(height) {
114 if (height < 10) {
115 return false;
116 } else {
117 body.style('height', height + 'px');
118 }
119 return true;
120 }
121
122 if (!_adjustBody(fs.noPxStyle(body, 'height') - overflow)) {
123 return;
124 }
125
126 if (max && p.height() > max) {
127 _adjustBody(fs.noPxStyle(body, 'height') - (p.height() - max));
128 }
129 }
130
131 return {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700132 panel: panel,
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700133 setup: setup,
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700134 destroy: destroy,
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700135 appendHeader: hAppend,
136 appendBody: bAppend,
137 appendFooter: fAppend,
138 adjustHeight: adjustHeight
139 };
140 }
141
Simon Hunt08f841d02015-02-10 14:39:20 -0800142 // === -----------------------------------------------------
143 // Utility functions
Simon Hunt626d2102015-01-29 11:54:50 -0800144
Simon Hunt4b668592015-01-29 17:33:53 -0800145 function addSep(tbody) {
146 tbody.append('tr').append('td').attr('colspan', 2).append('hr');
147 }
148
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700149 function addBtnFooter() {
150 detail.appendFooter('hr');
151 detail.appendFooter('div').classed('actionBtns', true);
152 }
153
Simon Hunt4b668592015-01-29 17:33:53 -0800154 function addProp(tbody, label, value) {
Simon Hunte25c5a22015-04-02 14:37:12 -0700155 var tr = tbody.append('tr'),
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -0700156 lab;
157 if (typeof label === 'string') {
Simon Hunte25c5a22015-04-02 14:37:12 -0700158 lab = label.replace(/_/g, ' ');
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -0700159 } else {
160 lab = label;
161 }
Simon Hunt4b668592015-01-29 17:33:53 -0800162
163 function addCell(cls, txt) {
Simon Hunta36f03b2015-04-01 15:22:49 -0700164 tr.append('td').attr('class', cls).html(txt);
Simon Hunt4b668592015-01-29 17:33:53 -0800165 }
Simon Hunte25c5a22015-04-02 14:37:12 -0700166 addCell('label', lab + ' :');
Simon Hunt4b668592015-01-29 17:33:53 -0800167 addCell('value', value);
168 }
169
Simon Hunt08f841d02015-02-10 14:39:20 -0800170 function listProps(tbody, data) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700171 data.propOrder.forEach(function (p) {
Simon Hunt08f841d02015-02-10 14:39:20 -0800172 if (p === '-') {
173 addSep(tbody);
174 } else {
175 addProp(tbody, p, data.props[p]);
176 }
177 });
178 }
179
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700180 function watchWindow() {
Bri Prebilic Cole0a6ffb62015-06-04 09:32:12 -0700181 unbindWatch = $rootScope.$watchCollection(
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700182 function () {
183 return {
184 h: $window.innerHeight,
185 w: $window.innerWidth
186 };
187 }, function () {
188 summary.adjustHeight(sumFromTop, sumMax);
189 detail.adjustHeight(detail.ypos.current);
190 }
191 );
192 }
193
Simon Hunt08f841d02015-02-10 14:39:20 -0800194 // === -----------------------------------------------------
195 // Functions for populating the summary panel
196
197 function populateSummary(data) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700198 summary.setup();
Simon Hunt08f841d02015-02-10 14:39:20 -0800199
Bri Prebilic Cole8d3de3d2015-05-15 16:02:59 -0700200 var svg = summary.appendHeader('div')
201 .classed('icon', true)
202 .append('svg'),
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700203 title = summary.appendHeader('h2'),
204 table = summary.appendBody('table'),
Simon Hunt08f841d02015-02-10 14:39:20 -0800205 tbody = table.append('tbody');
206
207 gs.addGlyph(svg, 'node', 40);
208 gs.addGlyph(svg, 'bird', 24, true, [8,12]);
209
210 title.text(data.id);
211 listProps(tbody, data);
212 }
213
214 // === -----------------------------------------------------
215 // Functions for populating the detail panel
216
217 function displaySingle(data) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700218 detail.setup();
Simon Hunt08f841d02015-02-10 14:39:20 -0800219
Bri Prebilic Cole8d3de3d2015-05-15 16:02:59 -0700220 var svg = detail.appendHeader('div')
221 .classed('icon', true)
222 .append('svg'),
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700223 title = detail.appendHeader('h2'),
224 table = detail.appendBody('table'),
Simon Hunt08f841d02015-02-10 14:39:20 -0800225 tbody = table.append('tbody');
226
227 gs.addGlyph(svg, (data.type || 'unknown'), 40);
228 title.text(data.id);
229 listProps(tbody, data);
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700230 addBtnFooter();
Simon Hunt08f841d02015-02-10 14:39:20 -0800231 }
232
233 function displayMulti(ids) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700234 detail.setup();
Simon Hunt08f841d02015-02-10 14:39:20 -0800235
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700236 var title = detail.appendHeader('h3'),
237 table = detail.appendBody('table'),
Simon Hunt08f841d02015-02-10 14:39:20 -0800238 tbody = table.append('tbody');
239
240 title.text('Selected Nodes');
241 ids.forEach(function (d, i) {
242 addProp(tbody, i+1, d);
243 });
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700244 addBtnFooter();
Simon Hunt08f841d02015-02-10 14:39:20 -0800245 }
246
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -0700247 function addAction(o) {
248 var btnDiv = d3.select('#' + idDet)
249 .select('.actionBtns')
250 .append('div')
251 .classed('actionBtn', true);
252 bns.button(btnDiv, idDet + o.id, o.gid, o.cb, o.tt);
Simon Hunt08f841d02015-02-10 14:39:20 -0800253 }
254
Simon Hunta36f03b2015-04-01 15:22:49 -0700255 var friendlyIndex = {
256 device: 1,
257 host: 0
258 };
259
260 function friendly(d) {
261 var i = friendlyIndex[d.class] || 0;
262 return (d.labels && d.labels[i]) || '';
263 }
264
265 function linkSummary(d) {
266 var o = d && d.online ? 'online' : 'offline';
267 return d ? d.type + ' / ' + o : '-';
268 }
269
Simon Hunte25c5a22015-04-02 14:37:12 -0700270 // provided to change presentation of internal type name
271 var linkTypePres = {
272 hostLink: 'edge link'
273 };
274
275 function linkType(d) {
276 return linkTypePres[d.type()] || d.type();
277 }
278
279 var coreOrder = [
280 'Type', '-',
281 'A_type', 'A_id', 'A_label', 'A_port', '-',
282 'B_type', 'B_id', 'B_label', 'B_port', '-'
283 ],
284 edgeOrder = [
285 'Type', '-',
286 'A_type', 'A_id', 'A_label', '-',
287 'B_type', 'B_id', 'B_label', 'B_port'
288 ];
289
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700290 function displayLink(data) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700291 detail.setup();
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700292
Bri Prebilic Cole8d3de3d2015-05-15 16:02:59 -0700293 var svg = detail.appendHeader('div')
294 .classed('icon', true)
295 .append('svg'),
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700296 title = detail.appendHeader('h2'),
297 table = detail.appendBody('table'),
Simon Hunte25c5a22015-04-02 14:37:12 -0700298 tbody = table.append('tbody'),
299 edgeLink = data.type() === 'hostLink',
300 order = edgeLink ? edgeOrder : coreOrder;
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700301
302 gs.addGlyph(svg, 'ports', 40);
303 title.text('Link');
Simon Hunta36f03b2015-04-01 15:22:49 -0700304
Simon Hunta36f03b2015-04-01 15:22:49 -0700305
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700306 listProps(tbody, {
Simon Hunta36f03b2015-04-01 15:22:49 -0700307 propOrder: order,
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700308 props: {
Simon Hunte25c5a22015-04-02 14:37:12 -0700309 Type: linkType(data),
Simon Hunta36f03b2015-04-01 15:22:49 -0700310
311 A_type: data.source.class,
312 A_id: data.source.id,
313 A_label: friendly(data.source),
314 A_port: data.srcPort,
315
316 B_type: data.target.class,
317 B_id: data.target.id,
318 B_label: friendly(data.target),
319 B_port: data.tgtPort
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700320 }
321 });
Simon Hunta36f03b2015-04-01 15:22:49 -0700322
Simon Hunte25c5a22015-04-02 14:37:12 -0700323 if (!edgeLink) {
324 addProp(tbody, 'A &rarr; B', linkSummary(data.fromSource));
325 addProp(tbody, 'B &rarr; A', linkSummary(data.fromTarget));
326 }
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700327 }
328
329 function displayNothing() {
330 haveDetails = false;
331 hideDetailPanel();
332 }
333
334 function displaySomething() {
335 haveDetails = true;
336 if (useDetails) {
337 showDetailPanel();
338 }
339 }
340
Simon Hunt08f841d02015-02-10 14:39:20 -0800341 // === -----------------------------------------------------
342 // Event Handlers
343
344 function showSummary(data) {
345 populateSummary(data);
346 showSummaryPanel();
347 }
348
Simon Hunt36a58c62015-04-08 11:00:07 -0700349 function toggleSummary(x) {
Simon Huntee7a3ce2015-04-09 13:28:37 -0700350 var kev = (x === 'keyev'),
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700351 on = kev ? !summary.panel().isVisible() : !!x,
Simon Huntee7a3ce2015-04-09 13:28:37 -0700352 verb = on ? 'Show' : 'Hide';
Simon Hunt36a58c62015-04-08 11:00:07 -0700353
354 if (on) {
Simon Hunta0eb0a82015-02-11 12:30:06 -0800355 // ask server to start sending summary data.
Simon Hunt237676b52015-03-10 19:04:26 -0700356 wss.sendEvent('requestSummary');
Simon Hunta0eb0a82015-02-11 12:30:06 -0800357 // note: the summary panel will appear, once data arrives
Simon Hunt36a58c62015-04-08 11:00:07 -0700358 } else {
359 hideSummaryPanel();
Simon Hunt6036b192015-02-11 11:20:26 -0800360 }
Simon Huntee7a3ce2015-04-09 13:28:37 -0700361 flash.flash(verb + ' summary panel');
362 return on;
Simon Hunt6036b192015-02-11 11:20:26 -0800363 }
Simon Hunt08f841d02015-02-10 14:39:20 -0800364
365 // === -----------------------------------------------------
366 // === LOGIC For showing/hiding summary and detail panels...
367
Simon Hunt626d2102015-01-29 11:54:50 -0800368 function showSummaryPanel() {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700369 function _show() {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700370 summary.panel().show();
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700371 summary.adjustHeight(sumFromTop, sumMax);
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700372 }
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700373 if (detail.panel().isVisible()) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700374 detail.down(_show);
Simon Hunt6036b192015-02-11 11:20:26 -0800375 } else {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700376 _show();
Simon Hunt6036b192015-02-11 11:20:26 -0800377 }
Simon Huntc252aa62015-02-10 16:45:39 -0800378 }
379
380 function hideSummaryPanel() {
Simon Hunta0eb0a82015-02-11 12:30:06 -0800381 // instruct server to stop sending summary data
Simon Hunt237676b52015-03-10 19:04:26 -0700382 wss.sendEvent("cancelSummary");
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700383 summary.panel().hide(detail.up);
Simon Hunt4b668592015-01-29 17:33:53 -0800384 }
Simon Hunt626d2102015-01-29 11:54:50 -0800385
Simon Hunt08f841d02015-02-10 14:39:20 -0800386 function showDetailPanel() {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700387 if (summary.panel().isVisible()) {
388 detail.down(detail.panel().show);
Simon Hunt6036b192015-02-11 11:20:26 -0800389 } else {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700390 detail.up(detail.panel().show);
Simon Hunt6036b192015-02-11 11:20:26 -0800391 }
Simon Hunt08f841d02015-02-10 14:39:20 -0800392 }
393
394 function hideDetailPanel() {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700395 detail.panel().hide();
Simon Hunt08f841d02015-02-10 14:39:20 -0800396 }
397
Simon Hunt6036b192015-02-11 11:20:26 -0800398 // ==========================
Simon Hunt08f841d02015-02-10 14:39:20 -0800399
Simon Hunt6036b192015-02-11 11:20:26 -0800400 function augmentDetailPanel() {
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700401 var d = detail,
402 downPos = sumFromTop + sumMax + 20;
403 d.ypos = { up: sumFromTop, down: downPos, current: downPos};
Simon Hunt6036b192015-02-11 11:20:26 -0800404
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700405 d._move = function (y, cb) {
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700406 var yp = d.ypos,
407 endCb;
408
409 if (fs.isF(cb)) {
410 endCb = function () {
411 cb();
412 d.adjustHeight(d.ypos.current);
413 }
414 } else {
415 endCb = function () {
416 d.adjustHeight(d.ypos.current);
417 }
418 }
Simon Hunt6036b192015-02-11 11:20:26 -0800419 if (yp.current !== y) {
420 yp.current = y;
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700421 d.panel().el().transition().duration(300)
Simon Hunt6036b192015-02-11 11:20:26 -0800422 .each('end', endCb)
423 .style('top', yp.current + 'px');
424 } else {
425 endCb();
426 }
427 };
428
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700429 d.down = function (cb) { d._move(d.ypos.down, cb); };
430 d.up = function (cb) { d._move(d.ypos.up, cb); };
Simon Hunt6036b192015-02-11 11:20:26 -0800431 }
Simon Hunt08f841d02015-02-10 14:39:20 -0800432
Simon Hunt239e5882015-04-23 15:07:04 -0700433 function toggleUseDetailsFlag(x) {
Simon Huntee7a3ce2015-04-09 13:28:37 -0700434 var kev = (x === 'keyev'),
435 verb;
436
437 useDetails = kev ? !useDetails : !!x;
438 verb = useDetails ? 'Enable' : 'Disable';
439
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700440 if (useDetails) {
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700441 if (haveDetails) {
442 showDetailPanel();
443 }
444 } else {
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700445 hideDetailPanel();
446 }
Simon Huntee7a3ce2015-04-09 13:28:37 -0700447 flash.flash(verb + ' details panel');
448 return useDetails;
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700449 }
450
Simon Hunt4b668592015-01-29 17:33:53 -0800451 // ==========================
452
Simon Hunt237676b52015-03-10 19:04:26 -0700453 function initPanels() {
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700454 sumFromTop = mast.mastHeight() + padTop;
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700455 summary = createTopoPanel(idSum, panelOpts);
456 detail = createTopoPanel(idDet, panelOpts);
Simon Hunt6036b192015-02-11 11:20:26 -0800457
458 augmentDetailPanel();
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700459 watchWindow();
Simon Hunt4b668592015-01-29 17:33:53 -0800460 }
461
462 function destroyPanels() {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700463 summary.destroy();
464 summary = null;
465
466 detail.destroy();
467 detail = null;
Simon Hunt239e5882015-04-23 15:07:04 -0700468 haveDetails = false;
Bri Prebilic Cole0a6ffb62015-06-04 09:32:12 -0700469 unbindWatch();
Simon Hunt626d2102015-01-29 11:54:50 -0800470 }
471
472 // ==========================
473
Simon Huntb0ec1e52015-01-28 18:13:49 -0800474 angular.module('ovTopo')
475 .factory('TopoPanelService',
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700476 ['$log', '$window', '$rootScope', 'FnService', 'PanelService', 'GlyphService',
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700477 'FlashService', 'WebSocketService', 'ButtonService', 'MastService',
Simon Huntb0ec1e52015-01-28 18:13:49 -0800478
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700479 function (_$log_, _$window_, _$rootScope_,
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700480 _fs_, _ps_, _gs_, _flash_, _wss_, _bns_, _mast_) {
Simon Huntb0ec1e52015-01-28 18:13:49 -0800481 $log = _$log_;
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700482 $window = _$window_;
483 $rootScope = _$rootScope_;
Simon Hunt6036b192015-02-11 11:20:26 -0800484 fs = _fs_;
Simon Huntb0ec1e52015-01-28 18:13:49 -0800485 ps = _ps_;
Simon Huntc9b73162015-01-29 14:02:15 -0800486 gs = _gs_;
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700487 flash = _flash_;
Simon Hunt237676b52015-03-10 19:04:26 -0700488 wss = _wss_;
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -0700489 bns = _bns_;
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700490 mast = _mast_;
Simon Huntb0ec1e52015-01-28 18:13:49 -0800491
Simon Huntb0ec1e52015-01-28 18:13:49 -0800492 return {
493 initPanels: initPanels,
Simon Hunt626d2102015-01-29 11:54:50 -0800494 destroyPanels: destroyPanels,
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700495 createTopoPanel: createTopoPanel,
Simon Hunt08f841d02015-02-10 14:39:20 -0800496
497 showSummary: showSummary,
Simon Hunt6036b192015-02-11 11:20:26 -0800498 toggleSummary: toggleSummary,
Simon Hunt08f841d02015-02-10 14:39:20 -0800499
Simon Hunt239e5882015-04-23 15:07:04 -0700500 toggleUseDetailsFlag: toggleUseDetailsFlag,
Simon Hunt08f841d02015-02-10 14:39:20 -0800501 displaySingle: displaySingle,
502 displayMulti: displayMulti,
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700503 displayLink: displayLink,
504 displayNothing: displayNothing,
505 displaySomething: displaySomething,
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700506 addAction: addAction,
Simon Hunt08f841d02015-02-10 14:39:20 -0800507
Simon Huntc252aa62015-02-10 16:45:39 -0800508 hideSummaryPanel: hideSummaryPanel,
Simon Hunt08f841d02015-02-10 14:39:20 -0800509
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700510 detailVisible: function () { return detail.panel().isVisible(); },
511 summaryVisible: function () { return summary.panel().isVisible(); }
Simon Huntb0ec1e52015-01-28 18:13:49 -0800512 };
513 }]);
514}());