diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/admin/packages.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/routers/web/admin/packages.go b/routers/web/admin/packages.go index 7c6d1ed840..88fb47ca01 100644 --- a/routers/web/admin/packages.go +++ b/routers/web/admin/packages.go @@ -51,12 +51,18 @@ func Packages(ctx *context.Context) { return } - totalBlobSize, err := packages_model.GetTotalBlobSize() + totalBlobSize, err := packages_model.GetTotalBlobSize(ctx) if err != nil { ctx.ServerError("GetTotalBlobSize", err) return } + totalUnreferencedBlobSize, err := packages_model.GetTotalUnreferencedBlobSize(ctx) + if err != nil { + ctx.ServerError("CalculateBlobSize", err) + return + } + ctx.Data["Title"] = ctx.Tr("packages.title") ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdminPackages"] = true @@ -65,8 +71,9 @@ func Packages(ctx *context.Context) { ctx.Data["AvailableTypes"] = packages_model.TypeList ctx.Data["SortType"] = sort ctx.Data["PackageDescriptors"] = pds - ctx.Data["Total"] = total - ctx.Data["TotalBlobSize"] = totalBlobSize + ctx.Data["TotalCount"] = total + ctx.Data["TotalBlobSize"] = totalBlobSize - totalUnreferencedBlobSize + ctx.Data["TotalUnreferencedBlobSize"] = totalUnreferencedBlobSize pager := context.NewPagination(int(total), setting.UI.PackagesPagingNum, page, 5) pager.AddParamString("q", query) |