blob: e513b1f7b3bfa9d8505885f8e50958978a9bac87 [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
26 var $log, ps;
27
28 // internal state
29 var settings;
30
31
32 // SVG elements;
33 var fooPane;
34
35 // D3 selections;
36 var summaryPanel,
37 detailPanel,
38 instancePanel;
39
40 // default settings for force layout
41 var defaultSettings = {
42 foo: 2
43 };
44
45
46 // ==========================
47
48 angular.module('ovTopo')
49 .factory('TopoPanelService',
50 ['$log', 'PanelService',
51
52 function (_$log_, _ps_) {
53 $log = _$log_;
54 ps = _ps_;
55
56 function initPanels() {
57 summaryPanel = ps.createPanel('topo-p-summary');
58 // TODO: set up detail and instance panels..
59 }
60
61 function showSummary(payload) {
62 summaryPanel.empty();
63 summaryPanel.append('h2').text(payload.id);
64 // TODO: complete the formatting...
65
66 summaryPanel.show();
67 }
68
69 return {
70 initPanels: initPanels,
71 showSummary: showSummary
72 };
73 }]);
74}());