コード例 #1
0
        public async Task <IActionResult> Index(CancellationToken cancellationToken)
        {
            IReadOnlyCollection <DeploymentTarget> targets =
                (await _targetSource.GetOrganizationsAsync(cancellationToken))
                .SelectMany(
                    organization => organization.Projects.SelectMany(project => project.DeploymentTargets))
                .SafeToReadOnlyCollection();

            IReadOnlyCollection <AppVersion> appVersions =
                await _monitoringService.GetAppMetadataAsync(targets, cancellationToken);

            return(View(new MonitoringViewOutputModel(appVersions)));
        }
コード例 #2
0
        public async Task <IActionResult> Index([FromServices] IDeploymentTargetReadService deploymentTargetReadService)
        {
            ImmutableArray <OrganizationInfo> organizations = await deploymentTargetReadService.GetOrganizationsAsync();

            var createOrganizationResult = TempData.Get <CreateOrganizationResult>();

            return(View(new OrganizationsViewOutputModel(organizations, createOrganizationResult)));
        }
コード例 #3
0
        public async Task <IActionResult> Index(CancellationToken cancellationToken = default)
        {
            IReadOnlyCollection <OrganizationInfo> organizations =
                await _targetSource.GetOrganizationsAsync(cancellationToken);

            var targetsViewModel = new OrganizationsViewModel(organizations);

            return(View(targetsViewModel));
        }
コード例 #4
0
        public async Task <IActionResult> Index(string prefix = null)
        {
            IReadOnlyCollection <DeploymentTarget> targets =
                (await _getTargets.GetOrganizationsAsync(CancellationToken.None)).SelectMany(
                    organization => organization.Projects.SelectMany(project => project.DeploymentTargets))

                .SafeToReadOnlyCollection();

            IReadOnlyCollection <PackageVersion> items = ImmutableArray <PackageVersion> .Empty;

            return(View(new DeploymentViewOutputModel(items, targets)));
        }
コード例 #5
0
        public async Task <IActionResult> Index()
        {
            IReadOnlyCollection <DeploymentTarget> targets;

            try
            {
                using CancellationTokenSource cts =
                          _timeoutHelper.CreateCancellationTokenSource(TimeSpan.FromSeconds(30));
                targets =
                    (await _getTargets.GetOrganizationsAsync(cts.Token)).SelectMany(
                        organization => organization.Projects.SelectMany(project => project.DeploymentTargets))
                    .SafeToReadOnlyCollection();
            }
            catch (Exception ex)
            {
                _logger.Error(ex, "Could not get organizations");
                targets = ImmutableArray <DeploymentTarget> .Empty;
            }

            IReadOnlyCollection <PackageVersion> items = ImmutableArray <PackageVersion> .Empty;

            return(View(new DeploymentViewOutputModel(items, targets)));
        }