Ejemplo n.º 1
0
        public JsonResult GetBuilds()
        {
            var model = _modelHandler.GetModel();

            var builds = model.Projects.SelectMany(p => p.Builds).ToList();

            var result = new BuildsJson();

            foreach (var build in builds)
            {
                result.Builds.Add(new BuildJson()
                {
                    Id      = build.Id,
                    Content = RenderPartialViewToString("_BuildItem", build)
                });
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public async Task <JsonResult> GetBuildsAsync()
        {
            var model = await _modelHandler.GetModelAsync();

            model.Pipelines = SortPipelines(model.Pipelines);
            var ajaxModel = new BuildsJson();

            foreach (var build in model.Pipelines)
            {
                ajaxModel.Builds.Add(new BuildJson
                {
                    Id             = build.BuilderId,
                    Content        = await RenderToStringAsync(BuildItemView, build),
                    Status         = build.StatusText,
                    BrokenBySpeech = build.BrokenBySpeech
                });
            }

            return(Json(ajaxModel));
        }