Feature: Repository Monitor
Cached Job Index, Live Job Message Update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user