Feature: Repository Monitor

Cached Job Index, Live Job Message Update
This commit is contained in:
Gary Sharp
2013-04-11 19:10:38 +10:00
parent b5531e64bd
commit b79723d432
34 changed files with 803 additions and 262 deletions
@@ -22,6 +22,9 @@ namespace Disco.Web.Areas.API
context.Routes.MapConnection<Disco.Services.Tasks.ScheduledTasksLiveStatusService>(
"API_Logging_TaskStatusNotifications", "API/Logging/TaskStatusNotifications/{*operation}");
context.Routes.MapConnection<Disco.BI.Interop.SignalRHandlers.RepositoryMonitorNotifications>(
"API_Repository_Notifications", "API/Repository/Notifications/{*operation}");
context.MapRoute(
"API_Update",
"API/{controller}/Update/{id}/{key}",
@@ -1731,6 +1731,17 @@ namespace Disco.Web.Areas.API.Controllers
}
return Json(new Models.Job.CommentsModel() { Result = "Invalid Job Number" }, JsonRequestBehavior.AllowGet);
}
public virtual ActionResult Comment(int id)
{
var jl = dbContext.JobLogs.Include("TechUser").FirstOrDefault(l => l.Id == id);
if (jl != null)
{
var c = Models.Job._CommentModel.FromJobLog(jl);
return Json(c, JsonRequestBehavior.AllowGet);
}
return Json(new Models.Job.CommentsModel() { Result = "Invalid Comment Id" }, JsonRequestBehavior.AllowGet);
}
public virtual ActionResult CommentPost(int id, string comment)
{
var j = dbContext.Jobs.Find(id);
@@ -10,6 +10,7 @@ namespace Disco.Web.Areas.API.Models.Job
public class _CommentModel
{
public int Id { get; set; }
public int JobId { get; set; }
public string Author { get; set; }
public DateTime Timestamp { get; set; }
public string Comments { get; set; }
@@ -41,6 +42,7 @@ namespace Disco.Web.Areas.API.Models.Job
return new _CommentModel
{
Id = jl.Id,
JobId = jl.JobId,
Author = jl.TechUser.ToString(),
Timestamp = jl.Timestamp,
Comments = jl.Comments