@@ -6,6 +6,7 @@ using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Exporting;
|
||||
using Disco.Services.Interop;
|
||||
using Disco.Services.Jobs;
|
||||
using Disco.Services.Jobs.Exporting;
|
||||
using Disco.Services.Jobs.JobLists;
|
||||
using Disco.Services.Jobs.Statistics;
|
||||
@@ -1809,6 +1810,15 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
#endregion
|
||||
|
||||
#region Job Comments
|
||||
|
||||
[HttpPost, ValidateAntiForgeryToken, DiscoAuthorize(Claims.Job.Actions.Create)]
|
||||
public virtual ActionResult InitialComments(CreateModel m)
|
||||
{
|
||||
m.UpdateModel(Database, Authorization);
|
||||
|
||||
return Json(Jobs.GenerateInitialComments(Database, m, CurrentUser, out _));
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Job.ShowLogs)]
|
||||
public virtual ActionResult Comments(int id)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,30 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public partial class JobPreferencesController : AuthorizedDatabaseController
|
||||
{
|
||||
[DiscoAuthorize(Claims.Config.JobPreferences.Configure)]
|
||||
public virtual ActionResult UpdateInitialCommentsTemplate(string initialCommentsTemplate, bool redirect = false)
|
||||
{
|
||||
string expression = null;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(initialCommentsTemplate))
|
||||
{
|
||||
expression = initialCommentsTemplate.Trim();
|
||||
}
|
||||
|
||||
if (Database.DiscoConfiguration.JobPreferences.InitialCommentsTemplate != expression)
|
||||
{
|
||||
Database.DiscoConfiguration.JobPreferences.InitialCommentsTemplate = expression;
|
||||
Database.SaveChanges();
|
||||
|
||||
Jobs.InitialCommentsTemplateInvalidateCache();
|
||||
}
|
||||
|
||||
if (redirect)
|
||||
return RedirectToAction(MVC.Config.JobPreferences.Index());
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.JobPreferences.Configure)]
|
||||
public virtual ActionResult UpdateLongRunningJobDaysThreshold(int LongRunningJobDaysThreshold, bool redirect = false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user