GUI -- Simplified setRadio() api. Other minor cleanup. Added test topology data files.
Showing
9 changed files
with
2054 additions
and
67 deletions
web/gui/src/main/webapp/json/topoTest_1.json
0 → 100644
1 | +{ | ||
2 | + "comment": [ | ||
3 | + "2 links removed from base", | ||
4 | + " ff07 - ff09 ", | ||
5 | + " ff01 - 0001 " | ||
6 | + ], | ||
7 | + "devices": [ | ||
8 | + { | ||
9 | + "id": "of:0000ffffffffff08", | ||
10 | + "type": "roadm", | ||
11 | + "online": false, | ||
12 | + "labels": [ | ||
13 | + "0000ffffffffff08", | ||
14 | + "FF:FF:FF:FF:FF:08", | ||
15 | + "?" | ||
16 | + ] | ||
17 | + }, | ||
18 | + { | ||
19 | + "id": "of:0000ffffffffff03", | ||
20 | + "type": "roadm", | ||
21 | + "online": false, | ||
22 | + "labels": [ | ||
23 | + "0000ffffffffff03", | ||
24 | + "FF:FF:FF:FF:FF:03", | ||
25 | + "?" | ||
26 | + ] | ||
27 | + }, | ||
28 | + { | ||
29 | + "id": "of:0000ffffffffff02", | ||
30 | + "type": "roadm", | ||
31 | + "online": false, | ||
32 | + "labels": [ | ||
33 | + "0000ffffffffff02", | ||
34 | + "FF:FF:FF:FF:FF:02", | ||
35 | + "?" | ||
36 | + ] | ||
37 | + }, | ||
38 | + { | ||
39 | + "id": "of:0000ffffffff0003", | ||
40 | + "type": "switch", | ||
41 | + "online": false, | ||
42 | + "labels": [ | ||
43 | + "0000ffffffff0003", | ||
44 | + "FF:FF:FF:FF:00:03", | ||
45 | + "?" | ||
46 | + ] | ||
47 | + }, | ||
48 | + { | ||
49 | + "id": "of:0000ffffffffff07", | ||
50 | + "type": "roadm", | ||
51 | + "online": false, | ||
52 | + "labels": [ | ||
53 | + "0000ffffffffff07", | ||
54 | + "FF:FF:FF:FF:FF:07", | ||
55 | + "?" | ||
56 | + ] | ||
57 | + }, | ||
58 | + { | ||
59 | + "id": "of:0000ffffffffff06", | ||
60 | + "type": "roadm", | ||
61 | + "online": false, | ||
62 | + "labels": [ | ||
63 | + "0000ffffffffff06", | ||
64 | + "FF:FF:FF:FF:FF:06", | ||
65 | + "?" | ||
66 | + ] | ||
67 | + }, | ||
68 | + { | ||
69 | + "id": "of:0000ffffffff0007", | ||
70 | + "type": "switch", | ||
71 | + "online": false, | ||
72 | + "labels": [ | ||
73 | + "0000ffffffff0007", | ||
74 | + "FF:FF:FF:FF:00:07", | ||
75 | + "?" | ||
76 | + ] | ||
77 | + }, | ||
78 | + { | ||
79 | + "id": "of:0000ffffffffff05", | ||
80 | + "type": "roadm", | ||
81 | + "online": false, | ||
82 | + "labels": [ | ||
83 | + "0000ffffffffff05", | ||
84 | + "FF:FF:FF:FF:FF:05", | ||
85 | + "?" | ||
86 | + ] | ||
87 | + }, | ||
88 | + { | ||
89 | + "id": "of:0000ffffffff0009", | ||
90 | + "type": "switch", | ||
91 | + "online": false, | ||
92 | + "labels": [ | ||
93 | + "0000ffffffff0009", | ||
94 | + "FF:FF:FF:FF:00:09", | ||
95 | + "?" | ||
96 | + ] | ||
97 | + }, | ||
98 | + { | ||
99 | + "id": "of:0000ffffffffff04", | ||
100 | + "type": "roadm", | ||
101 | + "online": false, | ||
102 | + "labels": [ | ||
103 | + "0000ffffffffff04", | ||
104 | + "FF:FF:FF:FF:FF:04", | ||
105 | + "?" | ||
106 | + ] | ||
107 | + }, | ||
108 | + { | ||
109 | + "id": "of:0000ffffffff000A", | ||
110 | + "type": "switch", | ||
111 | + "online": false, | ||
112 | + "labels": [ | ||
113 | + "0000ffffffff000A", | ||
114 | + "FF:FF:FF:FF:00:0A", | ||
115 | + "?" | ||
116 | + ] | ||
117 | + }, | ||
118 | + { | ||
119 | + "id": "of:0000ffffffff0001", | ||
120 | + "type": "switch", | ||
121 | + "online": false, | ||
122 | + "labels": [ | ||
123 | + "0000ffffffff0001", | ||
124 | + "FF:FF:FF:FF:00:01", | ||
125 | + "?" | ||
126 | + ] | ||
127 | + }, | ||
128 | + { | ||
129 | + "id": "of:0000ffffffffff01", | ||
130 | + "type": "roadm", | ||
131 | + "online": false, | ||
132 | + "labels": [ | ||
133 | + "0000ffffffffff01", | ||
134 | + "FF:FF:FF:FF:FF:01", | ||
135 | + "?" | ||
136 | + ] | ||
137 | + }, | ||
138 | + { | ||
139 | + "id": "of:0000ffffffff0004", | ||
140 | + "type": "switch", | ||
141 | + "online": false, | ||
142 | + "labels": [ | ||
143 | + "0000ffffffff0004", | ||
144 | + "FF:FF:FF:FF:00:04", | ||
145 | + "?" | ||
146 | + ] | ||
147 | + }, | ||
148 | + { | ||
149 | + "id": "of:0000ffffffffff0A", | ||
150 | + "type": "roadm", | ||
151 | + "online": false, | ||
152 | + "labels": [ | ||
153 | + "0000ffffffffff0A", | ||
154 | + "FF:FF:FF:FF:FF:0A", | ||
155 | + "?" | ||
156 | + ] | ||
157 | + }, | ||
158 | + { | ||
159 | + "id": "of:0000ffffffffff09", | ||
160 | + "type": "roadm", | ||
161 | + "online": false, | ||
162 | + "labels": [ | ||
163 | + "0000ffffffffff09", | ||
164 | + "FF:FF:FF:FF:FF:09", | ||
165 | + "?" | ||
166 | + ] | ||
167 | + } | ||
168 | + ], | ||
169 | + "links": [ | ||
170 | + { | ||
171 | + "src": "of:0000ffffffffff02", | ||
172 | + "srcPort": "20", | ||
173 | + "dst": "of:0000ffffffffff05", | ||
174 | + "dstPort": "10", | ||
175 | + "type": "optical", | ||
176 | + "linkWidth": 2 | ||
177 | + }, | ||
178 | + { | ||
179 | + "src": "of:0000ffffffff000A", | ||
180 | + "srcPort": "2", | ||
181 | + "dst": "of:0000ffffffffff0A", | ||
182 | + "dstPort": "1", | ||
183 | + "type": "optical", | ||
184 | + "linkWidth": 2 | ||
185 | + }, | ||
186 | + { | ||
187 | + "src": "of:0000ffffffffff03", | ||
188 | + "srcPort": "10", | ||
189 | + "dst": "of:0000ffffffffff02", | ||
190 | + "dstPort": "10", | ||
191 | + "type": "optical", | ||
192 | + "linkWidth": 2 | ||
193 | + }, | ||
194 | + { | ||
195 | + "src": "of:0000ffffffffff07", | ||
196 | + "srcPort": "21", | ||
197 | + "dst": "of:0000ffffffffff05", | ||
198 | + "dstPort": "20", | ||
199 | + "type": "optical", | ||
200 | + "linkWidth": 2 | ||
201 | + }, | ||
202 | + { | ||
203 | + "src": "of:0000ffffffffff09", | ||
204 | + "srcPort": "20", | ||
205 | + "dst": "of:0000ffffffffff0A", | ||
206 | + "dstPort": "20", | ||
207 | + "type": "optical", | ||
208 | + "linkWidth": 2 | ||
209 | + }, | ||
210 | + { | ||
211 | + "src": "of:0000ffffffffff06", | ||
212 | + "srcPort": "20", | ||
213 | + "dst": "of:0000ffffffffff05", | ||
214 | + "dstPort": "30", | ||
215 | + "type": "optical", | ||
216 | + "linkWidth": 2 | ||
217 | + }, | ||
218 | + { | ||
219 | + "src": "of:0000ffffffffff07", | ||
220 | + "srcPort": "30", | ||
221 | + "dst": "of:0000ffffffffff08", | ||
222 | + "dstPort": "20", | ||
223 | + "type": "optical", | ||
224 | + "linkWidth": 2 | ||
225 | + }, | ||
226 | + { | ||
227 | + "src": "of:0000ffffffffff03", | ||
228 | + "srcPort": "20", | ||
229 | + "dst": "of:0000ffffffffff06", | ||
230 | + "dstPort": "10", | ||
231 | + "type": "optical", | ||
232 | + "linkWidth": 2 | ||
233 | + }, | ||
234 | + { | ||
235 | + "src": "of:0000ffffffffff02", | ||
236 | + "srcPort": "10", | ||
237 | + "dst": "of:0000ffffffffff01", | ||
238 | + "dstPort": "10", | ||
239 | + "type": "optical", | ||
240 | + "linkWidth": 2 | ||
241 | + }, | ||
242 | + { | ||
243 | + "src": "of:0000ffffffffff09", | ||
244 | + "srcPort": "1", | ||
245 | + "dst": "of:0000ffffffff0009", | ||
246 | + "dstPort": "2", | ||
247 | + "type": "optical", | ||
248 | + "linkWidth": 2 | ||
249 | + }, | ||
250 | + { | ||
251 | + "src": "of:0000ffffffffff03", | ||
252 | + "srcPort": "30", | ||
253 | + "dst": "of:0000ffffffffff04", | ||
254 | + "dstPort": "10", | ||
255 | + "type": "optical", | ||
256 | + "linkWidth": 2 | ||
257 | + }, | ||
258 | + { | ||
259 | + "src": "of:0000ffffffffff0A", | ||
260 | + "srcPort": "10", | ||
261 | + "dst": "of:0000ffffffffff08", | ||
262 | + "dstPort": "30", | ||
263 | + "type": "optical", | ||
264 | + "linkWidth": 2 | ||
265 | + }, | ||
266 | + { | ||
267 | + "src": "of:0000ffffffff0004", | ||
268 | + "srcPort": "2", | ||
269 | + "dst": "of:0000ffffffffff04", | ||
270 | + "dstPort": "1", | ||
271 | + "type": "optical", | ||
272 | + "linkWidth": 2 | ||
273 | + }, | ||
274 | + { | ||
275 | + "src": "of:0000ffffffffff07", | ||
276 | + "srcPort": "1", | ||
277 | + "dst": "of:0000ffffffff0007", | ||
278 | + "dstPort": "2", | ||
279 | + "type": "optical", | ||
280 | + "linkWidth": 2 | ||
281 | + }, | ||
282 | + { | ||
283 | + "src": "of:0000ffffffff0003", | ||
284 | + "srcPort": "2", | ||
285 | + "dst": "of:0000ffffffffff03", | ||
286 | + "dstPort": "1", | ||
287 | + "type": "optical", | ||
288 | + "linkWidth": 2 | ||
289 | + }, | ||
290 | + { | ||
291 | + "src": "of:0000ffffffffff06", | ||
292 | + "srcPort": "30", | ||
293 | + "dst": "of:0000ffffffffff08", | ||
294 | + "dstPort": "10", | ||
295 | + "type": "optical", | ||
296 | + "linkWidth": 2 | ||
297 | + } | ||
298 | + ], | ||
299 | + "hosts": [ | ||
300 | + { | ||
301 | + "id": "00:00:00:00:00:03/-1", | ||
302 | + "cp": { | ||
303 | + "device": "of:0000ffffffff0003", | ||
304 | + "port": 1 | ||
305 | + }, | ||
306 | + "labels": [ | ||
307 | + "10.0.0.3", | ||
308 | + "00:00:00:00:00:03" | ||
309 | + ] | ||
310 | + }, | ||
311 | + { | ||
312 | + "id": "00:00:00:00:00:04/-1", | ||
313 | + "cp": { | ||
314 | + "device": "of:0000ffffffff0004", | ||
315 | + "port": 1 | ||
316 | + }, | ||
317 | + "labels": [ | ||
318 | + "10.0.0.4", | ||
319 | + "00:00:00:00:00:04" | ||
320 | + ] | ||
321 | + }, | ||
322 | + { | ||
323 | + "id": "00:00:00:00:00:0A/-1", | ||
324 | + "cp": { | ||
325 | + "device": "of:0000ffffffff000A", | ||
326 | + "port": 1 | ||
327 | + }, | ||
328 | + "labels": [ | ||
329 | + "10.0.0.10", | ||
330 | + "00:00:00:00:00:0A" | ||
331 | + ] | ||
332 | + }, | ||
333 | + { | ||
334 | + "id": "00:00:00:00:00:09/-1", | ||
335 | + "cp": { | ||
336 | + "device": "of:0000ffffffff0009", | ||
337 | + "port": 1 | ||
338 | + }, | ||
339 | + "labels": [ | ||
340 | + "10.0.0.9", | ||
341 | + "00:00:00:00:00:09" | ||
342 | + ] | ||
343 | + }, | ||
344 | + { | ||
345 | + "id": "00:00:00:00:00:07/-1", | ||
346 | + "cp": { | ||
347 | + "device": "of:0000ffffffff0007", | ||
348 | + "port": 1 | ||
349 | + }, | ||
350 | + "labels": [ | ||
351 | + "10.0.0.7", | ||
352 | + "00:00:00:00:00:07" | ||
353 | + ] | ||
354 | + }, | ||
355 | + { | ||
356 | + "id": "00:00:00:00:00:01/-1", | ||
357 | + "cp": { | ||
358 | + "device": "of:0000ffffffff0001", | ||
359 | + "port": 1 | ||
360 | + }, | ||
361 | + "labels": [ | ||
362 | + "10.0.0.1", | ||
363 | + "00:00:00:00:00:01" | ||
364 | + ] | ||
365 | + } | ||
366 | + ] | ||
367 | +} |
web/gui/src/main/webapp/json/topoTest_2.json
0 → 100644
1 | +{ | ||
2 | + "comment": [ | ||
3 | + "1 packet switch removed from base", | ||
4 | + " 0007 " | ||
5 | + ], | ||
6 | + "devices": [ | ||
7 | + { | ||
8 | + "id": "of:0000ffffffffff08", | ||
9 | + "type": "roadm", | ||
10 | + "online": false, | ||
11 | + "labels": [ | ||
12 | + "0000ffffffffff08", | ||
13 | + "FF:FF:FF:FF:FF:08", | ||
14 | + "?" | ||
15 | + ] | ||
16 | + }, | ||
17 | + { | ||
18 | + "id": "of:0000ffffffffff03", | ||
19 | + "type": "roadm", | ||
20 | + "online": false, | ||
21 | + "labels": [ | ||
22 | + "0000ffffffffff03", | ||
23 | + "FF:FF:FF:FF:FF:03", | ||
24 | + "?" | ||
25 | + ] | ||
26 | + }, | ||
27 | + { | ||
28 | + "id": "of:0000ffffffffff02", | ||
29 | + "type": "roadm", | ||
30 | + "online": false, | ||
31 | + "labels": [ | ||
32 | + "0000ffffffffff02", | ||
33 | + "FF:FF:FF:FF:FF:02", | ||
34 | + "?" | ||
35 | + ] | ||
36 | + }, | ||
37 | + { | ||
38 | + "id": "of:0000ffffffff0003", | ||
39 | + "type": "switch", | ||
40 | + "online": false, | ||
41 | + "labels": [ | ||
42 | + "0000ffffffff0003", | ||
43 | + "FF:FF:FF:FF:00:03", | ||
44 | + "?" | ||
45 | + ] | ||
46 | + }, | ||
47 | + { | ||
48 | + "id": "of:0000ffffffffff07", | ||
49 | + "type": "roadm", | ||
50 | + "online": false, | ||
51 | + "labels": [ | ||
52 | + "0000ffffffffff07", | ||
53 | + "FF:FF:FF:FF:FF:07", | ||
54 | + "?" | ||
55 | + ] | ||
56 | + }, | ||
57 | + { | ||
58 | + "id": "of:0000ffffffffff06", | ||
59 | + "type": "roadm", | ||
60 | + "online": false, | ||
61 | + "labels": [ | ||
62 | + "0000ffffffffff06", | ||
63 | + "FF:FF:FF:FF:FF:06", | ||
64 | + "?" | ||
65 | + ] | ||
66 | + }, | ||
67 | + { | ||
68 | + "id": "of:0000ffffffffff05", | ||
69 | + "type": "roadm", | ||
70 | + "online": false, | ||
71 | + "labels": [ | ||
72 | + "0000ffffffffff05", | ||
73 | + "FF:FF:FF:FF:FF:05", | ||
74 | + "?" | ||
75 | + ] | ||
76 | + }, | ||
77 | + { | ||
78 | + "id": "of:0000ffffffff0009", | ||
79 | + "type": "switch", | ||
80 | + "online": false, | ||
81 | + "labels": [ | ||
82 | + "0000ffffffff0009", | ||
83 | + "FF:FF:FF:FF:00:09", | ||
84 | + "?" | ||
85 | + ] | ||
86 | + }, | ||
87 | + { | ||
88 | + "id": "of:0000ffffffffff04", | ||
89 | + "type": "roadm", | ||
90 | + "online": false, | ||
91 | + "labels": [ | ||
92 | + "0000ffffffffff04", | ||
93 | + "FF:FF:FF:FF:FF:04", | ||
94 | + "?" | ||
95 | + ] | ||
96 | + }, | ||
97 | + { | ||
98 | + "id": "of:0000ffffffff000A", | ||
99 | + "type": "switch", | ||
100 | + "online": false, | ||
101 | + "labels": [ | ||
102 | + "0000ffffffff000A", | ||
103 | + "FF:FF:FF:FF:00:0A", | ||
104 | + "?" | ||
105 | + ] | ||
106 | + }, | ||
107 | + { | ||
108 | + "id": "of:0000ffffffff0001", | ||
109 | + "type": "switch", | ||
110 | + "online": false, | ||
111 | + "labels": [ | ||
112 | + "0000ffffffff0001", | ||
113 | + "FF:FF:FF:FF:00:01", | ||
114 | + "?" | ||
115 | + ] | ||
116 | + }, | ||
117 | + { | ||
118 | + "id": "of:0000ffffffffff01", | ||
119 | + "type": "roadm", | ||
120 | + "online": false, | ||
121 | + "labels": [ | ||
122 | + "0000ffffffffff01", | ||
123 | + "FF:FF:FF:FF:FF:01", | ||
124 | + "?" | ||
125 | + ] | ||
126 | + }, | ||
127 | + { | ||
128 | + "id": "of:0000ffffffff0004", | ||
129 | + "type": "switch", | ||
130 | + "online": false, | ||
131 | + "labels": [ | ||
132 | + "0000ffffffff0004", | ||
133 | + "FF:FF:FF:FF:00:04", | ||
134 | + "?" | ||
135 | + ] | ||
136 | + }, | ||
137 | + { | ||
138 | + "id": "of:0000ffffffffff0A", | ||
139 | + "type": "roadm", | ||
140 | + "online": false, | ||
141 | + "labels": [ | ||
142 | + "0000ffffffffff0A", | ||
143 | + "FF:FF:FF:FF:FF:0A", | ||
144 | + "?" | ||
145 | + ] | ||
146 | + }, | ||
147 | + { | ||
148 | + "id": "of:0000ffffffffff09", | ||
149 | + "type": "roadm", | ||
150 | + "online": false, | ||
151 | + "labels": [ | ||
152 | + "0000ffffffffff09", | ||
153 | + "FF:FF:FF:FF:FF:09", | ||
154 | + "?" | ||
155 | + ] | ||
156 | + } | ||
157 | + ], | ||
158 | + "links": [ | ||
159 | + { | ||
160 | + "src": "of:0000ffffffffff02", | ||
161 | + "srcPort": "20", | ||
162 | + "dst": "of:0000ffffffffff05", | ||
163 | + "dstPort": "10", | ||
164 | + "type": "optical", | ||
165 | + "linkWidth": 2 | ||
166 | + }, | ||
167 | + { | ||
168 | + "src": "of:0000ffffffff000A", | ||
169 | + "srcPort": "2", | ||
170 | + "dst": "of:0000ffffffffff0A", | ||
171 | + "dstPort": "1", | ||
172 | + "type": "optical", | ||
173 | + "linkWidth": 2 | ||
174 | + }, | ||
175 | + { | ||
176 | + "src": "of:0000ffffffffff03", | ||
177 | + "srcPort": "10", | ||
178 | + "dst": "of:0000ffffffffff02", | ||
179 | + "dstPort": "10", | ||
180 | + "type": "optical", | ||
181 | + "linkWidth": 2 | ||
182 | + }, | ||
183 | + { | ||
184 | + "src": "of:0000ffffffffff07", | ||
185 | + "srcPort": "21", | ||
186 | + "dst": "of:0000ffffffffff05", | ||
187 | + "dstPort": "20", | ||
188 | + "type": "optical", | ||
189 | + "linkWidth": 2 | ||
190 | + }, | ||
191 | + { | ||
192 | + "src": "of:0000ffffffff0001", | ||
193 | + "srcPort": "2", | ||
194 | + "dst": "of:0000ffffffffff01", | ||
195 | + "dstPort": "1", | ||
196 | + "type": "optical", | ||
197 | + "linkWidth": 2 | ||
198 | + }, | ||
199 | + { | ||
200 | + "src": "of:0000ffffffffff09", | ||
201 | + "srcPort": "20", | ||
202 | + "dst": "of:0000ffffffffff0A", | ||
203 | + "dstPort": "20", | ||
204 | + "type": "optical", | ||
205 | + "linkWidth": 2 | ||
206 | + }, | ||
207 | + { | ||
208 | + "src": "of:0000ffffffffff06", | ||
209 | + "srcPort": "20", | ||
210 | + "dst": "of:0000ffffffffff05", | ||
211 | + "dstPort": "30", | ||
212 | + "type": "optical", | ||
213 | + "linkWidth": 2 | ||
214 | + }, | ||
215 | + { | ||
216 | + "src": "of:0000ffffffffff07", | ||
217 | + "srcPort": "30", | ||
218 | + "dst": "of:0000ffffffffff08", | ||
219 | + "dstPort": "20", | ||
220 | + "type": "optical", | ||
221 | + "linkWidth": 2 | ||
222 | + }, | ||
223 | + { | ||
224 | + "src": "of:0000ffffffffff03", | ||
225 | + "srcPort": "20", | ||
226 | + "dst": "of:0000ffffffffff06", | ||
227 | + "dstPort": "10", | ||
228 | + "type": "optical", | ||
229 | + "linkWidth": 2 | ||
230 | + }, | ||
231 | + { | ||
232 | + "src": "of:0000ffffffffff02", | ||
233 | + "srcPort": "10", | ||
234 | + "dst": "of:0000ffffffffff01", | ||
235 | + "dstPort": "10", | ||
236 | + "type": "optical", | ||
237 | + "linkWidth": 2 | ||
238 | + }, | ||
239 | + { | ||
240 | + "src": "of:0000ffffffffff09", | ||
241 | + "srcPort": "1", | ||
242 | + "dst": "of:0000ffffffff0009", | ||
243 | + "dstPort": "2", | ||
244 | + "type": "optical", | ||
245 | + "linkWidth": 2 | ||
246 | + }, | ||
247 | + { | ||
248 | + "src": "of:0000ffffffffff03", | ||
249 | + "srcPort": "30", | ||
250 | + "dst": "of:0000ffffffffff04", | ||
251 | + "dstPort": "10", | ||
252 | + "type": "optical", | ||
253 | + "linkWidth": 2 | ||
254 | + }, | ||
255 | + { | ||
256 | + "src": "of:0000ffffffffff07", | ||
257 | + "srcPort": "20", | ||
258 | + "dst": "of:0000ffffffffff09", | ||
259 | + "dstPort": "10", | ||
260 | + "type": "optical", | ||
261 | + "linkWidth": 2 | ||
262 | + }, | ||
263 | + { | ||
264 | + "src": "of:0000ffffffffff0A", | ||
265 | + "srcPort": "10", | ||
266 | + "dst": "of:0000ffffffffff08", | ||
267 | + "dstPort": "30", | ||
268 | + "type": "optical", | ||
269 | + "linkWidth": 2 | ||
270 | + }, | ||
271 | + { | ||
272 | + "src": "of:0000ffffffff0004", | ||
273 | + "srcPort": "2", | ||
274 | + "dst": "of:0000ffffffffff04", | ||
275 | + "dstPort": "1", | ||
276 | + "type": "optical", | ||
277 | + "linkWidth": 2 | ||
278 | + }, | ||
279 | + { | ||
280 | + "src": "of:0000ffffffffff07", | ||
281 | + "srcPort": "1", | ||
282 | + "dst": "of:0000ffffffff0007", | ||
283 | + "dstPort": "2", | ||
284 | + "type": "optical", | ||
285 | + "linkWidth": 2 | ||
286 | + }, | ||
287 | + { | ||
288 | + "src": "of:0000ffffffff0003", | ||
289 | + "srcPort": "2", | ||
290 | + "dst": "of:0000ffffffffff03", | ||
291 | + "dstPort": "1", | ||
292 | + "type": "optical", | ||
293 | + "linkWidth": 2 | ||
294 | + }, | ||
295 | + { | ||
296 | + "src": "of:0000ffffffffff06", | ||
297 | + "srcPort": "30", | ||
298 | + "dst": "of:0000ffffffffff08", | ||
299 | + "dstPort": "10", | ||
300 | + "type": "optical", | ||
301 | + "linkWidth": 2 | ||
302 | + } | ||
303 | + ], | ||
304 | + "hosts": [ | ||
305 | + { | ||
306 | + "id": "00:00:00:00:00:03/-1", | ||
307 | + "cp": { | ||
308 | + "device": "of:0000ffffffff0003", | ||
309 | + "port": 1 | ||
310 | + }, | ||
311 | + "labels": [ | ||
312 | + "10.0.0.3", | ||
313 | + "00:00:00:00:00:03" | ||
314 | + ] | ||
315 | + }, | ||
316 | + { | ||
317 | + "id": "00:00:00:00:00:04/-1", | ||
318 | + "cp": { | ||
319 | + "device": "of:0000ffffffff0004", | ||
320 | + "port": 1 | ||
321 | + }, | ||
322 | + "labels": [ | ||
323 | + "10.0.0.4", | ||
324 | + "00:00:00:00:00:04" | ||
325 | + ] | ||
326 | + }, | ||
327 | + { | ||
328 | + "id": "00:00:00:00:00:0A/-1", | ||
329 | + "cp": { | ||
330 | + "device": "of:0000ffffffff000A", | ||
331 | + "port": 1 | ||
332 | + }, | ||
333 | + "labels": [ | ||
334 | + "10.0.0.10", | ||
335 | + "00:00:00:00:00:0A" | ||
336 | + ] | ||
337 | + }, | ||
338 | + { | ||
339 | + "id": "00:00:00:00:00:09/-1", | ||
340 | + "cp": { | ||
341 | + "device": "of:0000ffffffff0009", | ||
342 | + "port": 1 | ||
343 | + }, | ||
344 | + "labels": [ | ||
345 | + "10.0.0.9", | ||
346 | + "00:00:00:00:00:09" | ||
347 | + ] | ||
348 | + }, | ||
349 | + { | ||
350 | + "id": "00:00:00:00:00:07/-1", | ||
351 | + "cp": { | ||
352 | + "device": "of:0000ffffffff0007", | ||
353 | + "port": 1 | ||
354 | + }, | ||
355 | + "labels": [ | ||
356 | + "10.0.0.7", | ||
357 | + "00:00:00:00:00:07" | ||
358 | + ] | ||
359 | + }, | ||
360 | + { | ||
361 | + "id": "00:00:00:00:00:01/-1", | ||
362 | + "cp": { | ||
363 | + "device": "of:0000ffffffff0001", | ||
364 | + "port": 1 | ||
365 | + }, | ||
366 | + "labels": [ | ||
367 | + "10.0.0.1", | ||
368 | + "00:00:00:00:00:01" | ||
369 | + ] | ||
370 | + } | ||
371 | + ] | ||
372 | +} |
web/gui/src/main/webapp/json/topoTest_3.json
0 → 100644
1 | +{ | ||
2 | + "comment": [ | ||
3 | + "1 optical switch removed from base", | ||
4 | + " ff07 " | ||
5 | + ], | ||
6 | + "devices": [ | ||
7 | + { | ||
8 | + "id": "of:0000ffffffffff08", | ||
9 | + "type": "roadm", | ||
10 | + "online": false, | ||
11 | + "labels": [ | ||
12 | + "0000ffffffffff08", | ||
13 | + "FF:FF:FF:FF:FF:08", | ||
14 | + "?" | ||
15 | + ] | ||
16 | + }, | ||
17 | + { | ||
18 | + "id": "of:0000ffffffffff03", | ||
19 | + "type": "roadm", | ||
20 | + "online": false, | ||
21 | + "labels": [ | ||
22 | + "0000ffffffffff03", | ||
23 | + "FF:FF:FF:FF:FF:03", | ||
24 | + "?" | ||
25 | + ] | ||
26 | + }, | ||
27 | + { | ||
28 | + "id": "of:0000ffffffffff02", | ||
29 | + "type": "roadm", | ||
30 | + "online": false, | ||
31 | + "labels": [ | ||
32 | + "0000ffffffffff02", | ||
33 | + "FF:FF:FF:FF:FF:02", | ||
34 | + "?" | ||
35 | + ] | ||
36 | + }, | ||
37 | + { | ||
38 | + "id": "of:0000ffffffff0003", | ||
39 | + "type": "switch", | ||
40 | + "online": false, | ||
41 | + "labels": [ | ||
42 | + "0000ffffffff0003", | ||
43 | + "FF:FF:FF:FF:00:03", | ||
44 | + "?" | ||
45 | + ] | ||
46 | + }, | ||
47 | + { | ||
48 | + "id": "of:0000ffffffffff06", | ||
49 | + "type": "roadm", | ||
50 | + "online": false, | ||
51 | + "labels": [ | ||
52 | + "0000ffffffffff06", | ||
53 | + "FF:FF:FF:FF:FF:06", | ||
54 | + "?" | ||
55 | + ] | ||
56 | + }, | ||
57 | + { | ||
58 | + "id": "of:0000ffffffff0007", | ||
59 | + "type": "switch", | ||
60 | + "online": false, | ||
61 | + "labels": [ | ||
62 | + "0000ffffffff0007", | ||
63 | + "FF:FF:FF:FF:00:07", | ||
64 | + "?" | ||
65 | + ] | ||
66 | + }, | ||
67 | + { | ||
68 | + "id": "of:0000ffffffffff05", | ||
69 | + "type": "roadm", | ||
70 | + "online": false, | ||
71 | + "labels": [ | ||
72 | + "0000ffffffffff05", | ||
73 | + "FF:FF:FF:FF:FF:05", | ||
74 | + "?" | ||
75 | + ] | ||
76 | + }, | ||
77 | + { | ||
78 | + "id": "of:0000ffffffff0009", | ||
79 | + "type": "switch", | ||
80 | + "online": false, | ||
81 | + "labels": [ | ||
82 | + "0000ffffffff0009", | ||
83 | + "FF:FF:FF:FF:00:09", | ||
84 | + "?" | ||
85 | + ] | ||
86 | + }, | ||
87 | + { | ||
88 | + "id": "of:0000ffffffffff04", | ||
89 | + "type": "roadm", | ||
90 | + "online": false, | ||
91 | + "labels": [ | ||
92 | + "0000ffffffffff04", | ||
93 | + "FF:FF:FF:FF:FF:04", | ||
94 | + "?" | ||
95 | + ] | ||
96 | + }, | ||
97 | + { | ||
98 | + "id": "of:0000ffffffff000A", | ||
99 | + "type": "switch", | ||
100 | + "online": false, | ||
101 | + "labels": [ | ||
102 | + "0000ffffffff000A", | ||
103 | + "FF:FF:FF:FF:00:0A", | ||
104 | + "?" | ||
105 | + ] | ||
106 | + }, | ||
107 | + { | ||
108 | + "id": "of:0000ffffffff0001", | ||
109 | + "type": "switch", | ||
110 | + "online": false, | ||
111 | + "labels": [ | ||
112 | + "0000ffffffff0001", | ||
113 | + "FF:FF:FF:FF:00:01", | ||
114 | + "?" | ||
115 | + ] | ||
116 | + }, | ||
117 | + { | ||
118 | + "id": "of:0000ffffffffff01", | ||
119 | + "type": "roadm", | ||
120 | + "online": false, | ||
121 | + "labels": [ | ||
122 | + "0000ffffffffff01", | ||
123 | + "FF:FF:FF:FF:FF:01", | ||
124 | + "?" | ||
125 | + ] | ||
126 | + }, | ||
127 | + { | ||
128 | + "id": "of:0000ffffffff0004", | ||
129 | + "type": "switch", | ||
130 | + "online": false, | ||
131 | + "labels": [ | ||
132 | + "0000ffffffff0004", | ||
133 | + "FF:FF:FF:FF:00:04", | ||
134 | + "?" | ||
135 | + ] | ||
136 | + }, | ||
137 | + { | ||
138 | + "id": "of:0000ffffffffff0A", | ||
139 | + "type": "roadm", | ||
140 | + "online": false, | ||
141 | + "labels": [ | ||
142 | + "0000ffffffffff0A", | ||
143 | + "FF:FF:FF:FF:FF:0A", | ||
144 | + "?" | ||
145 | + ] | ||
146 | + }, | ||
147 | + { | ||
148 | + "id": "of:0000ffffffffff09", | ||
149 | + "type": "roadm", | ||
150 | + "online": false, | ||
151 | + "labels": [ | ||
152 | + "0000ffffffffff09", | ||
153 | + "FF:FF:FF:FF:FF:09", | ||
154 | + "?" | ||
155 | + ] | ||
156 | + } | ||
157 | + ], | ||
158 | + "links": [ | ||
159 | + { | ||
160 | + "src": "of:0000ffffffffff02", | ||
161 | + "srcPort": "20", | ||
162 | + "dst": "of:0000ffffffffff05", | ||
163 | + "dstPort": "10", | ||
164 | + "type": "optical", | ||
165 | + "linkWidth": 2 | ||
166 | + }, | ||
167 | + { | ||
168 | + "src": "of:0000ffffffff000A", | ||
169 | + "srcPort": "2", | ||
170 | + "dst": "of:0000ffffffffff0A", | ||
171 | + "dstPort": "1", | ||
172 | + "type": "optical", | ||
173 | + "linkWidth": 2 | ||
174 | + }, | ||
175 | + { | ||
176 | + "src": "of:0000ffffffffff03", | ||
177 | + "srcPort": "10", | ||
178 | + "dst": "of:0000ffffffffff02", | ||
179 | + "dstPort": "10", | ||
180 | + "type": "optical", | ||
181 | + "linkWidth": 2 | ||
182 | + }, | ||
183 | + { | ||
184 | + "src": "of:0000ffffffffff07", | ||
185 | + "srcPort": "21", | ||
186 | + "dst": "of:0000ffffffffff05", | ||
187 | + "dstPort": "20", | ||
188 | + "type": "optical", | ||
189 | + "linkWidth": 2 | ||
190 | + }, | ||
191 | + { | ||
192 | + "src": "of:0000ffffffff0001", | ||
193 | + "srcPort": "2", | ||
194 | + "dst": "of:0000ffffffffff01", | ||
195 | + "dstPort": "1", | ||
196 | + "type": "optical", | ||
197 | + "linkWidth": 2 | ||
198 | + }, | ||
199 | + { | ||
200 | + "src": "of:0000ffffffffff09", | ||
201 | + "srcPort": "20", | ||
202 | + "dst": "of:0000ffffffffff0A", | ||
203 | + "dstPort": "20", | ||
204 | + "type": "optical", | ||
205 | + "linkWidth": 2 | ||
206 | + }, | ||
207 | + { | ||
208 | + "src": "of:0000ffffffffff06", | ||
209 | + "srcPort": "20", | ||
210 | + "dst": "of:0000ffffffffff05", | ||
211 | + "dstPort": "30", | ||
212 | + "type": "optical", | ||
213 | + "linkWidth": 2 | ||
214 | + }, | ||
215 | + { | ||
216 | + "src": "of:0000ffffffffff07", | ||
217 | + "srcPort": "30", | ||
218 | + "dst": "of:0000ffffffffff08", | ||
219 | + "dstPort": "20", | ||
220 | + "type": "optical", | ||
221 | + "linkWidth": 2 | ||
222 | + }, | ||
223 | + { | ||
224 | + "src": "of:0000ffffffffff03", | ||
225 | + "srcPort": "20", | ||
226 | + "dst": "of:0000ffffffffff06", | ||
227 | + "dstPort": "10", | ||
228 | + "type": "optical", | ||
229 | + "linkWidth": 2 | ||
230 | + }, | ||
231 | + { | ||
232 | + "src": "of:0000ffffffffff02", | ||
233 | + "srcPort": "10", | ||
234 | + "dst": "of:0000ffffffffff01", | ||
235 | + "dstPort": "10", | ||
236 | + "type": "optical", | ||
237 | + "linkWidth": 2 | ||
238 | + }, | ||
239 | + { | ||
240 | + "src": "of:0000ffffffffff09", | ||
241 | + "srcPort": "1", | ||
242 | + "dst": "of:0000ffffffff0009", | ||
243 | + "dstPort": "2", | ||
244 | + "type": "optical", | ||
245 | + "linkWidth": 2 | ||
246 | + }, | ||
247 | + { | ||
248 | + "src": "of:0000ffffffffff03", | ||
249 | + "srcPort": "30", | ||
250 | + "dst": "of:0000ffffffffff04", | ||
251 | + "dstPort": "10", | ||
252 | + "type": "optical", | ||
253 | + "linkWidth": 2 | ||
254 | + }, | ||
255 | + { | ||
256 | + "src": "of:0000ffffffffff07", | ||
257 | + "srcPort": "20", | ||
258 | + "dst": "of:0000ffffffffff09", | ||
259 | + "dstPort": "10", | ||
260 | + "type": "optical", | ||
261 | + "linkWidth": 2 | ||
262 | + }, | ||
263 | + { | ||
264 | + "src": "of:0000ffffffffff0A", | ||
265 | + "srcPort": "10", | ||
266 | + "dst": "of:0000ffffffffff08", | ||
267 | + "dstPort": "30", | ||
268 | + "type": "optical", | ||
269 | + "linkWidth": 2 | ||
270 | + }, | ||
271 | + { | ||
272 | + "src": "of:0000ffffffff0004", | ||
273 | + "srcPort": "2", | ||
274 | + "dst": "of:0000ffffffffff04", | ||
275 | + "dstPort": "1", | ||
276 | + "type": "optical", | ||
277 | + "linkWidth": 2 | ||
278 | + }, | ||
279 | + { | ||
280 | + "src": "of:0000ffffffffff07", | ||
281 | + "srcPort": "1", | ||
282 | + "dst": "of:0000ffffffff0007", | ||
283 | + "dstPort": "2", | ||
284 | + "type": "optical", | ||
285 | + "linkWidth": 2 | ||
286 | + }, | ||
287 | + { | ||
288 | + "src": "of:0000ffffffff0003", | ||
289 | + "srcPort": "2", | ||
290 | + "dst": "of:0000ffffffffff03", | ||
291 | + "dstPort": "1", | ||
292 | + "type": "optical", | ||
293 | + "linkWidth": 2 | ||
294 | + }, | ||
295 | + { | ||
296 | + "src": "of:0000ffffffffff06", | ||
297 | + "srcPort": "30", | ||
298 | + "dst": "of:0000ffffffffff08", | ||
299 | + "dstPort": "10", | ||
300 | + "type": "optical", | ||
301 | + "linkWidth": 2 | ||
302 | + } | ||
303 | + ], | ||
304 | + "hosts": [ | ||
305 | + { | ||
306 | + "id": "00:00:00:00:00:03/-1", | ||
307 | + "cp": { | ||
308 | + "device": "of:0000ffffffff0003", | ||
309 | + "port": 1 | ||
310 | + }, | ||
311 | + "labels": [ | ||
312 | + "10.0.0.3", | ||
313 | + "00:00:00:00:00:03" | ||
314 | + ] | ||
315 | + }, | ||
316 | + { | ||
317 | + "id": "00:00:00:00:00:04/-1", | ||
318 | + "cp": { | ||
319 | + "device": "of:0000ffffffff0004", | ||
320 | + "port": 1 | ||
321 | + }, | ||
322 | + "labels": [ | ||
323 | + "10.0.0.4", | ||
324 | + "00:00:00:00:00:04" | ||
325 | + ] | ||
326 | + }, | ||
327 | + { | ||
328 | + "id": "00:00:00:00:00:0A/-1", | ||
329 | + "cp": { | ||
330 | + "device": "of:0000ffffffff000A", | ||
331 | + "port": 1 | ||
332 | + }, | ||
333 | + "labels": [ | ||
334 | + "10.0.0.10", | ||
335 | + "00:00:00:00:00:0A" | ||
336 | + ] | ||
337 | + }, | ||
338 | + { | ||
339 | + "id": "00:00:00:00:00:09/-1", | ||
340 | + "cp": { | ||
341 | + "device": "of:0000ffffffff0009", | ||
342 | + "port": 1 | ||
343 | + }, | ||
344 | + "labels": [ | ||
345 | + "10.0.0.9", | ||
346 | + "00:00:00:00:00:09" | ||
347 | + ] | ||
348 | + }, | ||
349 | + { | ||
350 | + "id": "00:00:00:00:00:07/-1", | ||
351 | + "cp": { | ||
352 | + "device": "of:0000ffffffff0007", | ||
353 | + "port": 1 | ||
354 | + }, | ||
355 | + "labels": [ | ||
356 | + "10.0.0.7", | ||
357 | + "00:00:00:00:00:07" | ||
358 | + ] | ||
359 | + }, | ||
360 | + { | ||
361 | + "id": "00:00:00:00:00:01/-1", | ||
362 | + "cp": { | ||
363 | + "device": "of:0000ffffffff0001", | ||
364 | + "port": 1 | ||
365 | + }, | ||
366 | + "labels": [ | ||
367 | + "10.0.0.1", | ||
368 | + "00:00:00:00:00:01" | ||
369 | + ] | ||
370 | + } | ||
371 | + ] | ||
372 | +} |
web/gui/src/main/webapp/json/topoTest_4.json
0 → 100644
1 | +{ | ||
2 | + "comment": [ | ||
3 | + "3 hosts added to base", | ||
4 | + " 2 to 000A, 1 to 0007 " | ||
5 | + ], | ||
6 | + "devices": [ | ||
7 | + { | ||
8 | + "id": "of:0000ffffffffff08", | ||
9 | + "type": "roadm", | ||
10 | + "online": false, | ||
11 | + "labels": [ | ||
12 | + "0000ffffffffff08", | ||
13 | + "FF:FF:FF:FF:FF:08", | ||
14 | + "?" | ||
15 | + ] | ||
16 | + }, | ||
17 | + { | ||
18 | + "id": "of:0000ffffffffff03", | ||
19 | + "type": "roadm", | ||
20 | + "online": false, | ||
21 | + "labels": [ | ||
22 | + "0000ffffffffff03", | ||
23 | + "FF:FF:FF:FF:FF:03", | ||
24 | + "?" | ||
25 | + ] | ||
26 | + }, | ||
27 | + { | ||
28 | + "id": "of:0000ffffffffff02", | ||
29 | + "type": "roadm", | ||
30 | + "online": false, | ||
31 | + "labels": [ | ||
32 | + "0000ffffffffff02", | ||
33 | + "FF:FF:FF:FF:FF:02", | ||
34 | + "?" | ||
35 | + ] | ||
36 | + }, | ||
37 | + { | ||
38 | + "id": "of:0000ffffffff0003", | ||
39 | + "type": "switch", | ||
40 | + "online": false, | ||
41 | + "labels": [ | ||
42 | + "0000ffffffff0003", | ||
43 | + "FF:FF:FF:FF:00:03", | ||
44 | + "?" | ||
45 | + ] | ||
46 | + }, | ||
47 | + { | ||
48 | + "id": "of:0000ffffffffff07", | ||
49 | + "type": "roadm", | ||
50 | + "online": false, | ||
51 | + "labels": [ | ||
52 | + "0000ffffffffff07", | ||
53 | + "FF:FF:FF:FF:FF:07", | ||
54 | + "?" | ||
55 | + ] | ||
56 | + }, | ||
57 | + { | ||
58 | + "id": "of:0000ffffffffff06", | ||
59 | + "type": "roadm", | ||
60 | + "online": false, | ||
61 | + "labels": [ | ||
62 | + "0000ffffffffff06", | ||
63 | + "FF:FF:FF:FF:FF:06", | ||
64 | + "?" | ||
65 | + ] | ||
66 | + }, | ||
67 | + { | ||
68 | + "id": "of:0000ffffffff0007", | ||
69 | + "type": "switch", | ||
70 | + "online": false, | ||
71 | + "labels": [ | ||
72 | + "0000ffffffff0007", | ||
73 | + "FF:FF:FF:FF:00:07", | ||
74 | + "?" | ||
75 | + ] | ||
76 | + }, | ||
77 | + { | ||
78 | + "id": "of:0000ffffffffff05", | ||
79 | + "type": "roadm", | ||
80 | + "online": false, | ||
81 | + "labels": [ | ||
82 | + "0000ffffffffff05", | ||
83 | + "FF:FF:FF:FF:FF:05", | ||
84 | + "?" | ||
85 | + ] | ||
86 | + }, | ||
87 | + { | ||
88 | + "id": "of:0000ffffffff0009", | ||
89 | + "type": "switch", | ||
90 | + "online": false, | ||
91 | + "labels": [ | ||
92 | + "0000ffffffff0009", | ||
93 | + "FF:FF:FF:FF:00:09", | ||
94 | + "?" | ||
95 | + ] | ||
96 | + }, | ||
97 | + { | ||
98 | + "id": "of:0000ffffffffff04", | ||
99 | + "type": "roadm", | ||
100 | + "online": false, | ||
101 | + "labels": [ | ||
102 | + "0000ffffffffff04", | ||
103 | + "FF:FF:FF:FF:FF:04", | ||
104 | + "?" | ||
105 | + ] | ||
106 | + }, | ||
107 | + { | ||
108 | + "id": "of:0000ffffffff000A", | ||
109 | + "type": "switch", | ||
110 | + "online": false, | ||
111 | + "labels": [ | ||
112 | + "0000ffffffff000A", | ||
113 | + "FF:FF:FF:FF:00:0A", | ||
114 | + "?" | ||
115 | + ] | ||
116 | + }, | ||
117 | + { | ||
118 | + "id": "of:0000ffffffff0001", | ||
119 | + "type": "switch", | ||
120 | + "online": false, | ||
121 | + "labels": [ | ||
122 | + "0000ffffffff0001", | ||
123 | + "FF:FF:FF:FF:00:01", | ||
124 | + "?" | ||
125 | + ] | ||
126 | + }, | ||
127 | + { | ||
128 | + "id": "of:0000ffffffffff01", | ||
129 | + "type": "roadm", | ||
130 | + "online": false, | ||
131 | + "labels": [ | ||
132 | + "0000ffffffffff01", | ||
133 | + "FF:FF:FF:FF:FF:01", | ||
134 | + "?" | ||
135 | + ] | ||
136 | + }, | ||
137 | + { | ||
138 | + "id": "of:0000ffffffff0004", | ||
139 | + "type": "switch", | ||
140 | + "online": false, | ||
141 | + "labels": [ | ||
142 | + "0000ffffffff0004", | ||
143 | + "FF:FF:FF:FF:00:04", | ||
144 | + "?" | ||
145 | + ] | ||
146 | + }, | ||
147 | + { | ||
148 | + "id": "of:0000ffffffffff0A", | ||
149 | + "type": "roadm", | ||
150 | + "online": false, | ||
151 | + "labels": [ | ||
152 | + "0000ffffffffff0A", | ||
153 | + "FF:FF:FF:FF:FF:0A", | ||
154 | + "?" | ||
155 | + ] | ||
156 | + }, | ||
157 | + { | ||
158 | + "id": "of:0000ffffffffff09", | ||
159 | + "type": "roadm", | ||
160 | + "online": false, | ||
161 | + "labels": [ | ||
162 | + "0000ffffffffff09", | ||
163 | + "FF:FF:FF:FF:FF:09", | ||
164 | + "?" | ||
165 | + ] | ||
166 | + } | ||
167 | + ], | ||
168 | + "links": [ | ||
169 | + { | ||
170 | + "src": "of:0000ffffffffff02", | ||
171 | + "srcPort": "20", | ||
172 | + "dst": "of:0000ffffffffff05", | ||
173 | + "dstPort": "10", | ||
174 | + "type": "optical", | ||
175 | + "linkWidth": 2 | ||
176 | + }, | ||
177 | + { | ||
178 | + "src": "of:0000ffffffff000A", | ||
179 | + "srcPort": "2", | ||
180 | + "dst": "of:0000ffffffffff0A", | ||
181 | + "dstPort": "1", | ||
182 | + "type": "optical", | ||
183 | + "linkWidth": 2 | ||
184 | + }, | ||
185 | + { | ||
186 | + "src": "of:0000ffffffffff03", | ||
187 | + "srcPort": "10", | ||
188 | + "dst": "of:0000ffffffffff02", | ||
189 | + "dstPort": "10", | ||
190 | + "type": "optical", | ||
191 | + "linkWidth": 2 | ||
192 | + }, | ||
193 | + { | ||
194 | + "src": "of:0000ffffffffff07", | ||
195 | + "srcPort": "21", | ||
196 | + "dst": "of:0000ffffffffff05", | ||
197 | + "dstPort": "20", | ||
198 | + "type": "optical", | ||
199 | + "linkWidth": 2 | ||
200 | + }, | ||
201 | + { | ||
202 | + "src": "of:0000ffffffff0001", | ||
203 | + "srcPort": "2", | ||
204 | + "dst": "of:0000ffffffffff01", | ||
205 | + "dstPort": "1", | ||
206 | + "type": "optical", | ||
207 | + "linkWidth": 2 | ||
208 | + }, | ||
209 | + { | ||
210 | + "src": "of:0000ffffffffff09", | ||
211 | + "srcPort": "20", | ||
212 | + "dst": "of:0000ffffffffff0A", | ||
213 | + "dstPort": "20", | ||
214 | + "type": "optical", | ||
215 | + "linkWidth": 2 | ||
216 | + }, | ||
217 | + { | ||
218 | + "src": "of:0000ffffffffff06", | ||
219 | + "srcPort": "20", | ||
220 | + "dst": "of:0000ffffffffff05", | ||
221 | + "dstPort": "30", | ||
222 | + "type": "optical", | ||
223 | + "linkWidth": 2 | ||
224 | + }, | ||
225 | + { | ||
226 | + "src": "of:0000ffffffffff07", | ||
227 | + "srcPort": "30", | ||
228 | + "dst": "of:0000ffffffffff08", | ||
229 | + "dstPort": "20", | ||
230 | + "type": "optical", | ||
231 | + "linkWidth": 2 | ||
232 | + }, | ||
233 | + { | ||
234 | + "src": "of:0000ffffffffff03", | ||
235 | + "srcPort": "20", | ||
236 | + "dst": "of:0000ffffffffff06", | ||
237 | + "dstPort": "10", | ||
238 | + "type": "optical", | ||
239 | + "linkWidth": 2 | ||
240 | + }, | ||
241 | + { | ||
242 | + "src": "of:0000ffffffffff02", | ||
243 | + "srcPort": "10", | ||
244 | + "dst": "of:0000ffffffffff01", | ||
245 | + "dstPort": "10", | ||
246 | + "type": "optical", | ||
247 | + "linkWidth": 2 | ||
248 | + }, | ||
249 | + { | ||
250 | + "src": "of:0000ffffffffff09", | ||
251 | + "srcPort": "1", | ||
252 | + "dst": "of:0000ffffffff0009", | ||
253 | + "dstPort": "2", | ||
254 | + "type": "optical", | ||
255 | + "linkWidth": 2 | ||
256 | + }, | ||
257 | + { | ||
258 | + "src": "of:0000ffffffffff03", | ||
259 | + "srcPort": "30", | ||
260 | + "dst": "of:0000ffffffffff04", | ||
261 | + "dstPort": "10", | ||
262 | + "type": "optical", | ||
263 | + "linkWidth": 2 | ||
264 | + }, | ||
265 | + { | ||
266 | + "src": "of:0000ffffffffff07", | ||
267 | + "srcPort": "20", | ||
268 | + "dst": "of:0000ffffffffff09", | ||
269 | + "dstPort": "10", | ||
270 | + "type": "optical", | ||
271 | + "linkWidth": 2 | ||
272 | + }, | ||
273 | + { | ||
274 | + "src": "of:0000ffffffffff0A", | ||
275 | + "srcPort": "10", | ||
276 | + "dst": "of:0000ffffffffff08", | ||
277 | + "dstPort": "30", | ||
278 | + "type": "optical", | ||
279 | + "linkWidth": 2 | ||
280 | + }, | ||
281 | + { | ||
282 | + "src": "of:0000ffffffff0004", | ||
283 | + "srcPort": "2", | ||
284 | + "dst": "of:0000ffffffffff04", | ||
285 | + "dstPort": "1", | ||
286 | + "type": "optical", | ||
287 | + "linkWidth": 2 | ||
288 | + }, | ||
289 | + { | ||
290 | + "src": "of:0000ffffffffff07", | ||
291 | + "srcPort": "1", | ||
292 | + "dst": "of:0000ffffffff0007", | ||
293 | + "dstPort": "2", | ||
294 | + "type": "optical", | ||
295 | + "linkWidth": 2 | ||
296 | + }, | ||
297 | + { | ||
298 | + "src": "of:0000ffffffff0003", | ||
299 | + "srcPort": "2", | ||
300 | + "dst": "of:0000ffffffffff03", | ||
301 | + "dstPort": "1", | ||
302 | + "type": "optical", | ||
303 | + "linkWidth": 2 | ||
304 | + }, | ||
305 | + { | ||
306 | + "src": "of:0000ffffffffff06", | ||
307 | + "srcPort": "30", | ||
308 | + "dst": "of:0000ffffffffff08", | ||
309 | + "dstPort": "10", | ||
310 | + "type": "optical", | ||
311 | + "linkWidth": 2 | ||
312 | + } | ||
313 | + ], | ||
314 | + "hosts": [ | ||
315 | + { | ||
316 | + "id": "00:00:00:00:00:03/-1", | ||
317 | + "cp": { | ||
318 | + "device": "of:0000ffffffff0003", | ||
319 | + "port": 1 | ||
320 | + }, | ||
321 | + "labels": [ | ||
322 | + "10.0.0.3", | ||
323 | + "00:00:00:00:00:03" | ||
324 | + ] | ||
325 | + }, | ||
326 | + { | ||
327 | + "id": "00:00:00:00:00:04/-1", | ||
328 | + "cp": { | ||
329 | + "device": "of:0000ffffffff0004", | ||
330 | + "port": 1 | ||
331 | + }, | ||
332 | + "labels": [ | ||
333 | + "10.0.0.4", | ||
334 | + "00:00:00:00:00:04" | ||
335 | + ] | ||
336 | + }, | ||
337 | + { | ||
338 | + "id": "00:00:00:00:00:0A/-1", | ||
339 | + "cp": { | ||
340 | + "device": "of:0000ffffffff000A", | ||
341 | + "port": 1 | ||
342 | + }, | ||
343 | + "labels": [ | ||
344 | + "10.0.0.10", | ||
345 | + "00:00:00:00:00:0A" | ||
346 | + ] | ||
347 | + }, | ||
348 | + { | ||
349 | + "id": "00:00:00:00:65:0A/-1", | ||
350 | + "cp": { | ||
351 | + "device": "of:0000ffffffff000A", | ||
352 | + "port": 101 | ||
353 | + }, | ||
354 | + "labels": [ | ||
355 | + "10.0.0.101", | ||
356 | + "00:00:00:00:65:0A" | ||
357 | + ] | ||
358 | + }, | ||
359 | + { | ||
360 | + "id": "00:00:00:00:66:0A/-1", | ||
361 | + "cp": { | ||
362 | + "device": "of:0000ffffffff000A", | ||
363 | + "port": 102 | ||
364 | + }, | ||
365 | + "labels": [ | ||
366 | + "10.0.0.102", | ||
367 | + "00:00:00:00:66:0A" | ||
368 | + ] | ||
369 | + }, | ||
370 | + { | ||
371 | + "id": "00:00:00:00:00:09/-1", | ||
372 | + "cp": { | ||
373 | + "device": "of:0000ffffffff0009", | ||
374 | + "port": 1 | ||
375 | + }, | ||
376 | + "labels": [ | ||
377 | + "10.0.0.9", | ||
378 | + "00:00:00:00:00:09" | ||
379 | + ] | ||
380 | + }, | ||
381 | + { | ||
382 | + "id": "00:00:00:00:00:07/-1", | ||
383 | + "cp": { | ||
384 | + "device": "of:0000ffffffff0007", | ||
385 | + "port": 1 | ||
386 | + }, | ||
387 | + "labels": [ | ||
388 | + "10.0.0.7", | ||
389 | + "00:00:00:00:00:07" | ||
390 | + ] | ||
391 | + }, | ||
392 | + { | ||
393 | + "id": "00:00:00:00:67:07/-1", | ||
394 | + "cp": { | ||
395 | + "device": "of:0000ffffffff0007", | ||
396 | + "port": 103 | ||
397 | + }, | ||
398 | + "labels": [ | ||
399 | + "10.0.0.73", | ||
400 | + "00:00:00:00:67:07" | ||
401 | + ] | ||
402 | + }, | ||
403 | + { | ||
404 | + "id": "00:00:00:00:00:01/-1", | ||
405 | + "cp": { | ||
406 | + "device": "of:0000ffffffff0001", | ||
407 | + "port": 1 | ||
408 | + }, | ||
409 | + "labels": [ | ||
410 | + "10.0.0.1", | ||
411 | + "00:00:00:00:00:01" | ||
412 | + ] | ||
413 | + } | ||
414 | + ] | ||
415 | +} |
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 | +} |
... | @@ -50,7 +50,10 @@ | ... | @@ -50,7 +50,10 @@ |
50 | }, | 50 | }, |
51 | built = false, | 51 | built = false, |
52 | errorCount = 0, | 52 | errorCount = 0, |
53 | - keyHandler = {}; | 53 | + keyHandler = { |
54 | + fn: null, | ||
55 | + map: {} | ||
56 | + }; | ||
54 | 57 | ||
55 | // DOM elements etc. | 58 | // DOM elements etc. |
56 | var $view, | 59 | var $view, |
... | @@ -258,50 +261,56 @@ | ... | @@ -258,50 +261,56 @@ |
258 | } | 261 | } |
259 | 262 | ||
260 | // generate 'unique' id by prefixing view id | 263 | // generate 'unique' id by prefixing view id |
261 | - function uid(view, id) { | 264 | + function makeUid(view, id) { |
262 | return view.vid + '-' + id; | 265 | return view.vid + '-' + id; |
263 | } | 266 | } |
264 | 267 | ||
265 | // restore id by removing view id prefix | 268 | // restore id by removing view id prefix |
266 | - function unUid(view, uid) { | 269 | + function unmakeUid(view, uid) { |
267 | var re = new RegExp('^' + view.vid + '-'); | 270 | var re = new RegExp('^' + view.vid + '-'); |
268 | return uid.replace(re, ''); | 271 | return uid.replace(re, ''); |
269 | } | 272 | } |
270 | 273 | ||
271 | - function setRadioButtons(vid, btnSet, callback) { | 274 | + function setRadioButtons(vid, btnSet) { |
272 | var view = views[vid], | 275 | var view = views[vid], |
273 | btnG; | 276 | btnG; |
274 | 277 | ||
275 | // lazily create the buttons... | 278 | // lazily create the buttons... |
276 | if (!(btnG = view.radioButtons)) { | 279 | if (!(btnG = view.radioButtons)) { |
277 | btnG = d3.select(document.createElement('div')); | 280 | btnG = d3.select(document.createElement('div')); |
281 | + btnG.buttonDef = {}; | ||
278 | 282 | ||
279 | btnSet.forEach(function (btn, i) { | 283 | btnSet.forEach(function (btn, i) { |
280 | var bid = btn.id || 'b' + i, | 284 | var bid = btn.id || 'b' + i, |
281 | txt = btn.text || 'Button #' + i, | 285 | txt = btn.text || 'Button #' + i, |
282 | - b = btnG.append('span') | 286 | + uid = makeUid(view, bid), |
287 | + button = btnG.append('span') | ||
283 | .attr({ | 288 | .attr({ |
284 | - id: uid(view, bid), | 289 | + id: uid, |
285 | class: 'radio' | 290 | class: 'radio' |
286 | }) | 291 | }) |
287 | .text(txt); | 292 | .text(txt); |
293 | + | ||
294 | + btnG.buttonDef[uid] = btn; | ||
295 | + | ||
288 | if (i === 0) { | 296 | if (i === 0) { |
289 | - b.classed('active', true); | 297 | + button.classed('active', true); |
290 | } | 298 | } |
291 | }); | 299 | }); |
292 | 300 | ||
293 | btnG.selectAll('span') | 301 | btnG.selectAll('span') |
294 | .on('click', function (d) { | 302 | .on('click', function (d) { |
295 | - var btn = d3.select(this), | 303 | + var button = d3.select(this), |
296 | - bid = btn.attr('id'), | 304 | + uid = button.attr('id'), |
297 | - act = btn.classed('active'); | 305 | + btn = btnG.buttonDef[uid], |
306 | + act = button.classed('active'); | ||
298 | 307 | ||
299 | if (!act) { | 308 | if (!act) { |
300 | - $mastRadio.selectAll('span') | 309 | + btnG.selectAll('span').classed('active', false); |
301 | - .classed('active', false); | 310 | + button.classed('active', true); |
302 | - btn.classed('active', true); | 311 | + if (isF(btn.cb)) { |
303 | - | 312 | + btn.cb(view.token(), btn); |
304 | - callback(view.token(), unUid(view, bid)); | 313 | + } |
305 | } | 314 | } |
306 | }); | 315 | }); |
307 | 316 | ||
... | @@ -479,8 +488,8 @@ | ... | @@ -479,8 +488,8 @@ |
479 | return $(this.$div.node()).height(); | 488 | return $(this.$div.node()).height(); |
480 | }, | 489 | }, |
481 | 490 | ||
482 | - setRadio: function (btnSet, cb) { | 491 | + setRadio: function (btnSet) { |
483 | - setRadioButtons(this.vid, btnSet, cb); | 492 | + setRadioButtons(this.vid, btnSet); |
484 | }, | 493 | }, |
485 | 494 | ||
486 | setKeys: function (keyArg) { | 495 | setKeys: function (keyArg) { |
... | @@ -488,7 +497,7 @@ | ... | @@ -488,7 +497,7 @@ |
488 | }, | 497 | }, |
489 | 498 | ||
490 | uid: function (id) { | 499 | uid: function (id) { |
491 | - return uid(this, id); | 500 | + return makeUid(this, id); |
492 | } | 501 | } |
493 | 502 | ||
494 | // TODO: consider schedule, clearTimer, etc. | 503 | // TODO: consider schedule, clearTimer, etc. | ... | ... |
... | @@ -23,41 +23,41 @@ | ... | @@ -23,41 +23,41 @@ |
23 | (function (onos) { | 23 | (function (onos) { |
24 | 'use strict'; | 24 | 'use strict'; |
25 | 25 | ||
26 | - var data = [ 'Yo, radio button set...', 'Time to shine' ], | 26 | + var intro = [ 'Yo, radio button set...', 'Time to shine' ], |
27 | btnSet = [ | 27 | btnSet = [ |
28 | - { id: 'b1', text: 'First Button' }, | 28 | + { text: 'First Button', cb: cbRadio }, |
29 | - { id: 'b2', text: 'Second Button' }, | 29 | + { text: 'Second Button', cb: cbRadio }, |
30 | - { id: 'b3', text: 'Third Button' } | 30 | + { text: 'Third Button', cb: cbRadio } |
31 | - ], | 31 | + ]; |
32 | - btnLookup = {}; | ||
33 | 32 | ||
34 | - btnSet.forEach(function (b) { | 33 | + // radio button callback |
35 | - btnLookup[b.id] = b; | 34 | + function cbRadio(view, btn) { |
35 | + write(view, 'You pressed the ' + btn.text); | ||
36 | + } | ||
37 | + | ||
38 | + function write(view, msg) { | ||
39 | + view.$div.append('p') | ||
40 | + .text(msg) | ||
41 | + .style({ | ||
42 | + 'font-size': '10pt', | ||
43 | + color: 'green', | ||
44 | + padding: '0 20px', | ||
45 | + margin: '2px' | ||
36 | }); | 46 | }); |
47 | + } | ||
37 | 48 | ||
38 | // invoked when the view is loaded | 49 | // invoked when the view is loaded |
39 | function load(view, ctx) { | 50 | function load(view, ctx) { |
40 | - view.setRadio(btnSet, doRadio); | 51 | + view.setRadio(btnSet); |
41 | 52 | ||
42 | view.$div.selectAll('p') | 53 | view.$div.selectAll('p') |
43 | - .data(data) | 54 | + .data(intro) |
44 | .enter() | 55 | .enter() |
45 | .append('p') | 56 | .append('p') |
46 | .text(function (d) { return d; }) | 57 | .text(function (d) { return d; }) |
47 | .style('padding', '2px 8px'); | 58 | .style('padding', '2px 8px'); |
48 | } | 59 | } |
49 | 60 | ||
50 | - function doRadio(view, id) { | ||
51 | - view.$div.append('p') | ||
52 | - .text('You pressed the ' + btnLookup[id].text) | ||
53 | - .style({ | ||
54 | - 'font-size': '10pt', | ||
55 | - color: 'green', | ||
56 | - padding: '0 20px', | ||
57 | - margin: '2px' | ||
58 | - }); | ||
59 | - } | ||
60 | - | ||
61 | // == register the view here, with links to lifecycle callbacks | 61 | // == register the view here, with links to lifecycle callbacks |
62 | 62 | ||
63 | onos.ui.addView('sampleRadio', { | 63 | onos.ui.addView('sampleRadio', { | ... | ... |
... | @@ -68,60 +68,131 @@ | ... | @@ -68,60 +68,131 @@ |
68 | 68 | ||
69 | // radio buttons | 69 | // radio buttons |
70 | var btnSet = [ | 70 | var btnSet = [ |
71 | - { id: 'showAll', text: 'All Layers' }, | 71 | + { text: 'All Layers', cb: showAllLayers }, |
72 | - { id: 'showPkt', text: 'Packet Only' }, | 72 | + { text: 'Packet Only', cb: showPacketLayer }, |
73 | - { id: 'showOpt', text: 'Optical Only' } | 73 | + { text: 'Optical Only', cb: showOpticalLayer } |
74 | ]; | 74 | ]; |
75 | 75 | ||
76 | + // key bindings | ||
77 | + var keyDispatch = { | ||
78 | + Q: getUpdatedNetworkData, | ||
79 | + B: toggleBg, | ||
80 | + G: toggleLayout, | ||
81 | + L: cycleLabels, | ||
82 | + P: togglePorts, | ||
83 | + U: unpin | ||
84 | + }; | ||
85 | + | ||
76 | // state variables | 86 | // state variables |
77 | - var svg, | 87 | + var network = {}, |
78 | - bgImg, | ||
79 | - network = {}, | ||
80 | selected = {}, | 88 | selected = {}, |
81 | highlighted = null, | 89 | highlighted = null, |
82 | hovered = null, | 90 | hovered = null, |
83 | viewMode = 'showAll', | 91 | viewMode = 'showAll', |
84 | portLabelsOn = false; | 92 | portLabelsOn = false; |
85 | 93 | ||
94 | + // D3 selections | ||
95 | + var svg, | ||
96 | + bgImg, | ||
97 | + topoG; | ||
86 | 98 | ||
87 | // ============================== | 99 | // ============================== |
88 | - // Private functions | 100 | + // For Debugging / Development |
101 | + | ||
102 | + var topoPrefix = 'json/topoTest_', | ||
103 | + lastFlavor = 4, | ||
104 | + topoBase = true, | ||
105 | + topoFlavor = 1; | ||
106 | + | ||
107 | + function nextTopo() { | ||
108 | + if (topoBase) { | ||
109 | + topoBase = false; | ||
110 | + } else { | ||
111 | + topoBase = true; | ||
112 | + topoFlavor = (topoFlavor === lastFlavor) ? 1 : topoFlavor + 1 | ||
113 | + } | ||
114 | + } | ||
89 | 115 | ||
90 | - // set the size of the SVG layer (or other element) to that of the view | 116 | + // TODO change this to return the live data URL |
91 | - function setSize(view, el) { | 117 | + function getTopoUrl() { |
92 | - var thing = el || svg; | 118 | + var suffix = topoBase ? 'base' : topoFlavor; |
93 | - thing.attr({ | 119 | + return topoPrefix + suffix + '.json'; |
94 | - width: view.width(), | ||
95 | - height: view.height() | ||
96 | - }); | ||
97 | } | 120 | } |
98 | 121 | ||
99 | - function doRadio(view, id) { | 122 | + // ============================== |
100 | - showAllLayers(); | 123 | + // Key Callbacks |
101 | - if (id === 'showPkt') { | 124 | + |
102 | - showPacketLayer(); | 125 | + function getUpdatedNetworkData(view) { |
103 | - } else if (id === 'showOpt') { | 126 | + nextTopo(); |
104 | - showOpticalLayer(); | 127 | + getNetworkData(view); |
128 | + } | ||
129 | + | ||
130 | + function toggleBg() { | ||
131 | + var vis = bgImg.style('visibility'); | ||
132 | + bgImg.style('visibility', (vis === 'hidden') ? 'visible' : 'hidden'); | ||
133 | + } | ||
134 | + | ||
135 | + function toggleLayout(view) { | ||
136 | + | ||
105 | } | 137 | } |
138 | + | ||
139 | + function cycleLabels(view) { | ||
140 | + | ||
106 | } | 141 | } |
107 | 142 | ||
143 | + function togglePorts(view) { | ||
144 | + | ||
145 | + } | ||
146 | + | ||
147 | + function unpin(view) { | ||
148 | + | ||
149 | + } | ||
150 | + | ||
151 | + // ============================== | ||
152 | + // Radio Button Callbacks | ||
153 | + | ||
108 | function showAllLayers() { | 154 | function showAllLayers() { |
109 | // network.node.classed('inactive', false); | 155 | // network.node.classed('inactive', false); |
110 | // network.link.classed('inactive', false); | 156 | // network.link.classed('inactive', false); |
111 | // d3.selectAll('svg .port').classed('inactive', false); | 157 | // d3.selectAll('svg .port').classed('inactive', false); |
112 | // d3.selectAll('svg .portText').classed('inactive', false); | 158 | // d3.selectAll('svg .portText').classed('inactive', false); |
113 | - alert('show all layers'); | 159 | + // TODO ... |
160 | + console.log('showAllLayers()'); | ||
114 | } | 161 | } |
115 | 162 | ||
116 | function showPacketLayer() { | 163 | function showPacketLayer() { |
117 | - alert('show packet layer'); | 164 | + showAllLayers(); |
165 | + // TODO ... | ||
166 | + console.log('showPacketLayer()'); | ||
118 | } | 167 | } |
119 | 168 | ||
120 | function showOpticalLayer() { | 169 | function showOpticalLayer() { |
121 | - alert('show optical layer'); | 170 | + showAllLayers(); |
171 | + // TODO ... | ||
172 | + console.log('showOpticalLayer()'); | ||
122 | } | 173 | } |
123 | 174 | ||
124 | // ============================== | 175 | // ============================== |
176 | + // Private functions | ||
177 | + | ||
178 | + // set the size of the given element to that of the view | ||
179 | + function setSize(el, view) { | ||
180 | + el.attr({ | ||
181 | + width: view.width(), | ||
182 | + height: view.height() | ||
183 | + }); | ||
184 | + } | ||
185 | + | ||
186 | + | ||
187 | + function getNetworkData(view) { | ||
188 | + var url = getTopoUrl(); | ||
189 | + | ||
190 | + // TODO ... | ||
191 | + | ||
192 | + } | ||
193 | + | ||
194 | + | ||
195 | + // ============================== | ||
125 | // View life-cycle callbacks | 196 | // View life-cycle callbacks |
126 | 197 | ||
127 | function preload(view, ctx) { | 198 | function preload(view, ctx) { |
... | @@ -132,8 +203,9 @@ | ... | @@ -132,8 +203,9 @@ |
132 | 203 | ||
133 | // NOTE: view.$div is a D3 selection of the view's div | 204 | // NOTE: view.$div is a D3 selection of the view's div |
134 | svg = view.$div.append('svg'); | 205 | svg = view.$div.append('svg'); |
135 | - setSize(view); | 206 | + setSize(svg, view); |
136 | - svg.append('g') | 207 | + |
208 | + topoG = svg.append('g') | ||
137 | .attr('transform', config.force.translate()); | 209 | .attr('transform', config.force.translate()); |
138 | 210 | ||
139 | // load the background image | 211 | // load the background image |
... | @@ -151,13 +223,15 @@ | ... | @@ -151,13 +223,15 @@ |
151 | 223 | ||
152 | 224 | ||
153 | function load(view, ctx) { | 225 | function load(view, ctx) { |
154 | - view.setRadio(btnSet, doRadio); | 226 | + view.setRadio(btnSet); |
227 | + view.setKeys(keyDispatch); | ||
155 | 228 | ||
229 | + getNetworkData(view); | ||
156 | } | 230 | } |
157 | 231 | ||
158 | function resize(view, ctx) { | 232 | function resize(view, ctx) { |
159 | - setSize(view); | 233 | + setSize(svg, view); |
160 | - setSize(view, bgImg); | 234 | + setSize(bgImg, view); |
161 | } | 235 | } |
162 | 236 | ||
163 | 237 | ... | ... |
-
Please register or login to post a comment