public ActionResult Index() {
            if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to manage cache")))
                return new HttpUnauthorizedResult();

            var model = new StatisticsViewModel {
                CacheItems = _cacheService
                    .GetCacheItems()
                    .Where(x => x.Tenant.Equals(_shellSettings.Name, StringComparison.OrdinalIgnoreCase))
                    .ToList()
                    .OrderByDescending(x => x.CachedOnUtc),
            };

            return View(model);
        }
Exemplo n.º 2
0
        public ActionResult Index(PagerParameters pagerParameters)
        {
            if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to manage cache")))
                return new HttpUnauthorizedResult();

            var pager = new Pager(_siteService.GetSiteSettings(), pagerParameters);
            var pagerShape = Services.New.Pager(pager).TotalItemCount(_cacheStorageProvider.GetCacheItemsCount());

            var model = new StatisticsViewModel {
                CacheItems = _cacheStorageProvider
                    .GetCacheItems(pager.GetStartIndex(), pager.PageSize)
                    .ToList(),
                Pager = pagerShape
            };

            return View(model);
        }