Пример #1
0
        public async Task <ActionResult> OnGet(string context, string name)
        {
            var releases = await getReleasesHandler.HandleAsync(new GetReleases());

            Release = releases.SingleOrDefault(r => r.Name == name && r.Cluster == context);
            if (Release == null)
            {
                return(NotFound());
            }
            Chart = await getChartHandler.HandleAsync(new GetChart(Release.ChartName));

            Values = await getReleaseValuesHandler.HandleAsync(new GetReleaseValues(Release.Name, Release.Cluster));

            Version = Release.ChartVersion;
            return(Page());
        }
Пример #2
0
        public async Task <ActionResult> OnGet(string chart, string version = null)
        {
            Chart = await getChartHandler.HandleAsync(new GetChart(chart));

            if (version == null)
            {
                Release = Chart.GetLastRelease();
            }
            else
            {
                Release = Chart.Releases.SingleOrDefault(c => c.Version == new SemVer.Version(version));
            }
            if (Release == null)
            {
                return(NotFound());
            }
            Contexts = await getClustersHandler.HandleAsync(new GetClusters());

            Values = await getChartValuesHandler.HandleAsync(new GetChartValues(chart, Release.Version.ToString()));

            return(Page());
        }
Пример #3
0
        public async Task <IActionResult> OnGet(string name, string version)
        {
            Chart = await getChartHandler.HandleAsync(new GetChart(name));

            if (version == null)
            {
                Release = Chart.GetLastRelease();
            }
            else
            {
                Release = Chart.Releases.SingleOrDefault(c => c.Version == new SemVer.Version(version));
            }
            if (Release == null)
            {
                return(NotFound());
            }
            var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();

            Readme = Markdown.ToHtml(await getChartReadmeHandler.HandleAsync(new GetChartReadme(Chart.Name, Chart.GetLastRelease()?.Version)), pipeline);
            return(Page());
        }