sisubram
Committed by Gerrit Code Review

onos-1818-search by tableid in Flow table

Change-Id: I2e7faeb56d7ec3eafa5e1ab2398b852e81c13d74
(cherry picked from commit 486e9af6)
...@@ -5,6 +5,23 @@ ...@@ -5,6 +5,23 @@
5 Flows for Device {{devId || "(No device selected)"}} 5 Flows for Device {{devId || "(No device selected)"}}
6 ({{tableData.length}} total) 6 ({{tableData.length}} total)
7 </h2> 7 </h2>
8 +
9 + <div class="search">
10 + <input type="text" ng-model="query" placeholder="Search"/>
11 + <select ng-model="queryBy">
12 + <option value="" disabled>Search By</option>
13 + <option value="$">All</option>
14 + <option value="id">Flow ID</option>
15 + <option value="appId">App ID</option>
16 + <option value="groupId">Group ID</option>
17 + <option value="tableId">Table ID</option>
18 + <option value="priority">Priority</option>
19 + <option value="timeout">Timeout</option>
20 + <option value="permanent">Permanent</option>
21 + <option value="state">State</option>
22 + </select>
23 + </div>
24 +
8 <div class="ctrl-btns"> 25 <div class="ctrl-btns">
9 <div class="refresh" ng-class="{active: autoRefresh}" 26 <div class="refresh" ng-class="{active: autoRefresh}"
10 icon icon-size="42" icon-id="refresh" 27 icon icon-size="42" icon-id="refresh"
...@@ -81,7 +98,7 @@ ...@@ -81,7 +98,7 @@
81 </td> 98 </td>
82 </tr> 99 </tr>
83 100
84 - <tr ng-repeat-start="flow in tableData track by $index" 101 + <tr ng-repeat-start="flow in tableData | filter:queryFilter track by $index"
85 ng-repeat-complete row-id="{{flow.id}}"> 102 ng-repeat-complete row-id="{{flow.id}}">
86 <td>{{flow.id}}</td> 103 <td>{{flow.id}}</td>
87 <td>{{flow.appId}}</td> 104 <td>{{flow.appId}}</td>
......
...@@ -65,6 +65,15 @@ ...@@ -65,6 +65,15 @@
65 $scope.brief = !$scope.brief; 65 $scope.brief = !$scope.brief;
66 }; 66 };
67 67
68 + Object.defineProperty($scope, "queryFilter", {
69 + get: function() {
70 + var out = {};
71 + out[$scope.queryBy || "$"] = $scope.query;
72 + return out;
73 + }
74 + });
75 +
76 +
68 $log.log('OvFlowCtrl has been created'); 77 $log.log('OvFlowCtrl has been created');
69 }]); 78 }]);
70 }()); 79 }());
......