From 6b912a56f03dbae91fb7bb77c5a8a381768c1fb8 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 12 Sep 2014 07:31:32 -0700 Subject: [PATCH] UI cleanup for tasks --- src/NzbDrone.Api/System/Tasks/TaskModule.cs | 9 +++++++-- src/NzbDrone.Api/System/Tasks/TaskResource.cs | 2 +- src/UI/Cells/cells.less | 14 ++++++++------ src/UI/System/Task/ExecuteTaskCell.js | 9 +++++---- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/NzbDrone.Api/System/Tasks/TaskModule.cs b/src/NzbDrone.Api/System/Tasks/TaskModule.cs index e5f454e5b..c73f8cb45 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 @@ namespace NzbDrone.Api.System.Tasks { private readonly ITaskManager _taskManager; + private static readonly Regex NameRegex = new Regex("(? " " + 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 900457ccc..d65b6d3b3 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 44437b487..5d8ad94a2 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 2969d0bd1..6234b8da1 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') }); } });