Committed by
Gerrit Code Review
Fixing various GUI traffic/usage issues.
Reduced key help font. Change-Id: I273f840aec85c13763688dfee8b3f26c8d1d5233
Showing
8 changed files
with
14 additions
and
125 deletions
File moved
tools/package/archetypes/web-bundle/src/main/java/sample/bundle/AppComponent.java
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 | -package sample.bundle; | ||
17 | - | ||
18 | -import org.apache.felix.scr.annotations.Activate; | ||
19 | -import org.apache.felix.scr.annotations.Component; | ||
20 | -import org.apache.felix.scr.annotations.Deactivate; | ||
21 | -import org.apache.felix.scr.annotations.Service; | ||
22 | -import org.slf4j.Logger; | ||
23 | -import org.slf4j.LoggerFactory; | ||
24 | - | ||
25 | -/** | ||
26 | - * Skeletal ONOS application component. | ||
27 | - */ | ||
28 | -@Component(immediate = true) | ||
29 | -@Service | ||
30 | -public class AppComponent implements AppService { | ||
31 | - | ||
32 | - private static Logger log = LoggerFactory.getLogger(AppComponent.class); | ||
33 | - | ||
34 | - @Activate | ||
35 | - protected void activate() { | ||
36 | - log.info("Started"); | ||
37 | - } | ||
38 | - | ||
39 | - @Deactivate | ||
40 | - protected void deactivate() { | ||
41 | - log.info("Stopped"); | ||
42 | - } | ||
43 | - | ||
44 | -} |
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 | -package sample.bundle; | ||
17 | - | ||
18 | -/** | ||
19 | - * Skeletal ONOS application API. | ||
20 | - */ | ||
21 | -public interface AppService { | ||
22 | - | ||
23 | -} |
tools/package/archetypes/web-bundle/src/test/java/sample/bundle/AppComponentTest.java
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 | -package sample.bundle; | ||
17 | - | ||
18 | -import org.junit.After; | ||
19 | -import org.junit.Before; | ||
20 | -import org.junit.Test; | ||
21 | - | ||
22 | -/** | ||
23 | - * Set of tests of the ONOS application component. | ||
24 | - */ | ||
25 | -public class AppComponentTest { | ||
26 | - | ||
27 | - private AppComponent component; | ||
28 | - | ||
29 | - @Before | ||
30 | - public void setUp() { | ||
31 | - component = new AppComponent(); | ||
32 | - component.activate(); | ||
33 | - | ||
34 | - } | ||
35 | - | ||
36 | - @After | ||
37 | - public void tearDown() { | ||
38 | - component.deactivate(); | ||
39 | - } | ||
40 | - | ||
41 | - @Test | ||
42 | - public void basics() { | ||
43 | - | ||
44 | - } | ||
45 | - | ||
46 | -} |
... | @@ -213,6 +213,7 @@ public class TopologyViewWebSocket | ... | @@ -213,6 +213,7 @@ public class TopologyViewWebSocket |
213 | processMessage((ObjectNode) mapper.reader().readTree(data)); | 213 | processMessage((ObjectNode) mapper.reader().readTree(data)); |
214 | } catch (Exception e) { | 214 | } catch (Exception e) { |
215 | log.warn("Unable to parse GUI request {} due to {}", data, e); | 215 | log.warn("Unable to parse GUI request {} due to {}", data, e); |
216 | + log.warn("Boom!!!", e); | ||
216 | } | 217 | } |
217 | } | 218 | } |
218 | 219 | ||
... | @@ -384,7 +385,6 @@ public class TopologyViewWebSocket | ... | @@ -384,7 +385,6 @@ public class TopologyViewWebSocket |
384 | } | 385 | } |
385 | 386 | ||
386 | 387 | ||
387 | - | ||
388 | private Set<ConnectPoint> getHostLocations(Set<HostId> hostIds) { | 388 | private Set<ConnectPoint> getHostLocations(Set<HostId> hostIds) { |
389 | Set<ConnectPoint> points = new HashSet<>(); | 389 | Set<ConnectPoint> points = new HashSet<>(); |
390 | for (HostId hostId : hostIds) { | 390 | for (HostId hostId : hostIds) { |
... | @@ -459,8 +459,6 @@ public class TopologyViewWebSocket | ... | @@ -459,8 +459,6 @@ public class TopologyViewWebSocket |
459 | // Cancel any other traffic monitoring mode. | 459 | // Cancel any other traffic monitoring mode. |
460 | stopTrafficMonitoring(); | 460 | stopTrafficMonitoring(); |
461 | 461 | ||
462 | - String hover = string(payload, "hover"); | ||
463 | - if (haveSelectedIntents()) { | ||
464 | // Get the set of selected hosts and their intents. | 462 | // Get the set of selected hosts and their intents. |
465 | ArrayNode ids = (ArrayNode) payload.path("ids"); | 463 | ArrayNode ids = (ArrayNode) payload.path("ids"); |
466 | selectedHosts = getHosts(ids); | 464 | selectedHosts = getHosts(ids); |
... | @@ -469,11 +467,11 @@ public class TopologyViewWebSocket | ... | @@ -469,11 +467,11 @@ public class TopologyViewWebSocket |
469 | intentService.getIntents()); | 467 | intentService.getIntents()); |
470 | currentIntentIndex = -1; | 468 | currentIntentIndex = -1; |
471 | 469 | ||
470 | + String hover = string(payload, "hover"); | ||
471 | + if (haveSelectedIntents()) { | ||
472 | // Send a message to highlight all links of all monitored intents. | 472 | // Send a message to highlight all links of all monitored intents. |
473 | sendMessage(trafficMessage(sid, new TrafficClass("primary", selectedIntents))); | 473 | sendMessage(trafficMessage(sid, new TrafficClass("primary", selectedIntents))); |
474 | - } | 474 | + } else if (!isNullOrEmpty(hover)) { |
475 | - | ||
476 | - if (!isNullOrEmpty(hover)) { | ||
477 | // If there is a hover node, include it in the selection and find intents. | 475 | // If there is a hover node, include it in the selection and find intents. |
478 | processExtendedSelection(sid, hover); | 476 | processExtendedSelection(sid, hover); |
479 | } | 477 | } |
... | @@ -484,6 +482,7 @@ public class TopologyViewWebSocket | ... | @@ -484,6 +482,7 @@ public class TopologyViewWebSocket |
484 | } | 482 | } |
485 | 483 | ||
486 | private void processExtendedSelection(long sid, String hover) { | 484 | private void processExtendedSelection(long sid, String hover) { |
485 | + if (haveSelectedIntents()) { | ||
487 | Set<Host> hoverSelHosts = new HashSet<>(selectedHosts); | 486 | Set<Host> hoverSelHosts = new HashSet<>(selectedHosts); |
488 | Set<Device> hoverSelDevices = new HashSet<>(selectedDevices); | 487 | Set<Device> hoverSelDevices = new HashSet<>(selectedDevices); |
489 | addHover(hoverSelHosts, hoverSelDevices, hover); | 488 | addHover(hoverSelHosts, hoverSelDevices, hover); |
... | @@ -498,6 +497,7 @@ public class TopologyViewWebSocket | ... | @@ -498,6 +497,7 @@ public class TopologyViewWebSocket |
498 | sendMessage(trafficMessage(sid, new TrafficClass("primary", primary), | 497 | sendMessage(trafficMessage(sid, new TrafficClass("primary", primary), |
499 | new TrafficClass("secondary", secondary))); | 498 | new TrafficClass("secondary", secondary))); |
500 | } | 499 | } |
500 | + } | ||
501 | 501 | ||
502 | // Requests next of the related intents. | 502 | // Requests next of the related intents. |
503 | private void requestNextRelatedIntent(ObjectNode event) { | 503 | private void requestNextRelatedIntent(ObjectNode event) { |
... | @@ -522,6 +522,9 @@ public class TopologyViewWebSocket | ... | @@ -522,6 +522,9 @@ public class TopologyViewWebSocket |
522 | // Requests monitoring of traffic for the selected intent. | 522 | // Requests monitoring of traffic for the selected intent. |
523 | private void requestSelectedIntentTraffic(ObjectNode event) { | 523 | private void requestSelectedIntentTraffic(ObjectNode event) { |
524 | if (haveSelectedIntents()) { | 524 | if (haveSelectedIntents()) { |
525 | + if (currentIntentIndex < 0) { | ||
526 | + currentIntentIndex = 0; | ||
527 | + } | ||
525 | Intent selectedIntent = selectedIntents.get(currentIntentIndex); | 528 | Intent selectedIntent = selectedIntents.get(currentIntentIndex); |
526 | log.info("Requested traffic for selected {}", selectedIntent.id()); | 529 | log.info("Requested traffic for selected {}", selectedIntent.id()); |
527 | 530 | ... | ... |
... | @@ -36,7 +36,7 @@ | ... | @@ -36,7 +36,7 @@ |
36 | } | 36 | } |
37 | 37 | ||
38 | #quickhelp svg text.title { | 38 | #quickhelp svg text.title { |
39 | - font-size: 10pt; | 39 | + font-size: 8pt; |
40 | font-style: italic; | 40 | font-style: italic; |
41 | text-anchor: middle; | 41 | text-anchor: middle; |
42 | fill: #999; | 42 | fill: #999; |
... | @@ -52,17 +52,17 @@ | ... | @@ -52,17 +52,17 @@ |
52 | } | 52 | } |
53 | 53 | ||
54 | #quickhelp svg text { | 54 | #quickhelp svg text { |
55 | - font-size: 7pt; | 55 | + font-size: 5pt; |
56 | alignment-baseline: middle; | 56 | alignment-baseline: middle; |
57 | } | 57 | } |
58 | 58 | ||
59 | #quickhelp svg text.key { | 59 | #quickhelp svg text.key { |
60 | - font-size: 7pt; | 60 | + font-size: 5pt; |
61 | fill: #add; | 61 | fill: #add; |
62 | } | 62 | } |
63 | 63 | ||
64 | #quickhelp svg text.desc { | 64 | #quickhelp svg text.desc { |
65 | - font-size: 7pt; | 65 | + font-size: 5pt; |
66 | fill: #ddd; | 66 | fill: #ddd; |
67 | } | 67 | } |
68 | 68 | ... | ... |
-
Please register or login to post a comment