WIP Page leaf
This commit is contained in:
@ -50,15 +50,16 @@ namespace isnd.Controllers
|
||||
|
||||
if (pkgvs.Count() == 0) return NotFound();
|
||||
|
||||
List<string> types = pkgvs.Select(
|
||||
List<string> types = pkgvs
|
||||
.Select(
|
||||
v => v.Type ?? "Dependency"
|
||||
).Distinct().ToList();
|
||||
)
|
||||
.Distinct().ToList();
|
||||
if (!types.Contains("PackageDelete"))
|
||||
types.Add("PackageDetails");
|
||||
|
||||
var last = pkgvs.Last();
|
||||
var pub = last.Package.CommitTimeStamp;
|
||||
var firstpub = pkgvs.First().Package.CommitTimeStamp;
|
||||
var pub = last.LatestCommit.CommitTimeStamp;
|
||||
|
||||
return Ok(new Data.Packages.Catalog.CatalogLeaf
|
||||
{
|
||||
|
@ -127,6 +127,7 @@ namespace isnd.Services
|
||||
{
|
||||
|
||||
var scope = dbContext.Packages
|
||||
.Include(p=>p.Versions)
|
||||
.Where(
|
||||
p => (PackageIdHelpers.CamelCaseMatch(p.Id, query) || PackageIdHelpers.SeparatedByMinusMatch(p.Id, query))
|
||||
&& (prerelease || p.Versions.Any(v => !v.IsPrerelease))
|
||||
@ -134,14 +135,22 @@ namespace isnd.Services
|
||||
);
|
||||
var total = scope.Count();
|
||||
var pkgs = scope.Skip(skip).Take(take).ToArray();
|
||||
|
||||
|
||||
return new PackageIndexViewModel
|
||||
{
|
||||
Query = query,
|
||||
TotalHits = total,
|
||||
Data = pkgs
|
||||
};
|
||||
}
|
||||
|
||||
private object PackageVersionToRegentry(Package v)
|
||||
{
|
||||
return new {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public AutoCompleteResult AutoComplete(string id,
|
||||
int skip, int take, bool prerelease = false,
|
||||
string packageType = null)
|
||||
@ -332,6 +341,7 @@ namespace isnd.Services
|
||||
{
|
||||
return dbContext.PackageVersions
|
||||
.Include(v => v.Package)
|
||||
.Include(v => v.LatestCommit)
|
||||
.Where(v => v.PackageId == id && v.FullString == version
|
||||
&& (lower == null || lower == v.Type));
|
||||
}
|
||||
|
@ -110,7 +110,8 @@ namespace isnd
|
||||
ApplicationDbContext dbContext)
|
||||
{
|
||||
app.UseForwardedHeaders();
|
||||
// if have a cert : app.UseHttpsRedirection();
|
||||
// Not using Apache cert :
|
||||
// app.UseHttpsRedirection();
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
|
Reference in New Issue
Block a user