Committed by
Gerrit Code Review
GUI -- deleted old files.
Change-Id: I3a504fe7e0597ae1d1bb1f659cd70b0611cadda4
Showing
32 changed files
with
0 additions
and
1345 deletions
1 | -/* | ||
2 | - * Copyright 2014 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 | - Geometry library - based on work by Mike Bostock. | ||
19 | - */ | ||
20 | - | ||
21 | -(function() { | ||
22 | - | ||
23 | - if (typeof geo == 'undefined') { | ||
24 | - geo = {}; | ||
25 | - } | ||
26 | - | ||
27 | - var tolerance = 1e-10; | ||
28 | - | ||
29 | - function eq(a, b) { | ||
30 | - return (Math.abs(a - b) < tolerance); | ||
31 | - } | ||
32 | - | ||
33 | - function gt(a, b) { | ||
34 | - return (a - b > -tolerance); | ||
35 | - } | ||
36 | - | ||
37 | - function lt(a, b) { | ||
38 | - return gt(b, a); | ||
39 | - } | ||
40 | - | ||
41 | - geo.eq = eq; | ||
42 | - geo.gt = gt; | ||
43 | - geo.lt = lt; | ||
44 | - | ||
45 | - geo.LineSegment = function(x1, y1, x2, y2) { | ||
46 | - this.x1 = x1; | ||
47 | - this.y1 = y1; | ||
48 | - this.x2 = x2; | ||
49 | - this.y2 = y2; | ||
50 | - | ||
51 | - // Ax + By = C | ||
52 | - this.a = y2 - y1; | ||
53 | - this.b = x1 - x2; | ||
54 | - this.c = x1 * this.a + y1 * this.b; | ||
55 | - | ||
56 | - if (eq(this.a, 0) && eq(this.b, 0)) { | ||
57 | - throw new Error( | ||
58 | - 'Cannot construct a LineSegment with two equal endpoints.'); | ||
59 | - } | ||
60 | - }; | ||
61 | - | ||
62 | - geo.LineSegment.prototype.intersect = function(that) { | ||
63 | - var d = (this.x1 - this.x2) * (that.y1 - that.y2) - | ||
64 | - (this.y1 - this.y2) * (that.x1 - that.x2); | ||
65 | - | ||
66 | - if (eq(d, 0)) { | ||
67 | - // The two lines are parallel or very close. | ||
68 | - return { | ||
69 | - x : NaN, | ||
70 | - y : NaN | ||
71 | - }; | ||
72 | - } | ||
73 | - | ||
74 | - var t1 = this.x1 * this.y2 - this.y1 * this.x2, | ||
75 | - t2 = that.x1 * that.y2 - that.y1 * that.x2, | ||
76 | - x = (t1 * (that.x1 - that.x2) - t2 * (this.x1 - this.x2)) / d, | ||
77 | - y = (t1 * (that.y1 - that.y2) - t2 * (this.y1 - this.y2)) / d, | ||
78 | - in1 = (gt(x, Math.min(this.x1, this.x2)) && lt(x, Math.max(this.x1, this.x2)) && | ||
79 | - gt(y, Math.min(this.y1, this.y2)) && lt(y, Math.max(this.y1, this.y2))), | ||
80 | - in2 = (gt(x, Math.min(that.x1, that.x2)) && lt(x, Math.max(that.x1, that.x2)) && | ||
81 | - gt(y, Math.min(that.y1, that.y2)) && lt(y, Math.max(that.y1, that.y2))); | ||
82 | - | ||
83 | - return { | ||
84 | - x : x, | ||
85 | - y : y, | ||
86 | - in1 : in1, | ||
87 | - in2 : in2 | ||
88 | - }; | ||
89 | - }; | ||
90 | - | ||
91 | - geo.LineSegment.prototype.x = function(y) { | ||
92 | - // x = (C - By) / a; | ||
93 | - if (this.a) { | ||
94 | - return (this.c - this.b * y) / this.a; | ||
95 | - } else { | ||
96 | - // a == 0 -> horizontal line | ||
97 | - return NaN; | ||
98 | - } | ||
99 | - }; | ||
100 | - | ||
101 | - geo.LineSegment.prototype.y = function(x) { | ||
102 | - // y = (C - Ax) / b; | ||
103 | - if (this.b) { | ||
104 | - return (this.c - this.a * x) / this.b; | ||
105 | - } else { | ||
106 | - // b == 0 -> vertical line | ||
107 | - return NaN; | ||
108 | - } | ||
109 | - }; | ||
110 | - | ||
111 | - geo.LineSegment.prototype.length = function() { | ||
112 | - return Math.sqrt( | ||
113 | - (this.y2 - this.y1) * (this.y2 - this.y1) + | ||
114 | - (this.x2 - this.x1) * (this.x2 - this.x1)); | ||
115 | - }; | ||
116 | - | ||
117 | - geo.LineSegment.prototype.offset = function(x, y) { | ||
118 | - return new geo.LineSegment( | ||
119 | - this.x1 + x, this.y1 + y, | ||
120 | - this.x2 + x, this.y2 + y); | ||
121 | - }; | ||
122 | - | ||
123 | -})(); |
1 | -<!DOCTYPE html> | ||
2 | -<!-- | ||
3 | - ~ Copyright 2014 Open Networking Laboratory | ||
4 | - ~ | ||
5 | - ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | - ~ you may not use this file except in compliance with the License. | ||
7 | - ~ You may obtain a copy of the License at | ||
8 | - ~ | ||
9 | - ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | - ~ | ||
11 | - ~ Unless required by applicable law or agreed to in writing, software | ||
12 | - ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | - ~ See the License for the specific language governing permissions and | ||
15 | - ~ limitations under the License. | ||
16 | - --> | ||
17 | - | ||
18 | -<!-- | ||
19 | - ONOS UI - single page web app | ||
20 | - | ||
21 | - @author Simon Hunt | ||
22 | - --> | ||
23 | -<html> | ||
24 | -<head> | ||
25 | - <meta charset="utf-8"> | ||
26 | - <title>ONOS GUI</title> | ||
27 | - | ||
28 | - <!--TODO: use the minified version of d3, once debugging is complete --> | ||
29 | - <script src="../tp/d3.js"></script> | ||
30 | - <script src="../tp/jquery-2.1.1.min.js"></script> | ||
31 | - | ||
32 | - <link rel="stylesheet" href="../base.css"> | ||
33 | - <link rel="stylesheet" href="onos.css"> | ||
34 | - | ||
35 | - <script src="../geometry.js"></script> | ||
36 | - <script src="onos.js"></script> | ||
37 | - | ||
38 | -</head> | ||
39 | -<body> | ||
40 | - <div id="frame"> | ||
41 | - <div id="mast"> | ||
42 | - <img id="logo" src="../img/onos-logo.png"> | ||
43 | - <span class="title">Open Network Operating System</span> | ||
44 | - <span id="displayModes" class="right"> | ||
45 | - <span id="showAll" class="radio active">All Layers</span> | ||
46 | - <span id="showPkt" class="radio">Packet Only</span> | ||
47 | - <span id="showOpt" class="radio">Optical Only</span> | ||
48 | - </span> | ||
49 | - </div> | ||
50 | - <div id="view"> | ||
51 | - <!-- NOTE: svg layer injected here --> | ||
52 | - </div> | ||
53 | - <div id="flyout"></div> | ||
54 | - </div> | ||
55 | - | ||
56 | - <!-- Initialize the UI...--> | ||
57 | - <script type="text/javascript"> | ||
58 | - var ONOS = $.onos({note: "config, if needed"}); | ||
59 | - </script> | ||
60 | - | ||
61 | - <!-- include module files--> | ||
62 | - <!-- + mast.js--> | ||
63 | - <!-- + nav.js--> | ||
64 | - <!-- + .... application views--> | ||
65 | - | ||
66 | - <!-- for now, we are just bootstrapping the network visualization--> | ||
67 | - <script src="network.js" type="text/javascript"></script> | ||
68 | - | ||
69 | - <!-- finally, build the UI--> | ||
70 | - <script type="text/javascript"> | ||
71 | - $(ONOS.buildUi); | ||
72 | - </script> | ||
73 | - | ||
74 | -</body> | ||
75 | -</html> |
1 | -{ | ||
2 | - "meta": { | ||
3 | - "comments": [ | ||
4 | - "This is sample data for developing the ONOS UI (network view)", | ||
5 | - " in a standalone mode (no server required).", | ||
6 | - " Eventually, we will wire this up to live data", | ||
7 | - " from the server, via a websocket.", | ||
8 | - "", | ||
9 | - "Note that this is just a first-draft of the data --", | ||
10 | - " additional fields will be added when they are needed." | ||
11 | - ], | ||
12 | - "otherMetaData": "can go here..." | ||
13 | - }, | ||
14 | - "devices": [ | ||
15 | - { | ||
16 | - "id": "of:0000000000000001", | ||
17 | - "labels": ["00:00:00:00:00:00:00:01", "SFO-W10", "opt-1"], | ||
18 | - "type": "roadm" | ||
19 | - }, | ||
20 | - { | ||
21 | - "id": "of:0000000000000002", | ||
22 | - "labels": ["00:00:00:00:00:00:00:02", "SJC-W10", "opt-2"], | ||
23 | - "type": "roadm" | ||
24 | - }, | ||
25 | - { | ||
26 | - "id": "of:0000000000000003", | ||
27 | - "labels": ["00:00:00:00:00:00:00:03", "LAX-W10", "opt-3"], | ||
28 | - "type": "roadm" | ||
29 | - }, | ||
30 | - { | ||
31 | - "id": "of:0000000000000004", | ||
32 | - "labels": ["00:00:00:00:00:00:00:04", "SDG-W10", "opt-4"], | ||
33 | - "type": "roadm" | ||
34 | - }, | ||
35 | - { | ||
36 | - "id": "of:0000000000000011", | ||
37 | - "labels": ["00:00:00:00:00:00:00:11", "SFO-pkt", "pkt-11"], | ||
38 | - "type": "switch" | ||
39 | - }, | ||
40 | - { | ||
41 | - "id": "of:0000000000000012", | ||
42 | - "labels": ["00:00:00:00:00:00:00:12", "SJC-pkt", "pkt-12"], | ||
43 | - "type": "switch" | ||
44 | - }, | ||
45 | - { | ||
46 | - "id": "of:0000000000000013", | ||
47 | - "labels": ["00:00:00:00:00:00:00:13", "LAX-pkt", "pkt-13"], | ||
48 | - "type": "switch" | ||
49 | - } | ||
50 | - ], | ||
51 | - "linkNotes": [ | ||
52 | - "even though we have 'directionality' (src/dst), each link is", | ||
53 | - " considered to be bi-directional. Note that links between hosts", | ||
54 | - " and edge switches are inferred from host information, and not", | ||
55 | - " explicitly represented here." | ||
56 | - ], | ||
57 | - "links": [ | ||
58 | - { | ||
59 | - "src": "of:0000000000000001", | ||
60 | - "dst": "of:0000000000000002", | ||
61 | - "type": "optical", | ||
62 | - "srcPort": 1, | ||
63 | - "dstPort": 2, | ||
64 | - "linkWidth": 1.5 | ||
65 | - }, | ||
66 | - { | ||
67 | - "src": "of:0000000000000001", | ||
68 | - "dst": "of:0000000000000003", | ||
69 | - "type": "optical", | ||
70 | - "srcPort": 2, | ||
71 | - "dstPort": 5, | ||
72 | - "linkWidth": 1.5 | ||
73 | - }, | ||
74 | - { | ||
75 | - "src": "of:0000000000000001", | ||
76 | - "dst": "of:0000000000000004", | ||
77 | - "type": "optical", | ||
78 | - "srcPort": 3, | ||
79 | - "dstPort": 2, | ||
80 | - "linkWidth": 1.5 | ||
81 | - }, | ||
82 | - { | ||
83 | - "src": "of:0000000000000002", | ||
84 | - "dst": "of:0000000000000003", | ||
85 | - "type": "optical", | ||
86 | - "srcPort": 3, | ||
87 | - "dstPort": 4, | ||
88 | - "linkWidth": 1.5 | ||
89 | - }, | ||
90 | - { | ||
91 | - "src": "of:0000000000000002", | ||
92 | - "dst": "of:0000000000000004", | ||
93 | - "type": "optical", | ||
94 | - "srcPort": 4, | ||
95 | - "dstPort": 1, | ||
96 | - "linkWidth": 1.5 | ||
97 | - }, | ||
98 | - { | ||
99 | - "src": "of:0000000000000003", | ||
100 | - "dst": "of:0000000000000004", | ||
101 | - "type": "optical", | ||
102 | - "srcPort": 3, | ||
103 | - "dstPort": 3, | ||
104 | - "linkWidth": 1.5 | ||
105 | - }, | ||
106 | - { | ||
107 | - "src": "of:0000000000000013", | ||
108 | - "dst": "of:0000000000000003", | ||
109 | - "type": "direct", | ||
110 | - "srcPort": 1, | ||
111 | - "dstPort": 7, | ||
112 | - "linkWidth": 1.0 | ||
113 | - }, | ||
114 | - { | ||
115 | - "src": "of:0000000000000012", | ||
116 | - "dst": "of:0000000000000002", | ||
117 | - "type": "direct", | ||
118 | - "srcPort": 1, | ||
119 | - "dstPort": 9, | ||
120 | - "linkWidth": 1.0 | ||
121 | - }, | ||
122 | - { | ||
123 | - "src": "of:0000000000000011", | ||
124 | - "dst": "of:0000000000000001", | ||
125 | - "type": "direct", | ||
126 | - "srcPort": 1, | ||
127 | - "dstPort": 6, | ||
128 | - "linkWidth": 1.0 | ||
129 | - } | ||
130 | - ], | ||
131 | - "hosts": [ | ||
132 | - { | ||
133 | - "id": "00:60:d3:00:11:01/7", | ||
134 | - "labels": ["00:60:d3:00:11:01/7", "Host-11-A"], | ||
135 | - "cp" : { | ||
136 | - "device": "of:0000000000000011", | ||
137 | - "port": 6 | ||
138 | - } | ||
139 | - }, | ||
140 | - { | ||
141 | - "id": "00:60:d3:00:11:02/7", | ||
142 | - "labels": ["00:60:d3:00:11:02/7", "Host-11-B"], | ||
143 | - "cp" : { | ||
144 | - "device": "of:0000000000000011", | ||
145 | - "port": 8 | ||
146 | - } | ||
147 | - }, | ||
148 | - { | ||
149 | - "id": "00:60:d3:00:12:01/4", | ||
150 | - "labels": ["00:60:d3:00:12:01/4", "Host-12-C"], | ||
151 | - "cp" : { | ||
152 | - "device": "of:0000000000000012", | ||
153 | - "port": 12 | ||
154 | - } | ||
155 | - }, | ||
156 | - { | ||
157 | - "id": "00:60:d3:00:12:02/4", | ||
158 | - "labels": ["00:60:d3:00:12:02/4", "Host-12-D"], | ||
159 | - "cp" : { | ||
160 | - "device": "of:0000000000000012", | ||
161 | - "port": 13 | ||
162 | - } | ||
163 | - }, | ||
164 | - { | ||
165 | - "id": "00:60:d3:00:13:01/19", | ||
166 | - "labels": ["00:60:d3:00:13:01/19", "Host-13-E"], | ||
167 | - "cp" : { | ||
168 | - "device": "of:0000000000000013", | ||
169 | - "port": 7 | ||
170 | - } | ||
171 | - }, | ||
172 | - { | ||
173 | - "id": "00:60:d3:00:13:02/19", | ||
174 | - "labels": ["00:60:d3:00:13:02/19", "Host-13-F"], | ||
175 | - "cp" : { | ||
176 | - "device": "of:0000000000000013", | ||
177 | - "port": 8 | ||
178 | - } | ||
179 | - } | ||
180 | - ] | ||
181 | -} |
1 | -{ | ||
2 | - "devices": [ | ||
3 | - { | ||
4 | - "id": "of:0000ffffffffff08", | ||
5 | - "type": "roadm", | ||
6 | - "online": false, | ||
7 | - "labels": [ | ||
8 | - "0000ffffffffff08", | ||
9 | - "FF:FF:FF:FF:FF:08", | ||
10 | - "?" | ||
11 | - ] | ||
12 | - }, | ||
13 | - { | ||
14 | - "id": "of:0000ffffffffff03", | ||
15 | - "type": "roadm", | ||
16 | - "online": false, | ||
17 | - "labels": [ | ||
18 | - "0000ffffffffff03", | ||
19 | - "FF:FF:FF:FF:FF:03", | ||
20 | - "?" | ||
21 | - ] | ||
22 | - }, | ||
23 | - { | ||
24 | - "id": "of:0000ffffffffff02", | ||
25 | - "type": "roadm", | ||
26 | - "online": false, | ||
27 | - "labels": [ | ||
28 | - "0000ffffffffff02", | ||
29 | - "FF:FF:FF:FF:FF:02", | ||
30 | - "?" | ||
31 | - ] | ||
32 | - }, | ||
33 | - { | ||
34 | - "id": "of:0000ffffffff0003", | ||
35 | - "type": "switch", | ||
36 | - "online": false, | ||
37 | - "labels": [ | ||
38 | - "0000ffffffff0003", | ||
39 | - "FF:FF:FF:FF:00:03", | ||
40 | - "?" | ||
41 | - ] | ||
42 | - }, | ||
43 | - { | ||
44 | - "id": "of:0000ffffffffff07", | ||
45 | - "type": "roadm", | ||
46 | - "online": false, | ||
47 | - "labels": [ | ||
48 | - "0000ffffffffff07", | ||
49 | - "FF:FF:FF:FF:FF:07", | ||
50 | - "?" | ||
51 | - ] | ||
52 | - }, | ||
53 | - { | ||
54 | - "id": "of:0000ffffffffff06", | ||
55 | - "type": "roadm", | ||
56 | - "online": false, | ||
57 | - "labels": [ | ||
58 | - "0000ffffffffff06", | ||
59 | - "FF:FF:FF:FF:FF:06", | ||
60 | - "?" | ||
61 | - ] | ||
62 | - }, | ||
63 | - { | ||
64 | - "id": "of:0000ffffffff0007", | ||
65 | - "type": "switch", | ||
66 | - "online": false, | ||
67 | - "labels": [ | ||
68 | - "0000ffffffff0007", | ||
69 | - "FF:FF:FF:FF:00:07", | ||
70 | - "?" | ||
71 | - ] | ||
72 | - }, | ||
73 | - { | ||
74 | - "id": "of:0000ffffffffff05", | ||
75 | - "type": "roadm", | ||
76 | - "online": false, | ||
77 | - "labels": [ | ||
78 | - "0000ffffffffff05", | ||
79 | - "FF:FF:FF:FF:FF:05", | ||
80 | - "?" | ||
81 | - ] | ||
82 | - }, | ||
83 | - { | ||
84 | - "id": "of:0000ffffffff0009", | ||
85 | - "type": "switch", | ||
86 | - "online": false, | ||
87 | - "labels": [ | ||
88 | - "0000ffffffff0009", | ||
89 | - "FF:FF:FF:FF:00:09", | ||
90 | - "?" | ||
91 | - ] | ||
92 | - }, | ||
93 | - { | ||
94 | - "id": "of:0000ffffffffff04", | ||
95 | - "type": "roadm", | ||
96 | - "online": false, | ||
97 | - "labels": [ | ||
98 | - "0000ffffffffff04", | ||
99 | - "FF:FF:FF:FF:FF:04", | ||
100 | - "?" | ||
101 | - ] | ||
102 | - }, | ||
103 | - { | ||
104 | - "id": "of:0000ffffffff000A", | ||
105 | - "type": "switch", | ||
106 | - "online": false, | ||
107 | - "labels": [ | ||
108 | - "0000ffffffff000A", | ||
109 | - "FF:FF:FF:FF:00:0A", | ||
110 | - "?" | ||
111 | - ] | ||
112 | - }, | ||
113 | - { | ||
114 | - "id": "of:0000ffffffff0001", | ||
115 | - "type": "switch", | ||
116 | - "online": false, | ||
117 | - "labels": [ | ||
118 | - "0000ffffffff0001", | ||
119 | - "FF:FF:FF:FF:00:01", | ||
120 | - "?" | ||
121 | - ] | ||
122 | - }, | ||
123 | - { | ||
124 | - "id": "of:0000ffffffffff01", | ||
125 | - "type": "roadm", | ||
126 | - "online": false, | ||
127 | - "labels": [ | ||
128 | - "0000ffffffffff01", | ||
129 | - "FF:FF:FF:FF:FF:01", | ||
130 | - "?" | ||
131 | - ] | ||
132 | - }, | ||
133 | - { | ||
134 | - "id": "of:0000ffffffff0004", | ||
135 | - "type": "switch", | ||
136 | - "online": false, | ||
137 | - "labels": [ | ||
138 | - "0000ffffffff0004", | ||
139 | - "FF:FF:FF:FF:00:04", | ||
140 | - "?" | ||
141 | - ] | ||
142 | - }, | ||
143 | - { | ||
144 | - "id": "of:0000ffffffffff0A", | ||
145 | - "type": "roadm", | ||
146 | - "online": false, | ||
147 | - "labels": [ | ||
148 | - "0000ffffffffff0A", | ||
149 | - "FF:FF:FF:FF:FF:0A", | ||
150 | - "?" | ||
151 | - ] | ||
152 | - }, | ||
153 | - { | ||
154 | - "id": "of:0000ffffffffff09", | ||
155 | - "type": "roadm", | ||
156 | - "online": false, | ||
157 | - "labels": [ | ||
158 | - "0000ffffffffff09", | ||
159 | - "FF:FF:FF:FF:FF:09", | ||
160 | - "?" | ||
161 | - ] | ||
162 | - } | ||
163 | - ], | ||
164 | - "links": [ | ||
165 | - { | ||
166 | - "src": "of:0000ffffffffff02", | ||
167 | - "srcPort": "20", | ||
168 | - "dst": "of:0000ffffffffff05", | ||
169 | - "dstPort": "10", | ||
170 | - "type": "optical", | ||
171 | - "linkWidth": 2 | ||
172 | - }, | ||
173 | - { | ||
174 | - "src": "of:0000ffffffff000A", | ||
175 | - "srcPort": "2", | ||
176 | - "dst": "of:0000ffffffffff0A", | ||
177 | - "dstPort": "1", | ||
178 | - "type": "optical", | ||
179 | - "linkWidth": 2 | ||
180 | - }, | ||
181 | - { | ||
182 | - "src": "of:0000ffffffffff03", | ||
183 | - "srcPort": "10", | ||
184 | - "dst": "of:0000ffffffffff02", | ||
185 | - "dstPort": "10", | ||
186 | - "type": "optical", | ||
187 | - "linkWidth": 2 | ||
188 | - }, | ||
189 | - { | ||
190 | - "src": "of:0000ffffffffff07", | ||
191 | - "srcPort": "21", | ||
192 | - "dst": "of:0000ffffffffff05", | ||
193 | - "dstPort": "20", | ||
194 | - "type": "optical", | ||
195 | - "linkWidth": 2 | ||
196 | - }, | ||
197 | - { | ||
198 | - "src": "of:0000ffffffff0001", | ||
199 | - "srcPort": "2", | ||
200 | - "dst": "of:0000ffffffffff01", | ||
201 | - "dstPort": "1", | ||
202 | - "type": "optical", | ||
203 | - "linkWidth": 2 | ||
204 | - }, | ||
205 | - { | ||
206 | - "src": "of:0000ffffffffff09", | ||
207 | - "srcPort": "20", | ||
208 | - "dst": "of:0000ffffffffff0A", | ||
209 | - "dstPort": "20", | ||
210 | - "type": "optical", | ||
211 | - "linkWidth": 2 | ||
212 | - }, | ||
213 | - { | ||
214 | - "src": "of:0000ffffffffff06", | ||
215 | - "srcPort": "20", | ||
216 | - "dst": "of:0000ffffffffff05", | ||
217 | - "dstPort": "30", | ||
218 | - "type": "optical", | ||
219 | - "linkWidth": 2 | ||
220 | - }, | ||
221 | - { | ||
222 | - "src": "of:0000ffffffffff07", | ||
223 | - "srcPort": "30", | ||
224 | - "dst": "of:0000ffffffffff08", | ||
225 | - "dstPort": "20", | ||
226 | - "type": "optical", | ||
227 | - "linkWidth": 2 | ||
228 | - }, | ||
229 | - { | ||
230 | - "src": "of:0000ffffffffff03", | ||
231 | - "srcPort": "20", | ||
232 | - "dst": "of:0000ffffffffff06", | ||
233 | - "dstPort": "10", | ||
234 | - "type": "optical", | ||
235 | - "linkWidth": 2 | ||
236 | - }, | ||
237 | - { | ||
238 | - "src": "of:0000ffffffffff02", | ||
239 | - "srcPort": "10", | ||
240 | - "dst": "of:0000ffffffffff01", | ||
241 | - "dstPort": "10", | ||
242 | - "type": "optical", | ||
243 | - "linkWidth": 2 | ||
244 | - }, | ||
245 | - { | ||
246 | - "src": "of:0000ffffffffff09", | ||
247 | - "srcPort": "1", | ||
248 | - "dst": "of:0000ffffffff0009", | ||
249 | - "dstPort": "2", | ||
250 | - "type": "optical", | ||
251 | - "linkWidth": 2 | ||
252 | - }, | ||
253 | - { | ||
254 | - "src": "of:0000ffffffffff03", | ||
255 | - "srcPort": "30", | ||
256 | - "dst": "of:0000ffffffffff04", | ||
257 | - "dstPort": "10", | ||
258 | - "type": "optical", | ||
259 | - "linkWidth": 2 | ||
260 | - }, | ||
261 | - { | ||
262 | - "src": "of:0000ffffffffff07", | ||
263 | - "srcPort": "20", | ||
264 | - "dst": "of:0000ffffffffff09", | ||
265 | - "dstPort": "10", | ||
266 | - "type": "optical", | ||
267 | - "linkWidth": 2 | ||
268 | - }, | ||
269 | - { | ||
270 | - "src": "of:0000ffffffffff0A", | ||
271 | - "srcPort": "10", | ||
272 | - "dst": "of:0000ffffffffff08", | ||
273 | - "dstPort": "30", | ||
274 | - "type": "optical", | ||
275 | - "linkWidth": 2 | ||
276 | - }, | ||
277 | - { | ||
278 | - "src": "of:0000ffffffff0004", | ||
279 | - "srcPort": "2", | ||
280 | - "dst": "of:0000ffffffffff04", | ||
281 | - "dstPort": "1", | ||
282 | - "type": "optical", | ||
283 | - "linkWidth": 2 | ||
284 | - }, | ||
285 | - { | ||
286 | - "src": "of:0000ffffffffff07", | ||
287 | - "srcPort": "1", | ||
288 | - "dst": "of:0000ffffffff0007", | ||
289 | - "dstPort": "2", | ||
290 | - "type": "optical", | ||
291 | - "linkWidth": 2 | ||
292 | - }, | ||
293 | - { | ||
294 | - "src": "of:0000ffffffff0003", | ||
295 | - "srcPort": "2", | ||
296 | - "dst": "of:0000ffffffffff03", | ||
297 | - "dstPort": "1", | ||
298 | - "type": "optical", | ||
299 | - "linkWidth": 2 | ||
300 | - }, | ||
301 | - { | ||
302 | - "src": "of:0000ffffffffff06", | ||
303 | - "srcPort": "30", | ||
304 | - "dst": "of:0000ffffffffff08", | ||
305 | - "dstPort": "10", | ||
306 | - "type": "optical", | ||
307 | - "linkWidth": 2 | ||
308 | - } | ||
309 | - ], | ||
310 | - "hosts": [ | ||
311 | - { | ||
312 | - "id": "00:00:00:00:00:03/-1", | ||
313 | - "cp": { | ||
314 | - "device": "of:0000ffffffff0003", | ||
315 | - "port": 1 | ||
316 | - }, | ||
317 | - "labels": [ | ||
318 | - "10.0.0.3", | ||
319 | - "00:00:00:00:00:03" | ||
320 | - ] | ||
321 | - }, | ||
322 | - { | ||
323 | - "id": "00:00:00:00:00:04/-1", | ||
324 | - "cp": { | ||
325 | - "device": "of:0000ffffffff0004", | ||
326 | - "port": 1 | ||
327 | - }, | ||
328 | - "labels": [ | ||
329 | - "10.0.0.4", | ||
330 | - "00:00:00:00:00:04" | ||
331 | - ] | ||
332 | - }, | ||
333 | - { | ||
334 | - "id": "00:00:00:00:00:0A/-1", | ||
335 | - "cp": { | ||
336 | - "device": "of:0000ffffffff000A", | ||
337 | - "port": 1 | ||
338 | - }, | ||
339 | - "labels": [ | ||
340 | - "10.0.0.10", | ||
341 | - "00:00:00:00:00:0A" | ||
342 | - ] | ||
343 | - }, | ||
344 | - { | ||
345 | - "id": "00:00:00:00:00:09/-1", | ||
346 | - "cp": { | ||
347 | - "device": "of:0000ffffffff0009", | ||
348 | - "port": 1 | ||
349 | - }, | ||
350 | - "labels": [ | ||
351 | - "10.0.0.9", | ||
352 | - "00:00:00:00:00:09" | ||
353 | - ] | ||
354 | - }, | ||
355 | - { | ||
356 | - "id": "00:00:00:00:00:07/-1", | ||
357 | - "cp": { | ||
358 | - "device": "of:0000ffffffff0007", | ||
359 | - "port": 1 | ||
360 | - }, | ||
361 | - "labels": [ | ||
362 | - "10.0.0.7", | ||
363 | - "00:00:00:00:00:07" | ||
364 | - ] | ||
365 | - }, | ||
366 | - { | ||
367 | - "id": "00:00:00:00:00:01/-1", | ||
368 | - "cp": { | ||
369 | - "device": "of:0000ffffffff0001", | ||
370 | - "port": 1 | ||
371 | - }, | ||
372 | - "labels": [ | ||
373 | - "10.0.0.1", | ||
374 | - "00:00:00:00:00:01" | ||
375 | - ] | ||
376 | - } | ||
377 | - ] | ||
378 | -} |
1 | -{ | ||
2 | - "comment": "sample device properties", | ||
3 | - "id": "of:0000000000000001", | ||
4 | - "type": "roadm", | ||
5 | - "propOrder": [ "name", "type", "-", "dpid", "latitude", "longitude", "allowed" ], | ||
6 | - "location": { | ||
7 | - "type": "latlng", | ||
8 | - "lat": 37.6, | ||
9 | - "lng": 122.3 | ||
10 | - }, | ||
11 | - "props": { | ||
12 | - "allowed": true, | ||
13 | - "latitude": 37.6, | ||
14 | - "longitude": 122.3, | ||
15 | - "name": "SFO-W10", | ||
16 | - "dpid": "00:00:00:00:00:00:00:01" | ||
17 | - } | ||
18 | -} |
1 | -{ | ||
2 | - "comment": "sample device properties", | ||
3 | - "id": "of:0000000000000002", | ||
4 | - "type": "switch", | ||
5 | - "propOrder": [ "name", "type", "dpid", "latitude", "longitude", "allowed" ], | ||
6 | - "location": { | ||
7 | - "type": "latlng", | ||
8 | - "lat": 37.6, | ||
9 | - "lng": 122.3 | ||
10 | - }, | ||
11 | - "props": { | ||
12 | - "allowed": true, | ||
13 | - "latitude": 37.3, | ||
14 | - "longitude": 121.9, | ||
15 | - "name": "SJC-W10", | ||
16 | - "dpid": "00:00:00:00:00:00:00:02", | ||
17 | - "type": "Roadm" | ||
18 | - } | ||
19 | -} |
1 | -{ | ||
2 | - "comment": "sample device properties", | ||
3 | - "id": "of:0000000000000003", | ||
4 | - "type": "switch", | ||
5 | - "propOrder": [ "name", "type", "dpid", "latitude", "longitude", "allowed" ], | ||
6 | - "location": { | ||
7 | - "type": "latlng", | ||
8 | - "lat": 33.9, | ||
9 | - "lng": 118.4 | ||
10 | - }, | ||
11 | - "props": { | ||
12 | - "allowed": true, | ||
13 | - "latitude": 33.9, | ||
14 | - "longitude": 118.4, | ||
15 | - "name": "LAX-W10", | ||
16 | - "dpid": "00:00:00:00:00:00:00:03", | ||
17 | - "type": "Roadm" | ||
18 | - } | ||
19 | -} |
1 | -{ | ||
2 | - "comment": "sample device properties", | ||
3 | - "id": "of:0000000000000004", | ||
4 | - "type": "switch", | ||
5 | - "propOrder": [ "name", "type", "dpid", "latitude", "longitude", "allowed" ], | ||
6 | - "location": { | ||
7 | - "type": "latlng", | ||
8 | - "lat": 32.8, | ||
9 | - "lng": 117.1 | ||
10 | - }, | ||
11 | - "props": { | ||
12 | - "allowed": true, | ||
13 | - "latitude": 32.8, | ||
14 | - "longitude": 117.1, | ||
15 | - "name": "SDG-W10", | ||
16 | - "dpid": "00:00:00:00:00:00:00:04", | ||
17 | - "type": "Roadm" | ||
18 | - } | ||
19 | -} |
1 | -{ | ||
2 | - "id": "of:0000ffffffff0007", | ||
3 | - "type": "switch", | ||
4 | - "propOrder": [ | ||
5 | - "Name", | ||
6 | - "Vendor", | ||
7 | - "H/W Version", | ||
8 | - "S/W Version", | ||
9 | - "S/W Version", | ||
10 | - "-", | ||
11 | - "Latitude", | ||
12 | - "Longitude", | ||
13 | - "Ports" | ||
14 | - ], | ||
15 | - "props": { | ||
16 | - "Name": null, | ||
17 | - "Vendor": "Linc", | ||
18 | - "H/W Version": "PK", | ||
19 | - "S/W Version": "?", | ||
20 | - "-": "", | ||
21 | - "Latitude": "41.8", | ||
22 | - "Longitude": "120.1", | ||
23 | - "Ports": "2" | ||
24 | - } | ||
25 | -} |
1 | -{ | ||
2 | - "id": "of:0000ffffffff0009", | ||
3 | - "type": "switch", | ||
4 | - "propOrder": [ | ||
5 | - "Name", | ||
6 | - "Vendor", | ||
7 | - "H/W Version", | ||
8 | - "S/W Version", | ||
9 | - "S/W Version", | ||
10 | - "-", | ||
11 | - "Latitude", | ||
12 | - "Longitude", | ||
13 | - "Ports" | ||
14 | - ], | ||
15 | - "props": { | ||
16 | - "Name": null, | ||
17 | - "Vendor": "Linc", | ||
18 | - "H/W Version": "PK", | ||
19 | - "S/W Version": "?", | ||
20 | - "-": "", | ||
21 | - "Latitude": "40.8", | ||
22 | - "Longitude": "73.1", | ||
23 | - "Ports": "2" | ||
24 | - } | ||
25 | -} |
1 | -{ | ||
2 | - "id": "of:0000ffffffffff07", | ||
3 | - "type": "roadm", | ||
4 | - "propOrder": [ | ||
5 | - "Name", | ||
6 | - "Vendor", | ||
7 | - "H/W Version", | ||
8 | - "S/W Version", | ||
9 | - "S/W Version", | ||
10 | - "-", | ||
11 | - "Latitude", | ||
12 | - "Longitude", | ||
13 | - "Ports" | ||
14 | - ], | ||
15 | - "props": { | ||
16 | - "Name": null, | ||
17 | - "Vendor": "Linc", | ||
18 | - "H/W Version": "OE", | ||
19 | - "S/W Version": "?", | ||
20 | - "-": "", | ||
21 | - "Latitude": "41.8", | ||
22 | - "Longitude": "120.1", | ||
23 | - "Ports": "2" | ||
24 | - } | ||
25 | -} |
1 | -{ | ||
2 | - "id": "of:0000ffffffffff09", | ||
3 | - "type": "roadm", | ||
4 | - "propOrder": [ | ||
5 | - "Name", | ||
6 | - "Vendor", | ||
7 | - "H/W Version", | ||
8 | - "S/W Version", | ||
9 | - "S/W Version", | ||
10 | - "-", | ||
11 | - "Latitude", | ||
12 | - "Longitude", | ||
13 | - "Ports" | ||
14 | - ], | ||
15 | - "props": { | ||
16 | - "Name": null, | ||
17 | - "Vendor": "Linc", | ||
18 | - "H/W Version": "OE", | ||
19 | - "S/W Version": "?", | ||
20 | - "-": "", | ||
21 | - "Latitude": "40.8", | ||
22 | - "Longitude": "73.1", | ||
23 | - "Ports": "2" | ||
24 | - } | ||
25 | -} |
This diff is collapsed. Click to expand it.
web/gui/src/main/webapp/OLD/onos.css
deleted
100644 → 0
1 | -/* | ||
2 | - * Copyright 2014 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 CSS file | ||
19 | - | ||
20 | - @author Simon Hunt | ||
21 | - */ | ||
22 | - | ||
23 | -body, html { | ||
24 | - height: 100%; | ||
25 | -} | ||
26 | - | ||
27 | -/* | ||
28 | - * Classes | ||
29 | - */ | ||
30 | - | ||
31 | -img#logo { | ||
32 | - height: 38px; | ||
33 | - padding-left: 8px; | ||
34 | - padding-right: 8px; | ||
35 | -} | ||
36 | - | ||
37 | -span.title { | ||
38 | - color: #369; | ||
39 | - font-size: 14pt; | ||
40 | - font-style: italic; | ||
41 | - vertical-align: 12px; | ||
42 | -} | ||
43 | - | ||
44 | -span.radio { | ||
45 | - color: darkslateblue; | ||
46 | - font-size: 10pt; | ||
47 | -} | ||
48 | - | ||
49 | -span.right { | ||
50 | - padding-top: 8px; | ||
51 | - padding-right: 16px; | ||
52 | - float: right; | ||
53 | -} | ||
54 | - | ||
55 | -/* | ||
56 | - * Radio Buttons | ||
57 | - */ | ||
58 | - | ||
59 | -span.radio { | ||
60 | - margin: 4px 0; | ||
61 | - border: 1px dotted #222; | ||
62 | - padding: 1px 6px; | ||
63 | - color: #eee; | ||
64 | - cursor: pointer; | ||
65 | -} | ||
66 | - | ||
67 | -span.radio.active { | ||
68 | - background-color: #bbb; | ||
69 | - border: 1px solid #eee; | ||
70 | - padding: 1px 6px; | ||
71 | - color: #666; | ||
72 | - font-weight: bold; | ||
73 | -} | ||
74 | - | ||
75 | -/* | ||
76 | - * === DEBUGGING ====== | ||
77 | - */ | ||
78 | -svg { | ||
79 | - /*border: 1px dashed red;*/ | ||
80 | -} | ||
81 | - | ||
82 | -svg #bg { | ||
83 | - opacity: 0.5; | ||
84 | -} | ||
85 | - | ||
86 | - | ||
87 | -/* | ||
88 | - * Network Graph elements ====================================== | ||
89 | - */ | ||
90 | - | ||
91 | -svg .link { | ||
92 | - fill: none; | ||
93 | - stroke: #666; | ||
94 | - stroke-width: 2.0px; | ||
95 | - opacity: .7; | ||
96 | - | ||
97 | - transition: opacity 250ms; | ||
98 | - -webkit-transition: opacity 250ms; | ||
99 | - -moz-transition: opacity 250ms; | ||
100 | -} | ||
101 | - | ||
102 | -svg .link.host { | ||
103 | - stroke: #666; | ||
104 | - stroke-width: 1px; | ||
105 | -} | ||
106 | - | ||
107 | -svg g.portLayer rect.port { | ||
108 | - fill: #ccc; | ||
109 | -} | ||
110 | - | ||
111 | -svg g.portLayer text { | ||
112 | - font: 8pt sans-serif; | ||
113 | - pointer-events: none; | ||
114 | -} | ||
115 | - | ||
116 | -svg .node.device rect { | ||
117 | - stroke-width: 1.5px; | ||
118 | - | ||
119 | - transition: opacity 250ms; | ||
120 | - -webkit-transition: opacity 250ms; | ||
121 | - -moz-transition: opacity 250ms; | ||
122 | -} | ||
123 | - | ||
124 | -svg .node.device.fixed rect { | ||
125 | - stroke-width: 1.5; | ||
126 | - stroke: #ccc; | ||
127 | -} | ||
128 | - | ||
129 | -svg .node.device.roadm rect { | ||
130 | - fill: #03c; | ||
131 | -} | ||
132 | - | ||
133 | -svg .node.device.switch rect { | ||
134 | - fill: #06f; | ||
135 | -} | ||
136 | - | ||
137 | -svg .node.host circle { | ||
138 | - fill: #c96; | ||
139 | - stroke: #000; | ||
140 | -} | ||
141 | - | ||
142 | -svg .node text { | ||
143 | - fill: white; | ||
144 | - font: 10pt sans-serif; | ||
145 | - pointer-events: none; | ||
146 | -} | ||
147 | - | ||
148 | -/* for debugging */ | ||
149 | -svg .node circle.debug { | ||
150 | - fill: white; | ||
151 | - stroke: red; | ||
152 | -} | ||
153 | -svg .node rect.debug { | ||
154 | - fill: yellow; | ||
155 | - stroke: red; | ||
156 | - opacity: 0.35; | ||
157 | -} | ||
158 | - | ||
159 | - | ||
160 | -svg .node.selected rect, | ||
161 | -svg .node.selected circle { | ||
162 | - filter: url(#blue-glow); | ||
163 | -} | ||
164 | - | ||
165 | -svg .link.inactive, | ||
166 | -svg .port.inactive, | ||
167 | -svg .portText.inactive, | ||
168 | -svg .node.inactive rect, | ||
169 | -svg .node.inactive circle, | ||
170 | -svg .node.inactive text, | ||
171 | -svg .node.inactive image { | ||
172 | - opacity: .1; | ||
173 | -} | ||
174 | - | ||
175 | -svg .node.inactive.selected rect, | ||
176 | -svg .node.inactive.selected text, | ||
177 | -svg .node.inactive.selected image { | ||
178 | - opacity: .6; | ||
179 | -} | ||
180 | - | ||
181 | -/* | ||
182 | - * === currently unused =============================================== | ||
183 | - */ | ||
184 | - | ||
185 | -svg marker#end { | ||
186 | - fill: #666; | ||
187 | - stroke: #666; | ||
188 | - stroke-width: 1.5px; | ||
189 | -} | ||
190 | - | ||
191 | -svg .legend { | ||
192 | - position: fixed; | ||
193 | -} | ||
194 | - | ||
195 | -svg .legend .category rect { | ||
196 | - stroke-width: 1px; | ||
197 | -} | ||
198 | - | ||
199 | -svg .legend .category text { | ||
200 | - fill: #000; | ||
201 | - font: 10px sans-serif; | ||
202 | - pointer-events: none; | ||
203 | -} | ||
204 | - | ||
205 | -/* | ||
206 | - * ============================================================= | ||
207 | - */ | ||
208 | - | ||
209 | -/* | ||
210 | - * Specific structural elements | ||
211 | - */ | ||
212 | - | ||
213 | -/* This is to ensure that the body does not expand to account for the | ||
214 | - flyout details pane, that is positioned "off screen". | ||
215 | - */ | ||
216 | -body { | ||
217 | - overflow: hidden; | ||
218 | -} | ||
219 | - | ||
220 | -#mast { | ||
221 | - height: 36px; | ||
222 | - padding: 4px; | ||
223 | - background-color: #bbb; | ||
224 | - vertical-align: baseline; | ||
225 | - box-shadow: 0px 2px 8px #777; | ||
226 | -} | ||
227 | - | ||
228 | -#frame { | ||
229 | - width: 100%; | ||
230 | - height: 100%; | ||
231 | - background-color: #fff; | ||
232 | -} | ||
233 | - | ||
234 | -#flyout { | ||
235 | - position: absolute; | ||
236 | - z-index: 100; | ||
237 | - display: block; | ||
238 | - top: 10%; | ||
239 | - width: 280px; | ||
240 | - right: -300px; | ||
241 | - opacity: 0; | ||
242 | - background-color: rgba(255,255,255,0.8); | ||
243 | - | ||
244 | - padding: 10px; | ||
245 | - color: black; | ||
246 | - font-size: 10pt; | ||
247 | - box-shadow: 2px 2px 16px #777; | ||
248 | -} | ||
249 | - | ||
250 | -#flyout h2 { | ||
251 | - margin: 8px 4px; | ||
252 | - color: black; | ||
253 | - vertical-align: middle; | ||
254 | -} | ||
255 | - | ||
256 | -#flyout h2 img { | ||
257 | - height: 32px; | ||
258 | - padding-right: 8px; | ||
259 | - vertical-align: middle; | ||
260 | -} | ||
261 | - | ||
262 | -#flyout p, table { | ||
263 | - margin: 4px 4px; | ||
264 | -} | ||
265 | - | ||
266 | -#flyout td.label { | ||
267 | - font-style: italic; | ||
268 | - color: #777; | ||
269 | - padding-right: 12px; | ||
270 | -} | ||
271 | - | ||
272 | -#flyout td.value { | ||
273 | - | ||
274 | -} | ||
275 | - | ||
276 | -#flyout hr { | ||
277 | - height: 1px; | ||
278 | - color: #ccc; | ||
279 | - background-color: #ccc; | ||
280 | - border: 0; | ||
281 | -} | ||
282 | - |
web/gui/src/main/webapp/OLD/onos.js
deleted
100644 → 0
1 | -/* | ||
2 | - * Copyright 2014 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 UI Framework. | ||
19 | - | ||
20 | - @author Simon Hunt | ||
21 | - */ | ||
22 | - | ||
23 | -(function ($) { | ||
24 | - 'use strict'; | ||
25 | - var tsI = new Date().getTime(), // initialize time stamp | ||
26 | - tsB; // build time stamp | ||
27 | - | ||
28 | - // attach our main function to the jQuery object | ||
29 | - $.onos = function (options) { | ||
30 | - // private namespaces | ||
31 | - var publicApi; // public api | ||
32 | - | ||
33 | - // internal state | ||
34 | - var views = {}, | ||
35 | - currentView = null, | ||
36 | - built = false; | ||
37 | - | ||
38 | - // DOM elements etc. | ||
39 | - var $mast; | ||
40 | - | ||
41 | - | ||
42 | - // various functions.................. | ||
43 | - | ||
44 | - // throw an error | ||
45 | - function throwError(msg) { | ||
46 | - // todo: maybe add tracing later | ||
47 | - throw new Error(msg); | ||
48 | - } | ||
49 | - | ||
50 | - // define all the public api functions... | ||
51 | - publicApi = { | ||
52 | - printTime: function () { | ||
53 | - console.log("the time is " + new Date()); | ||
54 | - }, | ||
55 | - | ||
56 | - addView: function (vid, cb) { | ||
57 | - views[vid] = { | ||
58 | - vid: vid, | ||
59 | - cb: cb | ||
60 | - }; | ||
61 | - // TODO: proper registration of views | ||
62 | - // for now, make the one (and only) view current.. | ||
63 | - currentView = views[vid]; | ||
64 | - } | ||
65 | - }; | ||
66 | - | ||
67 | - // function to be called from index.html to build the ONOS UI | ||
68 | - function buildOnosUi() { | ||
69 | - tsB = new Date().getTime(); | ||
70 | - tsI = tsB - tsI; // initialization duration | ||
71 | - | ||
72 | - console.log('ONOS UI initialized in ' + tsI + 'ms'); | ||
73 | - | ||
74 | - if (built) { | ||
75 | - throwError("ONOS UI already built!"); | ||
76 | - } | ||
77 | - built = true; | ||
78 | - | ||
79 | - // TODO: invoke hash navigation | ||
80 | - // --- report build errors --- | ||
81 | - | ||
82 | - // for now, invoke the one and only load function: | ||
83 | - | ||
84 | - currentView.cb.load(); | ||
85 | - } | ||
86 | - | ||
87 | - | ||
88 | - // export the api and build-UI function | ||
89 | - return { | ||
90 | - api: publicApi, | ||
91 | - buildUi: buildOnosUi | ||
92 | - }; | ||
93 | - }; | ||
94 | - | ||
95 | -}(jQuery)); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
This diff is collapsed. Click to expand it.

9.27 KB

9.83 KB

1.48 KB

2.07 KB

8.83 KB

9.27 KB

28.5 KB

899 Bytes

800 Bytes

665 Bytes

991 Bytes

1.14 KB

848 Bytes
-
Please register or login to post a comment