blob: cac87360f0d44d8d5fd27088b59771594ae6e5e0 [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 Hunt629b99e2015-07-27 17:38:33 -0700206 tbody = table.append('tbody'),
207 glyphId = data.type || 'node';
Simon Hunt08f841d02015-02-10 14:39:20 -0800208
Simon Hunt629b99e2015-07-27 17:38:33 -0700209 gs.addGlyph(svg, glyphId, 40);
210
211 if (glyphId === 'node') {
212 gs.addGlyph(svg, 'bird', 24, true, [8,12]);
213 }
Simon Hunt08f841d02015-02-10 14:39:20 -0800214
Simon Hunt0af1ec32015-07-24 12:17:55 -0700215 title.text(data.title);
Simon Hunt08f841d02015-02-10 14:39:20 -0800216 listProps(tbody, data);
217 }
218
219 // === -----------------------------------------------------
220 // Functions for populating the detail panel
221
222 function displaySingle(data) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700223 detail.setup();
Simon Hunt08f841d02015-02-10 14:39:20 -0800224
Bri Prebilic Cole8d3de3d2015-05-15 16:02:59 -0700225 var svg = detail.appendHeader('div')
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -0700226 .classed('icon clickable', true)
Bri Prebilic Cole8d3de3d2015-05-15 16:02:59 -0700227 .append('svg'),
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -0700228 title = detail.appendHeader('h2')
229 .classed('clickable', true),
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700230 table = detail.appendBody('table'),
Simon Hunt08f841d02015-02-10 14:39:20 -0800231 tbody = table.append('tbody');
232
233 gs.addGlyph(svg, (data.type || 'unknown'), 40);
234 title.text(data.id);
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -0700235 svg.on('click', function () {
236 ns.navTo(devPath, { devId: data.id });
237 });
238 title.on('click', function () {
239 ns.navTo(devPath, { devId: data.id });
240 });
241
Simon Hunt08f841d02015-02-10 14:39:20 -0800242 listProps(tbody, data);
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700243 addBtnFooter();
Simon Hunt08f841d02015-02-10 14:39:20 -0800244 }
245
246 function displayMulti(ids) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700247 detail.setup();
Simon Hunt08f841d02015-02-10 14:39:20 -0800248
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700249 var title = detail.appendHeader('h3'),
250 table = detail.appendBody('table'),
Simon Hunt08f841d02015-02-10 14:39:20 -0800251 tbody = table.append('tbody');
252
253 title.text('Selected Nodes');
254 ids.forEach(function (d, i) {
255 addProp(tbody, i+1, d);
256 });
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700257 addBtnFooter();
Simon Hunt08f841d02015-02-10 14:39:20 -0800258 }
259
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -0700260 function addAction(o) {
261 var btnDiv = d3.select('#' + idDet)
262 .select('.actionBtns')
263 .append('div')
264 .classed('actionBtn', true);
265 bns.button(btnDiv, idDet + o.id, o.gid, o.cb, o.tt);
Simon Hunt08f841d02015-02-10 14:39:20 -0800266 }
267
Simon Hunta36f03b2015-04-01 15:22:49 -0700268 var friendlyIndex = {
269 device: 1,
270 host: 0
271 };
272
273 function friendly(d) {
274 var i = friendlyIndex[d.class] || 0;
275 return (d.labels && d.labels[i]) || '';
276 }
277
278 function linkSummary(d) {
279 var o = d && d.online ? 'online' : 'offline';
280 return d ? d.type + ' / ' + o : '-';
281 }
282
Simon Hunte25c5a22015-04-02 14:37:12 -0700283 // provided to change presentation of internal type name
284 var linkTypePres = {
285 hostLink: 'edge link'
286 };
287
288 function linkType(d) {
289 return linkTypePres[d.type()] || d.type();
290 }
291
292 var coreOrder = [
293 'Type', '-',
294 'A_type', 'A_id', 'A_label', 'A_port', '-',
295 'B_type', 'B_id', 'B_label', 'B_port', '-'
296 ],
297 edgeOrder = [
298 'Type', '-',
299 'A_type', 'A_id', 'A_label', '-',
300 'B_type', 'B_id', 'B_label', 'B_port'
301 ];
302
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700303 function displayLink(data) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700304 detail.setup();
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700305
Bri Prebilic Cole8d3de3d2015-05-15 16:02:59 -0700306 var svg = detail.appendHeader('div')
307 .classed('icon', true)
308 .append('svg'),
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700309 title = detail.appendHeader('h2'),
310 table = detail.appendBody('table'),
Simon Hunte25c5a22015-04-02 14:37:12 -0700311 tbody = table.append('tbody'),
312 edgeLink = data.type() === 'hostLink',
313 order = edgeLink ? edgeOrder : coreOrder;
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700314
315 gs.addGlyph(svg, 'ports', 40);
316 title.text('Link');
Simon Hunta36f03b2015-04-01 15:22:49 -0700317
Simon Hunta36f03b2015-04-01 15:22:49 -0700318
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700319 listProps(tbody, {
Simon Hunta36f03b2015-04-01 15:22:49 -0700320 propOrder: order,
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700321 props: {
Simon Hunte25c5a22015-04-02 14:37:12 -0700322 Type: linkType(data),
Simon Hunta36f03b2015-04-01 15:22:49 -0700323
324 A_type: data.source.class,
325 A_id: data.source.id,
326 A_label: friendly(data.source),
327 A_port: data.srcPort,
328
329 B_type: data.target.class,
330 B_id: data.target.id,
331 B_label: friendly(data.target),
332 B_port: data.tgtPort
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700333 }
334 });
Simon Hunta36f03b2015-04-01 15:22:49 -0700335
Simon Hunte25c5a22015-04-02 14:37:12 -0700336 if (!edgeLink) {
337 addProp(tbody, 'A &rarr; B', linkSummary(data.fromSource));
338 addProp(tbody, 'B &rarr; A', linkSummary(data.fromTarget));
339 }
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700340 }
341
342 function displayNothing() {
343 haveDetails = false;
344 hideDetailPanel();
345 }
346
347 function displaySomething() {
348 haveDetails = true;
349 if (useDetails) {
350 showDetailPanel();
351 }
352 }
353
Simon Hunt08f841d02015-02-10 14:39:20 -0800354 // === -----------------------------------------------------
355 // Event Handlers
356
357 function showSummary(data) {
358 populateSummary(data);
359 showSummaryPanel();
360 }
361
Simon Hunt36a58c62015-04-08 11:00:07 -0700362 function toggleSummary(x) {
Simon Huntee7a3ce2015-04-09 13:28:37 -0700363 var kev = (x === 'keyev'),
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700364 on = kev ? !summary.panel().isVisible() : !!x,
Simon Huntee7a3ce2015-04-09 13:28:37 -0700365 verb = on ? 'Show' : 'Hide';
Simon Hunt36a58c62015-04-08 11:00:07 -0700366
367 if (on) {
Simon Hunta0eb0a82015-02-11 12:30:06 -0800368 // ask server to start sending summary data.
Simon Hunt237676b52015-03-10 19:04:26 -0700369 wss.sendEvent('requestSummary');
Simon Hunta0eb0a82015-02-11 12:30:06 -0800370 // note: the summary panel will appear, once data arrives
Simon Hunt36a58c62015-04-08 11:00:07 -0700371 } else {
372 hideSummaryPanel();
Simon Hunt6036b192015-02-11 11:20:26 -0800373 }
Simon Huntee7a3ce2015-04-09 13:28:37 -0700374 flash.flash(verb + ' summary panel');
375 return on;
Simon Hunt6036b192015-02-11 11:20:26 -0800376 }
Simon Hunt08f841d02015-02-10 14:39:20 -0800377
378 // === -----------------------------------------------------
379 // === LOGIC For showing/hiding summary and detail panels...
380
Simon Hunt626d2102015-01-29 11:54:50 -0800381 function showSummaryPanel() {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700382 function _show() {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700383 summary.panel().show();
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700384 summary.adjustHeight(sumFromTop, sumMax);
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700385 }
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700386 if (detail.panel().isVisible()) {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700387 detail.down(_show);
Simon Hunt6036b192015-02-11 11:20:26 -0800388 } else {
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700389 _show();
Simon Hunt6036b192015-02-11 11:20:26 -0800390 }
Simon Huntc252aa62015-02-10 16:45:39 -0800391 }
392
393 function hideSummaryPanel() {
Simon Hunta0eb0a82015-02-11 12:30:06 -0800394 // instruct server to stop sending summary data
Simon Hunt237676b52015-03-10 19:04:26 -0700395 wss.sendEvent("cancelSummary");
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700396 summary.panel().hide(detail.up);
Simon Hunt4b668592015-01-29 17:33:53 -0800397 }
Simon Hunt626d2102015-01-29 11:54:50 -0800398
Simon Hunt08f841d02015-02-10 14:39:20 -0800399 function showDetailPanel() {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700400 if (summary.panel().isVisible()) {
401 detail.down(detail.panel().show);
Simon Hunt6036b192015-02-11 11:20:26 -0800402 } else {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700403 detail.up(detail.panel().show);
Simon Hunt6036b192015-02-11 11:20:26 -0800404 }
Simon Hunt08f841d02015-02-10 14:39:20 -0800405 }
406
407 function hideDetailPanel() {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700408 detail.panel().hide();
Simon Hunt08f841d02015-02-10 14:39:20 -0800409 }
410
Simon Hunt6036b192015-02-11 11:20:26 -0800411 // ==========================
Simon Hunt08f841d02015-02-10 14:39:20 -0800412
Simon Hunt6036b192015-02-11 11:20:26 -0800413 function augmentDetailPanel() {
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700414 var d = detail,
415 downPos = sumFromTop + sumMax + 20;
416 d.ypos = { up: sumFromTop, down: downPos, current: downPos};
Simon Hunt6036b192015-02-11 11:20:26 -0800417
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700418 d._move = function (y, cb) {
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700419 var yp = d.ypos,
420 endCb;
421
422 if (fs.isF(cb)) {
423 endCb = function () {
424 cb();
425 d.adjustHeight(d.ypos.current);
426 }
427 } else {
428 endCb = function () {
429 d.adjustHeight(d.ypos.current);
430 }
431 }
Simon Hunt6036b192015-02-11 11:20:26 -0800432 if (yp.current !== y) {
433 yp.current = y;
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700434 d.panel().el().transition().duration(300)
Simon Hunt6036b192015-02-11 11:20:26 -0800435 .each('end', endCb)
436 .style('top', yp.current + 'px');
437 } else {
438 endCb();
439 }
440 };
441
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700442 d.down = function (cb) { d._move(d.ypos.down, cb); };
443 d.up = function (cb) { d._move(d.ypos.up, cb); };
Simon Hunt6036b192015-02-11 11:20:26 -0800444 }
Simon Hunt08f841d02015-02-10 14:39:20 -0800445
Simon Hunt239e5882015-04-23 15:07:04 -0700446 function toggleUseDetailsFlag(x) {
Simon Huntee7a3ce2015-04-09 13:28:37 -0700447 var kev = (x === 'keyev'),
448 verb;
449
450 useDetails = kev ? !useDetails : !!x;
451 verb = useDetails ? 'Enable' : 'Disable';
452
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700453 if (useDetails) {
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700454 if (haveDetails) {
455 showDetailPanel();
456 }
457 } else {
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700458 hideDetailPanel();
459 }
Simon Huntee7a3ce2015-04-09 13:28:37 -0700460 flash.flash(verb + ' details panel');
461 return useDetails;
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700462 }
463
Simon Hunt4b668592015-01-29 17:33:53 -0800464 // ==========================
465
Simon Hunt237676b52015-03-10 19:04:26 -0700466 function initPanels() {
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700467 sumFromTop = mast.mastHeight() + padTop;
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700468 summary = createTopoPanel(idSum, panelOpts);
469 detail = createTopoPanel(idDet, panelOpts);
Simon Hunt6036b192015-02-11 11:20:26 -0800470
471 augmentDetailPanel();
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700472 watchWindow();
Simon Hunt4b668592015-01-29 17:33:53 -0800473 }
474
475 function destroyPanels() {
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700476 summary.destroy();
477 summary = null;
478
479 detail.destroy();
480 detail = null;
Simon Hunt239e5882015-04-23 15:07:04 -0700481 haveDetails = false;
Bri Prebilic Cole0a6ffb62015-06-04 09:32:12 -0700482 unbindWatch();
Simon Hunt626d2102015-01-29 11:54:50 -0800483 }
484
485 // ==========================
486
Simon Huntb0ec1e52015-01-28 18:13:49 -0800487 angular.module('ovTopo')
488 .factory('TopoPanelService',
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700489 ['$log', '$window', '$rootScope', 'FnService', 'PanelService', 'GlyphService',
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700490 'FlashService', 'WebSocketService', 'ButtonService', 'MastService',
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -0700491 'NavService',
Simon Huntb0ec1e52015-01-28 18:13:49 -0800492
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700493 function (_$log_, _$window_, _$rootScope_,
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -0700494 _fs_, _ps_, _gs_, _flash_, _wss_, _bns_, _mast_, _ns_) {
Simon Huntb0ec1e52015-01-28 18:13:49 -0800495 $log = _$log_;
Bri Prebilic Cole69d5f4e2015-05-19 15:59:55 -0700496 $window = _$window_;
497 $rootScope = _$rootScope_;
Simon Hunt6036b192015-02-11 11:20:26 -0800498 fs = _fs_;
Simon Huntb0ec1e52015-01-28 18:13:49 -0800499 ps = _ps_;
Simon Huntc9b73162015-01-29 14:02:15 -0800500 gs = _gs_;
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700501 flash = _flash_;
Simon Hunt237676b52015-03-10 19:04:26 -0700502 wss = _wss_;
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -0700503 bns = _bns_;
Bri Prebilic Coled8745462015-06-01 16:08:57 -0700504 mast = _mast_;
Bri Prebilic Cole17c6d0a2015-07-16 14:56:40 -0700505 ns = _ns_;
Simon Huntb0ec1e52015-01-28 18:13:49 -0800506
Simon Huntb0ec1e52015-01-28 18:13:49 -0800507 return {
508 initPanels: initPanels,
Simon Hunt626d2102015-01-29 11:54:50 -0800509 destroyPanels: destroyPanels,
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700510 createTopoPanel: createTopoPanel,
Simon Hunt08f841d02015-02-10 14:39:20 -0800511
512 showSummary: showSummary,
Simon Hunt6036b192015-02-11 11:20:26 -0800513 toggleSummary: toggleSummary,
Simon Hunt08f841d02015-02-10 14:39:20 -0800514
Simon Hunt239e5882015-04-23 15:07:04 -0700515 toggleUseDetailsFlag: toggleUseDetailsFlag,
Simon Hunt08f841d02015-02-10 14:39:20 -0800516 displaySingle: displaySingle,
517 displayMulti: displayMulti,
Simon Hunt0c6b2d32015-03-26 17:46:29 -0700518 displayLink: displayLink,
519 displayNothing: displayNothing,
520 displaySomething: displaySomething,
Bri Prebilic Cole684bcb72015-05-11 12:00:24 -0700521 addAction: addAction,
Simon Hunt08f841d02015-02-10 14:39:20 -0800522
Simon Huntc252aa62015-02-10 16:45:39 -0800523 hideSummaryPanel: hideSummaryPanel,
Simon Hunt08f841d02015-02-10 14:39:20 -0800524
Bri Prebilic Cole35d29712015-05-11 16:01:32 -0700525 detailVisible: function () { return detail.panel().isVisible(); },
526 summaryVisible: function () { return summary.panel().isVisible(); }
Simon Huntb0ec1e52015-01-28 18:13:49 -0800527 };
528 }]);
529}());