blob: 3bea0bc0ac3a30aef6d4d9c55c96a68c76f2c895 [file] [log] [blame]
Steven Burrows86af4352016-11-16 18:19:12 -06001/*
2 * Copyright 2016-present 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 View Module.
19 Module that displays the details panel for selected nodes
20 */
21
22(function () {
23 'use strict';
24
25 // Injected Services
26 var Panel;
27
28 // Internal State
29 var detailsPanel;
30
31 // configuration
32 var id = 'topo2-p-detail',
33 className = 'topo-p',
34 panelOpts = {
35 width: 260 // summary and detail panel width
36 };
37
38 function getInstance() {
39 if (detailsPanel) {
40 return detailsPanel;
41 }
42
43 var options = angular.extend({}, panelOpts, {
44 class: className
45 });
46
47 detailsPanel = new Panel(id, options);
48 detailsPanel.el.classed(className, true);
49
50 return detailsPanel;
51 }
52
53 angular.module('ovTopo2')
54 .factory('Topo2DetailsPanelService',
55 ['Topo2PanelService',
56 function (_ps_) {
57
58 Panel = _ps_;
59
60 return getInstance;
61 }
62 ]);
63})();