Beispiel #1
0
        public async Task <ActionResult> Index(string slug)
        {
            IApplication application = _applicationService.GetApplication(slug);

            if (application == null)
            {
                return(HttpNotFound());
            }

            ICredentials            credentials       = _credentialProvider.GetCredentials();
            RemoteDeploymentManager deploymentManager = application.GetDeploymentManager(credentials);

            Task <IEnumerable <DeployResult> > deployResults = deploymentManager.GetResultsAsync();
            Task <RepositoryInfo> repositoryInfo             = application.GetRepositoryInfo(credentials);

            await Task.WhenAll(deployResults, repositoryInfo);

            var appViewModel = new ApplicationViewModel(application, _context, _certificates.FindAll())
            {
                RepositoryInfo = repositoryInfo.Result,
                Deployments    = deployResults.Result.ToList()
            };

            ViewBag.slug    = slug;
            ViewBag.appName = appViewModel.Name;

            return(View(appViewModel));
        }
Beispiel #2
0
        private async Task <ActionResult> GetApplicationView(string tab, string viewName, string slug)
        {
            var application = _applicationService.GetApplication(slug);

            ICredentials credentials    = _credentialProvider.GetCredentials();
            var          repositoryInfo = await application.GetRepositoryInfo(credentials);

            var appViewModel = new ApplicationViewModel(application, _context, _certificates.FindAll());

            appViewModel.RepositoryInfo = repositoryInfo;

            ViewBag.slug        = slug;
            ViewBag.tab         = tab;
            ViewBag.appName     = appViewModel.Name;
            ViewBag.siteBinding = String.Empty;

            ModelState.Clear();

            return(View(viewName, appViewModel));
        }