diff --git a/admin/js/config.js b/admin/js/config.js
index 77b8f64..432c808 100644
--- a/admin/js/config.js
+++ b/admin/js/config.js
@@ -148,6 +148,15 @@ angular.module('ffffngAdmin').config(function(NgAdminConfigurationProvider, Rest
nga.field('runningSince').map(formatMoment).cssClasses(taskClasses),
nga.field('lastRunStarted').map(formatMoment).cssClasses(taskClasses)
])
+ .filters([
+ nga.field('q')
+ .label('')
+ .pinned(true)
+ .template(
+ '
' +
+ '' +
+ '
'),
+ ])
.listActions(
' ' +
' ' +
diff --git a/server/resources/taskResource.js b/server/resources/taskResource.js
index db09100..1567019 100644
--- a/server/resources/taskResource.js
+++ b/server/resources/taskResource.js
@@ -84,9 +84,14 @@ angular.module('ffffng').factory('TaskResource', function (
['id', 'name', 'schedule', 'state', 'runningSince', 'lastRunStarted'],
restParams
);
- var total = tasks.length;
+ var filteredTasks = Resources.filter(
+ tasks,
+ ['id', 'name', 'schedule', 'state'],
+ restParams
+ );
+ var total = filteredTasks.length;
- var pageTasks = Resources.getPageEntities(tasks, restParams);
+ var pageTasks = Resources.getPageEntities(filteredTasks, restParams);
res.set('X-Total-Count', total);
return Resources.success(res, _.map(pageTasks, toExternalTask));
diff --git a/server/utils/resources.js b/server/utils/resources.js
index 1c931a3..9230869 100644
--- a/server/utils/resources.js
+++ b/server/utils/resources.js
@@ -47,6 +47,10 @@ angular.module('ffffng').factory('Resources', function (_, Constraints, Validato
return _.filter(entities, function (entity) {
return _.some(allowedFilterFields, function (field) {
var value = entity[field];
+ if (_.isNumber(value)) {
+ value = value.toString();
+ }
+
if (!_.isString(value) || _.isEmpty(value)) {
return false;
}