Exemplo n.º 1
0
        //
        // GET: /stats

        public virtual async Task <ActionResult> Index()
        {
            if (_statisticsService == NullStatisticsService.Instance)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }

            await _statisticsService.Refresh();

            var model = new StatisticsPackagesViewModel
            {
                IsDownloadPackageAvailable = _statisticsService.CommunityPackageDownloadsResult.IsLoaded,
                DownloadPackagesSummary    = _statisticsService.CommunityPackageDownloadsSummary,

                IsDownloadPackageVersionsAvailable = _statisticsService.CommunityPackageVersionDownloadsResult.IsLoaded,
                DownloadPackageVersionsSummary     = _statisticsService.CommunityPackageVersionDownloadsSummary,

                IsNuGetClientVersionAvailable = _statisticsService.NuGetClientVersionResult.IsLoaded,
                NuGetClientVersion            = _statisticsService.NuGetClientVersion,

                IsLast6WeeksAvailable = _statisticsService.Last6WeeksResult.IsLoaded,
                Last6Weeks            = _statisticsService.Last6Weeks,

                LastUpdatedUtc = _statisticsService.LastUpdatedUtc,
            };

            model.Update();

            model.UseD3 = UseD3();

            return(View(model));
        }
Exemplo n.º 2
0
        //
        // GET: /stats

        public virtual async Task <ActionResult> Index()
        {
            if (_statisticsService == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }

            bool[] availablity = await Task.WhenAll(
                _statisticsService.LoadDownloadPackages(),
                _statisticsService.LoadDownloadPackageVersions(),
                _statisticsService.LoadNuGetClientVersion(),
                _statisticsService.LoadLast6Months());

            var model = new StatisticsPackagesViewModel
            {
                IsDownloadPackageAvailable       = availablity[0],
                DownloadPackagesSummary          = _statisticsService.DownloadPackagesSummary,
                IsDownloadPackageDetailAvailable = availablity[1],
                DownloadPackageVersionsSummary   = _statisticsService.DownloadPackageVersionsSummary,
                IsNuGetClientVersionAvailable    = availablity[2],
                NuGetClientVersion     = _statisticsService.NuGetClientVersion,
                IsLast6MonthsAvailable = availablity[3],
                Last6Months            = _statisticsService.Last6Months,
            };

            model.ClientCulture = DetermineClientLocale();

            model.Update();

            model.UseD3 = UseD3();

            return(View(model));
        }
Exemplo n.º 3
0
        //
        // GET: /stats

        public virtual async Task <ActionResult> Index()
        {
            if (_statisticsService == NullStatisticsService.Instance)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }

            var availablity = await Task.WhenAll(
                _statisticsService.LoadDownloadPackages(),
                _statisticsService.LoadDownloadPackageVersions(),
                _statisticsService.LoadNuGetClientVersion(),
                _statisticsService.LoadLast6Months());

            var model = new StatisticsPackagesViewModel
            {
                IsDownloadPackageAvailable       = availablity[0].Loaded,
                DownloadPackagesSummary          = _statisticsService.DownloadPackagesSummary,
                IsDownloadPackageDetailAvailable = availablity[1].Loaded,
                DownloadPackageVersionsSummary   = _statisticsService.DownloadPackageVersionsSummary,
                IsNuGetClientVersionAvailable    = availablity[2].Loaded,
                NuGetClientVersion     = _statisticsService.NuGetClientVersion,
                IsLast6MonthsAvailable = availablity[3].Loaded,
                Last6Months            = _statisticsService.Last6Months,
                LastUpdatedUtc         = availablity
                                         .Where(r => r.LastUpdatedUtc.HasValue)
                                         .OrderByDescending(r => r.LastUpdatedUtc.Value)
                                         .Select(r => r.LastUpdatedUtc)
                                         .FirstOrDefault()
            };

            model.ClientCulture = DetermineClientLocale();

            model.Update();

            model.UseD3 = UseD3();

            return(View(model));
        }
Exemplo n.º 4
0
        //
        // GET: /stats

        public virtual async Task<ActionResult> Index()
        {
            if (_statisticsService == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.NotFound);
            }

            var availablity = await Task.WhenAll(
                _statisticsService.LoadDownloadPackages(), 
                _statisticsService.LoadDownloadPackageVersions(),
                _statisticsService.LoadNuGetClientVersion(),
                _statisticsService.LoadLast6Months());

            var model = new StatisticsPackagesViewModel
            {
                IsDownloadPackageAvailable = availablity[0].Loaded,
                DownloadPackagesSummary = _statisticsService.DownloadPackagesSummary,
                IsDownloadPackageDetailAvailable = availablity[1].Loaded,
                DownloadPackageVersionsSummary = _statisticsService.DownloadPackageVersionsSummary,
                IsNuGetClientVersionAvailable = availablity[2].Loaded,
                NuGetClientVersion = _statisticsService.NuGetClientVersion,
                IsLast6MonthsAvailable = availablity[3].Loaded,
                Last6Months = _statisticsService.Last6Months,
                LastUpdatedUtc = availablity
                    .Where(r => r.LastUpdatedUtc.HasValue)
                    .OrderByDescending(r => r.LastUpdatedUtc.Value)
                    .Select(r => r.LastUpdatedUtc)
                    .FirstOrDefault()
            };

            model.ClientCulture = DetermineClientLocale();

            model.Update();

            model.UseD3 = UseD3();

            return View(model);
        }
        //
        // GET: /stats

        public virtual async Task<ActionResult> Index()
        {
            if (_statisticsService == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.NotFound);
            }

            bool[] availablity = await Task.WhenAll(
                _statisticsService.LoadDownloadPackages(), 
                _statisticsService.LoadDownloadPackageVersions(),
                _statisticsService.LoadNuGetClientVersion(),
                _statisticsService.LoadLast6Months());

            var model = new StatisticsPackagesViewModel
            {
                IsDownloadPackageAvailable = availablity[0],
                DownloadPackagesSummary = _statisticsService.DownloadPackagesSummary,
                IsDownloadPackageDetailAvailable = availablity[1],
                DownloadPackageVersionsSummary = _statisticsService.DownloadPackageVersionsSummary,
                IsNuGetClientVersionAvailable = availablity[2],
                NuGetClientVersion = _statisticsService.NuGetClientVersion,
                IsLast6MonthsAvailable = availablity[3],
                Last6Months = _statisticsService.Last6Months,
            };

            model.ClientCulture = DetermineClientLocale();

            model.Update();

            model.UseD3 = UseD3();

            return View(model);
        }