Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Search in all jobs with the filter box #653

Merged
merged 2 commits into from
Dec 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Features

- Search all jobs in dashboards with the search box

## [2.0.1] - 2019-12-03

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion dkron/assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ package assets

import "net/http"

// Templates contains project templates.
// Assets contains project assets.
var Assets http.FileSystem = http.Dir("../../static")
10 changes: 5 additions & 5 deletions dkron/assets/assets_vfsdata.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dkron/templates/templates_vfsdata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions static/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ dkron.filter('statusClass', function () {

dkron.constant('hideDelay', 2000);

dkron.filter('startFrom', function () {
return function (input, start) {
if (input) {
start = +start; //parse to int
return input.slice(start);
}
return [];
}
});

dkron.controller('JobListCtrl', function ($scope, $location, $http, $interval, hideDelay) {
$scope.searchJob = $location.search()['filter']

Expand Down
6 changes: 3 additions & 3 deletions templates/jobs.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</td>
</tfoot>
<tbody>
<tr ng-repeat="job in pagedItems[currentPage] | filter:searchJob">
<tr ng-repeat="job in jobs | filter:searchJob | startFrom:(currentPage)*itemsPerPage | limitTo:itemsPerPage">
<td><a ng-href="jobs/{{`{{ job.name }}`}}/executions" ng-bind="job.displayname != '' ? job.displayname : job.name"></a></td>
<td ng-bind="job.schedule"></td>
<td ng-bind="job.success_count"></td>
Expand Down Expand Up @@ -91,7 +91,7 @@
</table>

<!-- Modal Delete -->
<div ng-repeat="job in pagedItems[currentPage] | filter:searchJob" class="modal fade"
<div ng-repeat="job in jobs | filter:searchJob" class="modal fade"
id="{{`{{ $index }}`}}-modal-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
Expand All @@ -108,7 +108,7 @@
</div>

<!-- Modal -->
<div ng-repeat="job in pagedItems[currentPage] | filter:searchJob" class="modal fade" id="{{`{{ $index }}`}}-modal"
<div ng-repeat="job in jobs | filter:searchJob" class="modal fade" id="{{`{{ $index }}`}}-modal"
tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
Expand Down