Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit aa41cf1

Browse files
committed
server-gh-235 Improve search capability in the list pages
* Add server-backed filtering to Stream and Task definition list pages * Remove client-side filtering
1 parent 8caf9a6 commit aa41cf1

File tree

15 files changed

+36
-75
lines changed

15 files changed

+36
-75
lines changed

ui/app/scripts/analytics/views/counters.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33
<div class="col-md-12 table-filter">
44
<div>
55
<table class="col-lg-12 tab-content-header"><tr>
6-
<td width="67%">
6+
<td>
77
<label>Update [seconds]:</label>
88
<input type="text" ng-model="refreshRate" ng-model-options="{ getterSetter: true, updateOn: 'blur change' }" size="3"></input>
99
</td>
10-
<td>
11-
<input type="text" class="form-control" ng-model="filterQuery" id="filterTable"
12-
placeholder="Quick filter">
13-
</td>
1410
</tr></table>
1511
</div>
1612
</div>
@@ -26,7 +22,7 @@
2622
</tr>
2723
</thead>
2824
<tbody>
29-
<tr dir-paginate="item in pageable.items | itemsPerPage: pageable.pageSize | filter:filterQuery" total-items="pageable.total">
25+
<tr dir-paginate="item in pageable.items | itemsPerPage: pageable.pageSize" total-items="pageable.total">
3026
<td>{{item.name}}</td>
3127
<td>{{item.value}}</td>
3228
<td>{{item.rates.length ? item.rates[item.rates.length - 1] : '--N/A--'}}</td>

ui/app/scripts/analytics/views/dashboard.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
Clear
1111
</button>
1212
</td>
13-
<td>
14-
<input type="text" class="form-control" ng-model="filterQuery" id="filterTable"
15-
placeholder="Quick filter">
16-
</td>
1713
</tr></table>
1814
</div>
1915
</div>
@@ -31,7 +27,7 @@
3127
</tr>
3228
</thead>
3329
<tbody>
34-
<tr ng-repeat-start="item in items | filter:filterQuery">
30+
<tr ng-repeat-start="item in items">
3531
<td>
3632
<select ng-model="item.type" ng-options="type.label for type in allMetricTypes"
3733
ng-change="item.stream = ''; item.visualization = '';">

ui/app/scripts/analytics/views/gauges.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22
<div class="col-md-12">
33
<div class="col-md-12 table-filter">
44
<table class="col-lg-12 tab-content-header"><tr>
5-
<td width="67%">
5+
<td>
66
<label>Update [seconds]:</label>
77
<input type="text" ng-model="refreshRate" ng-model-options="{ getterSetter: true, updateOn: 'blur change' }" size="3"></input>
88
</td>
9-
<td>
10-
<input type="text" class="form-control" ng-model="filterQuery" id="filterTable"
11-
placeholder="Quick filter">
12-
</td>
139
</tr></table>
1410
</div>
1511
</div>
@@ -23,7 +19,7 @@
2319
</tr>
2420
</thead>
2521
<tbody>
26-
<tr ng-repeat="item in items | filter:filterQuery">
22+
<tr ng-repeat="item in items">
2723
<td>{{item.name}}</td>
2824
<td>{{item.value}}</td>
2925
<td><graph-chart chart-data="item.values" height="140" total="totalCacheSize()" reverse="true" axis-units-x="'seconds ago'" axis-units-y="'value'" units-per-tick-x="refreshRate()"></graph-chart></td>

ui/app/scripts/analytics/views/rich-gauges.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22
<div class="col-md-12">
33
<div class="col-md-12 table-filter">
44
<table class="col-lg-12 tab-content-header"><tr>
5-
<td width="67%">
5+
<td>
66
<label>Update [seconds]:</label>
77
<input type="text" ng-model="refreshRate" ng-model-options="{ getterSetter: true, updateOn: 'blur change' }" size="3"></input>
88
</td>
9-
<td>
10-
<input type="text" class="form-control" ng-model="filterQuery" id="filterTable"
11-
placeholder="Quick filter">
12-
</td>
139
</tr></table>
1410
</div>
1511
</div>
@@ -26,7 +22,7 @@
2622
</tr>
2723
</thead>
2824
<tbody>
29-
<tr ng-repeat="item in items track by item.name | filter:filterQuery">
25+
<tr ng-repeat="item in items track by item.name">
3026
<td>{{item.name}}</td>
3127
<td>{{item.value}}</td>
3228
<td>{{item.min}}</td>

ui/app/scripts/app/views/apps-list.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
Bulk Import Applications
2121
</button>
2222
</td>
23-
<td>
24-
<input type="text" class="form-control" ng-model="filterQuery" id="filterTable"
25-
placeholder="Quick filter">
26-
</td>
2723
</tr></table>
2824
</div>
2925
</div>
@@ -43,7 +39,7 @@
4339
</thead>
4440
<tbody>
4541

46-
<tr dir-paginate="item in pageable.items | itemsPerPage: pageable.pageSize | filter:filterQuery track by item.id" total-items="pageable.total">
42+
<tr dir-paginate="item in pageable.items | itemsPerPage: pageable.pageSize" total-items="pageable.total">
4743
<td><input type="checkbox" ng-model="item.select" ng-model-options="{ getterSetter: true }"/></td>
4844
<td>{{item.name}}</td>
4945
<td>{{item.type}}</td>

ui/app/scripts/job/views/execution-details.html

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,6 @@ <h4 ng-show="jobExecutionDetails">Steps</h4>
113113

114114
<h4 ng-show="jobExecutionDetails.composedJob">Composed Job - Child Job Executions</h4>
115115

116-
<div class="row" ng-show="jobExecutionDetails.composedJob">
117-
<div class="col-md-12">
118-
<div class="col-md-12 table-filter">
119-
<div class="col-md-4 col-md-offset-8">
120-
<input type="text" class="form-control" ng-model="filterQuery" id="filterTable" placeholder="Quick filter">
121-
</div>
122-
</div>
123-
</div>
124-
</div>
125116
<table class="table table-striped table-hover" ng-show="jobExecutionDetails.composedJob">
126117
<thead>
127118
<tr>
@@ -130,7 +121,7 @@ <h4 ng-show="jobExecutionDetails.composedJob">Composed Job - Child Job Execution
130121
</tr>
131122
</thead>
132123
<tbody>
133-
<tr ng-repeat="item in jobExecutionDetails.childJobExecutions | filter:filterQuery"
124+
<tr ng-repeat="item in jobExecutionDetails.childJobExecutions"
134125
ng-show="!item.inactive">
135126
<td>{{item.name}}&nbsp;<span dataflow-deployment-status="item"></span><span dataflow-composed-job-status="item"></span></td>
136127
<td class="text-center">{{item.jobExecution.jobInstance.id}}</td>

ui/app/scripts/job/views/executions.html

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
<div class="row">
2-
<div class="col-md-12">
3-
<div class="col-md-12 table-filter">
4-
<div class="col-md-4 col-md-offset-8">
5-
<input type="text" class="form-control" ng-model="filterQuery" id="filterTable" placeholder="Quick filter">
6-
</div>
7-
</div>
8-
</div>
9-
</div>
101
<table class="table table-striped table-hover">
112
<thead>
123
<tr>
@@ -16,7 +7,7 @@
167
</tr>
178
</thead>
189
<tbody>
19-
<tr dir-paginate="item in pageable.items | itemsPerPage: pageable.pageSize | filter:filterQuery" total-items="pageable.total"
10+
<tr dir-paginate="item in pageable.items | itemsPerPage: pageable.pageSize" total-items="pageable.total"
2011
ng-show="!item.inactive">
2112
<td>{{item.name}}&nbsp;<span dataflow-deployment-status="item"></span><span dataflow-composed-job-status="item"></span></td>
2213
<td class="text-center">{{item.taskExecutionId}}</td>

ui/app/scripts/runtime/views/runtime-apps-list.html

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
<div class="row">
2-
<div class="col-md-12">
3-
<div class="col-md-12 table-filter">
4-
<div class="col-md-4 col-md-offset-8">
5-
<input type="text" class="form-control" ng-model="filterQuery" id="filterTable"
6-
placeholder="Quick filter">
7-
</div>
8-
</div>
9-
</div>
10-
</div>
111
<table class="cluster-view table">
122
<thead>
133
<tr>
@@ -17,7 +7,7 @@
177
</tr>
188
</thead>
199
<tbody>
20-
<tr dir-paginate="item in pageable.items | itemsPerPage: pageable.pageSize track by item.deploymentId | filter: {appDeploymentId: filterQuery}" total-items="pageable.total" ng-show="!item.inactive">
10+
<tr dir-paginate="item in pageable.items | itemsPerPage: pageable.pageSize track by item.deploymentId" total-items="pageable.total" ng-show="!item.inactive">
2111
<td id="application-id">
2212
<a data-toggle="modal" data-target="#applicationDetails{{$index}}" data-original-title="Application Attributes">{{item.deploymentId}}</a>
2313
<div class="modal fade" dataflow-modal id="applicationDetails{{$index}}" role="dialog">

ui/app/scripts/stream/controllers/definitions.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ define(['model/pageable'], function (Pageable) {
5757

5858
$scope.pageable = new Pageable();
5959
$scope.pageable.sortOrder = 'ASC';
60+
$scope.pageable.filterQuery = '';
6061
$scope.pageable.sortProperty = ['DEFINITION_NAME', 'DEFINITION'];
6162

6263
$scope.pagination = {
@@ -97,6 +98,10 @@ define(['model/pageable'], function (Pageable) {
9798
loadStreamDefinitions($scope.pageable);
9899
};
99100

101+
$scope.searchChanged = function() {
102+
loadStreamDefinitions($scope.pageable);
103+
};
104+
100105
$scope.deployStream = function (streamDefinition) {
101106
$state.go('home.streams.deployStream', {definitionName: streamDefinition.name});
102107
};

ui/app/scripts/stream/services.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ define(function(require) {
4141
};
4242

4343
params.sort = pageable.calculateSortParameter();
44+
45+
if (pageable.filterQuery && pageable.filterQuery.trim().length > 0) {
46+
params.search = pageable.filterQuery;
47+
}
4448
}
4549
return $resource($rootScope.dataflowServerUrl + '/streams/definitions', params, {
4650
query: {

0 commit comments

Comments
 (0)