Skip to content

Commit

Permalink
glob should behave as if ending in * for better results
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalinas committed May 11, 2016
1 parent c862700 commit e0ccdbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions SingularityUI/app/views/requests.coffee
Expand Up @@ -68,9 +68,9 @@ class RequestsView extends View
o.requestDeployState?.activeDeploy?.user or ''
if Utils.isGlobFilter filter
res1 = requests.filter (request) =>
micromatch.any id.extract(request), filter
micromatch.any id.extract(request), filter + '*'
res2 = requests.filter (request) =>
micromatch.any user.extract(request), filter
micromatch.any user.extract(request), filter + '*'
_.uniq(_.union(res2, res1)).reverse()
else
res1 = fuzzy.filter(filter, requests, id)
Expand Down
6 changes: 3 additions & 3 deletions SingularityUI/app/views/tasks.coffee
Expand Up @@ -71,11 +71,11 @@ class TasksView extends View
"#{o.rackId}"
if Utils.isGlobFilter filter
res1 = tasks.filter (task) =>
micromatch.any host.extract(task), filter
micromatch.any host.extract(task), filter + '*'
res2 = tasks.filter (task) =>
micromatch.any id.extract(task), filter
micromatch.any id.extract(task), filter + '*'
res3 = tasks.filter (task) =>
micromatch.any rack.extract(task), filter
micromatch.any rack.extract(task), filter + '*'
_.uniq(_.union(res3, _.union(res1, res2))).reverse()
else
res1 = fuzzy.filter(filter, tasks, host)
Expand Down

0 comments on commit e0ccdbd

Please sign in to comment.