onos-1818-search by tableid in Flow table
Change-Id: I2e7faeb56d7ec3eafa5e1ab2398b852e81c13d74
(cherry picked from commit 486e9af6639994ca22d0c038e43c55dd32750bb0)
diff --git a/web/gui/src/main/webapp/app/view/flow/flow.html b/web/gui/src/main/webapp/app/view/flow/flow.html
index 0186d24..912183b 100644
--- a/web/gui/src/main/webapp/app/view/flow/flow.html
+++ b/web/gui/src/main/webapp/app/view/flow/flow.html
@@ -5,6 +5,23 @@
Flows for Device {{devId || "(No device selected)"}}
({{tableData.length}} total)
</h2>
+
+ <div class="search">
+ <input type="text" ng-model="query" placeholder="Search"/>
+ <select ng-model="queryBy">
+ <option value="" disabled>Search By</option>
+ <option value="$">All</option>
+ <option value="id">Flow ID</option>
+ <option value="appId">App ID</option>
+ <option value="groupId">Group ID</option>
+ <option value="tableId">Table ID</option>
+ <option value="priority">Priority</option>
+ <option value="timeout">Timeout</option>
+ <option value="permanent">Permanent</option>
+ <option value="state">State</option>
+ </select>
+ </div>
+
<div class="ctrl-btns">
<div class="refresh" ng-class="{active: autoRefresh}"
icon icon-size="42" icon-id="refresh"
@@ -81,7 +98,7 @@
</td>
</tr>
- <tr ng-repeat-start="flow in tableData track by $index"
+ <tr ng-repeat-start="flow in tableData | filter:queryFilter track by $index"
ng-repeat-complete row-id="{{flow.id}}">
<td>{{flow.id}}</td>
<td>{{flow.appId}}</td>
diff --git a/web/gui/src/main/webapp/app/view/flow/flow.js b/web/gui/src/main/webapp/app/view/flow/flow.js
index 776f40d..b77b0e8 100644
--- a/web/gui/src/main/webapp/app/view/flow/flow.js
+++ b/web/gui/src/main/webapp/app/view/flow/flow.js
@@ -65,6 +65,15 @@
$scope.brief = !$scope.brief;
};
+ Object.defineProperty($scope, "queryFilter", {
+ get: function() {
+ var out = {};
+ out[$scope.queryBy || "$"] = $scope.query;
+ return out;
+ }
+ });
+
+
$log.log('OvFlowCtrl has been created');
}]);
}());