Bri Prebilic Cole

ONOS-2033 - GUI -- Buckets in groups view are one per line, Link direction on li…

…nks view has HTML arrow.

Change-Id: I6adfb49a05fba0160ce60a22ee4b63bac817fca0
...@@ -103,7 +103,7 @@ public class GroupViewMessageHandler extends UiMessageHandler { ...@@ -103,7 +103,7 @@ public class GroupViewMessageHandler extends UiMessageHandler {
103 } 103 }
104 104
105 private final class BucketFormatter implements CellFormatter { 105 private final class BucketFormatter implements CellFormatter {
106 - private static final String COMMA = ", "; 106 + private static final String BREAK = "<br>";
107 107
108 @Override 108 @Override
109 public String format(Object value) { 109 public String format(Object value) {
...@@ -121,18 +121,11 @@ public class GroupViewMessageHandler extends UiMessageHandler { ...@@ -121,18 +121,11 @@ public class GroupViewMessageHandler extends UiMessageHandler {
121 .append(b.packets()) 121 .append(b.packets())
122 .append(" Actions: ") 122 .append(" Actions: ")
123 .append(b.treatment().allInstructions()) 123 .append(b.treatment().allInstructions())
124 - .append(COMMA); 124 + .append(BREAK);
125 } 125 }
126 - removeTrailingComma(sb);
127 126
128 return sb.toString(); 127 return sb.toString();
129 } 128 }
130 -
131 - private StringBuilder removeTrailingComma(StringBuilder sb) {
132 - int pos = sb.lastIndexOf(COMMA);
133 - sb.delete(pos, sb.length());
134 - return sb;
135 - }
136 } 129 }
137 } 130 }
138 } 131 }
......
...@@ -125,7 +125,7 @@ public class LinkViewMessageHandler extends UiMessageHandler { ...@@ -125,7 +125,7 @@ public class LinkViewMessageHandler extends UiMessageHandler {
125 } 125 }
126 126
127 private String linkDir(BiLink link) { 127 private String linkDir(BiLink link) {
128 - return link.two != null ? "A <--> B" : "A --> B"; 128 + return link.two != null ? "A &harr; B" : "A &rarr; B";
129 } 129 }
130 } 130 }
131 } 131 }
......
...@@ -62,7 +62,8 @@ ...@@ -62,7 +62,8 @@
62 </tr> 62 </tr>
63 <tr class="ignore-width" 63 <tr class="ignore-width"
64 ng-repeat-end ng-repeat-done> 64 ng-repeat-end ng-repeat-done>
65 - <td class="buckets" colspan="6">{{group.buckets}}</td> 65 + <td class="buckets" colspan="6"
66 + ng-bind-html="group.buckets"></td>
66 </tr> 67 </tr>
67 </table> 68 </table>
68 </div> 69 </div>
......
...@@ -48,6 +48,14 @@ ...@@ -48,6 +48,14 @@
48 query: params 48 query: params
49 }); 49 });
50 50
51 + $scope.$watch('tableData', function () {
52 + if (!fs.isEmptyObject($scope.tableData)) {
53 + $scope.tableData.forEach(function (group) {
54 + group.buckets = $sce.trustAsHtml(group.buckets);
55 + });
56 + }
57 + });
58 +
51 $log.log('OvGroupCtrl has been created'); 59 $log.log('OvGroupCtrl has been created');
52 }]); 60 }]);
53 }()); 61 }());
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
57 <td>{{link.one}}</td> 57 <td>{{link.one}}</td>
58 <td>{{link.two}}</td> 58 <td>{{link.two}}</td>
59 <td>{{link.type}}</td> 59 <td>{{link.type}}</td>
60 - <td>{{link.direction}}</td> 60 + <td ng-bind-html="link.direction"></td>
61 <td>{{link.durable}}</td> 61 <td>{{link.durable}}</td>
62 </tr> 62 </tr>
63 </table> 63 </table>
......
...@@ -23,14 +23,22 @@ ...@@ -23,14 +23,22 @@
23 23
24 angular.module('ovLink', []) 24 angular.module('ovLink', [])
25 .controller('OvLinkCtrl', 25 .controller('OvLinkCtrl',
26 - ['$log', '$scope', 'TableBuilderService', 26 + ['$log', '$scope', '$sce', 'FnService', 'TableBuilderService',
27 27
28 - function ($log, $scope, tbs) { 28 + function ($log, $scope, $sce, fs, tbs) {
29 tbs.buildTable({ 29 tbs.buildTable({
30 scope: $scope, 30 scope: $scope,
31 tag: 'link' 31 tag: 'link'
32 }); 32 });
33 33
34 + $scope.$watch('tableData', function () {
35 + if (!fs.isEmptyObject($scope.tableData)) {
36 + $scope.tableData.forEach(function (link) {
37 + link.direction = $sce.trustAsHtml(link.direction);
38 + });
39 + }
40 + });
41 +
34 $log.log('OvLinkCtrl has been created'); 42 $log.log('OvLinkCtrl has been created');
35 }]); 43 }]);
36 }()); 44 }());
......