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))); }
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))); }
public async Task <IActionResult> Index(CancellationToken cancellationToken = default) { IReadOnlyCollection <OrganizationInfo> organizations = await _targetSource.GetOrganizationsAsync(cancellationToken); var targetsViewModel = new OrganizationsViewModel(organizations); return(View(targetsViewModel)); }
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))); }
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))); }