diff --git a/src/NzbDrone.Api/System/Tasks/TaskModule.cs b/src/NzbDrone.Api/System/Tasks/TaskModule.cs index e5f454e5b9..c73f8cb457 100644 --- a/src/NzbDrone.Api/System/Tasks/TaskModule.cs +++ b/src/NzbDrone.Api/System/Tasks/TaskModule.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.RegularExpressions; using NzbDrone.Core.Jobs; namespace NzbDrone.Api.System.Tasks @@ -9,6 +10,8 @@ public class TaskModule : NzbDroneRestModule { private readonly ITaskManager _taskManager; + private static readonly Regex NameRegex = new Regex("(? GetAll() private static TaskResource ConvertToResource(ScheduledTask scheduledTask) { + var taskName = scheduledTask.TypeName.Split('.').Last().Replace("Command", ""); + return new TaskResource { Id = scheduledTask.Id, - Name = scheduledTask.TypeName.Split('.').Last().Replace("Command", ""), - CommandName = scheduledTask.TypeName.Split('.').Last(), + Name = NameRegex.Replace(taskName, match => " " + match.Value), + TaskName = taskName, Interval = scheduledTask.Interval, LastExecution = scheduledTask.LastExecution, NextExecution = scheduledTask.LastExecution.AddMinutes(scheduledTask.Interval) diff --git a/src/NzbDrone.Api/System/Tasks/TaskResource.cs b/src/NzbDrone.Api/System/Tasks/TaskResource.cs index 900457ccc7..d65b6d3b39 100644 --- a/src/NzbDrone.Api/System/Tasks/TaskResource.cs +++ b/src/NzbDrone.Api/System/Tasks/TaskResource.cs @@ -6,7 +6,7 @@ namespace NzbDrone.Api.System.Tasks public class TaskResource : RestResource { public String Name { get; set; } - public String CommandName { get; set; } + public String TaskName { get; set; } public Int32 Interval { get; set; } public DateTime LastExecution { get; set; } public DateTime NextExecution { get; set; } diff --git a/src/UI/Cells/cells.less b/src/UI/Cells/cells.less index 44437b487c..5d8ad94a26 100644 --- a/src/UI/Cells/cells.less +++ b/src/UI/Cells/cells.less @@ -44,15 +44,17 @@ .text-overflow(); } -.relative-date-cell { - width : 150px; - cursor: default; +.relative-date-cell, .relative-time-cell { .text-overflow(); + cursor : default; + + .tooltip-inner { + max-width : 250px; + } } -.relative-time-cell { - cursor: default; - .text-overflow(); +.relative-date-cell { + width : 150px; } .history-event-type-cell { diff --git a/src/UI/System/Task/ExecuteTaskCell.js b/src/UI/System/Task/ExecuteTaskCell.js index 2969d0bd1d..6234b8da13 100644 --- a/src/UI/System/Task/ExecuteTaskCell.js +++ b/src/UI/System/Task/ExecuteTaskCell.js @@ -16,10 +16,11 @@ define( this.$el.empty(); - var task = this.model.get('name'); + var name = this.model.get('name'); + var task = this.model.get('taskName'); this.$el.html( - ''.format(task) + ''.format(name) ); CommandController.bindToCommand({ @@ -33,8 +34,8 @@ define( }, _executeTask: function () { - CommandController.Execute(this.model.get('name'), { - name : this.model.get('name') + CommandController.Execute(this.model.get('taskName'), { + name : this.model.get('taskName') }); } });