Exemplo n.º 1
0
        public HttpResponseMessage Get()
        {
            try
            {
                var buildService = new BuildService();
                var builds       = buildService.GetBuilds().ToArray();
                var columns      = string.Concat(builds.Select(s => $@"
                    <div class=""build-wrapper {s.Status}"">
                        <div class=""build"">
                            <a class=""nostyle"" href=""{s.WebUrl}""><h2>{s.BuildConfig.Project.Name}: {s.BuildConfig.Name}</h2></a>
                        </div>
                    </div>"));

                return(new HttpResponseMessage()
                {
                    Content = new StringContent($@"
                    <div class=""columns"">
                        {columns}
                    </div>", Encoding.UTF8, "text/html")
                });
            }
            catch (Exception)
            {
                return(new HttpResponseMessage()
                {
                    Content = new StringContent($@"
                    <div class=""failbox blink"">
			            <h2>Can not access TeamCity</h2>
		            </div>"        , Encoding.UTF8, "text/html")
                });
            }
        }
Exemplo n.º 2
0
        // GET: Note
        public ActionResult Index()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new BuildService(userId);
            var model   = service.GetBuilds();

            return(View(model));
        }
 public Task <IEnumerable <Build> > GetBuilds()
 {
     return(_buildService.GetBuilds());
 }
Exemplo n.º 4
0
 public void OnGet()
 {
     Builds = _context.GetBuilds();
 }
Exemplo n.º 5
0
 public IActionResult Get()
 {
     return(Ok(_service.GetBuilds()));
 }
Exemplo n.º 6
0
 // GET
 public List <Build> All()
 {
     return(service.GetBuilds());
 }