mirror of
https://github.com/Febbweiss/ProjectDeployer.git
synced 2026-03-04 22:25:38 +00:00
Feature: limit up to 10 deployment logs
This commit is contained in:
@@ -2,10 +2,10 @@ Deployments = new Mongo.Collection('deployments');
|
|||||||
|
|
||||||
DeploymentService = {
|
DeploymentService = {
|
||||||
list: function(id) {
|
list: function(id) {
|
||||||
var deployments = Deployments.find(),
|
var deployments = Deployments.find({}, {sort: {timestamp: -1}}),
|
||||||
altered = deployments.map(function(doc, index, cursor) {
|
altered = deployments.map(function(doc, index, cursor) {
|
||||||
return _.extend(doc, {index: deployments.count() - index});
|
return _.extend(doc, {index: deployments.count() - index});
|
||||||
});
|
});
|
||||||
return altered;
|
return altered.slice(0, 10);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user