Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

adding team searching #13

Merged
merged 1 commit into from
Nov 17, 2017
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
16 changes: 16 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,22 @@ server.register([
}
});

server.route({
method: 'GET',
path: '/team/{team}',
handler: {
file: 'public/index.html'
}
});

server.route({
method: 'GET',
path: '/team/{team}/search/{pattern*}',
handler: {
file: 'public/index.html'
}
});

server.route({
method: 'GET',
path: '/e',
Expand Down
18 changes: 16 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,17 @@
$scope.concourseInfo = jsinfo;
}

var pathSearch = $window.location.pathname.split('/').slice(1);
pathSearch = pathSearch[0] === 'search' ? pathSearch.slice(1).join('/') : false;
var windowPath = $window.location.pathname.split('/').slice(1);
var pathTeam;
if (windowPath[0] === 'team') {
windowPath.shift(); // team
pathTeam = windowPath.shift();
}
var pathSearch;
if (windowPath[0] === 'search') {
windowPath.shift(); // search
pathSearch = windowPath.shift();
}
$scope.getPipes = function() {
$http({
method: 'GET',
Expand All @@ -540,6 +549,11 @@
return item.name.includes(pathSearch);
});
}
if (pathTeam) {
response.data = response.data.filter(function(item) {
return item.team_name.includes(pathTeam);
});
}
$scope.setPipes(response.data);
}, function(err) {
console.error(err);
Expand Down