@@ -0,0 +1,33 @@ | |||
using System.Reflection; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
internal class CombinedResourceDispatcher : EmbeddedResourceDispatcher | |||
{ | |||
private readonly Assembly _assembly; | |||
private readonly string _baseNamespace; | |||
private readonly string[] _resourceNames; | |||
public CombinedResourceDispatcher( | |||
string contentType, | |||
Assembly assembly, | |||
string baseNamespace, | |||
params string[] resourceNames) : base(contentType, assembly, null) | |||
{ | |||
_assembly = assembly; | |||
_baseNamespace = baseNamespace; | |||
_resourceNames = resourceNames; | |||
} | |||
protected override void WriteResponse(DashboardResponse response) | |||
{ | |||
foreach (var resourceName in _resourceNames) | |||
{ | |||
WriteResource( | |||
response, | |||
_assembly, | |||
$"{_baseNamespace}.{resourceName}"); | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,39 @@ | |||
using System; | |||
using System.Net; | |||
using System.Threading.Tasks; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
internal class CommandDispatcher : IDashboardDispatcher | |||
{ | |||
private readonly Func<DashboardContext, bool> _command; | |||
public CommandDispatcher(Func<DashboardContext, bool> command) | |||
{ | |||
_command = command; | |||
} | |||
public Task Dispatch(DashboardContext context) | |||
{ | |||
var request = context.Request; | |||
var response = context.Response; | |||
if (!"POST".Equals(request.Method, StringComparison.OrdinalIgnoreCase)) | |||
{ | |||
response.StatusCode = (int)HttpStatusCode.MethodNotAllowed; | |||
return Task.FromResult(false); | |||
} | |||
if (_command(context)) | |||
{ | |||
response.StatusCode = (int)HttpStatusCode.NoContent; | |||
} | |||
else | |||
{ | |||
response.StatusCode = 422; | |||
} | |||
return Task.FromResult(true); | |||
} | |||
} | |||
} |
@@ -10,7 +10,8 @@ | |||
using System.Reflection; | |||
namespace Hangfire.Dashboard.Resources { | |||
namespace DotNetCore.CAP.Dashboard.Resources | |||
{ | |||
using System; | |||
@@ -41,7 +42,7 @@ namespace Hangfire.Dashboard.Resources { | |||
public static global::System.Resources.ResourceManager ResourceManager { | |||
get { | |||
if (object.ReferenceEquals(resourceMan, null)) { | |||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Hangfire.Dashboard.Content.resx.Strings", typeof(Strings).GetTypeInfo().Assembly); | |||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DotNetCore.CAP.Dashboard.Content.resx.Strings", typeof(Strings).GetTypeInfo().Assembly); | |||
resourceMan = temp; | |||
} | |||
return resourceMan; | |||
@@ -1,10 +1,27 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.RegularExpressions; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
class DashboardContext | |||
public abstract class DashboardContext | |||
{ | |||
protected DashboardContext(IStorage storage, DashboardOptions options) | |||
{ | |||
if (storage == null) throw new ArgumentNullException(nameof(storage)); | |||
if (options == null) throw new ArgumentNullException(nameof(options)); | |||
Storage = storage; | |||
Options = options; | |||
} | |||
public IStorage Storage { get; } | |||
public DashboardOptions Options { get; } | |||
public Match UriMatch { get; set; } | |||
public DashboardRequest Request { get; protected set; } | |||
public DashboardResponse Response { get; protected set; } | |||
} | |||
} |
@@ -0,0 +1,24 @@ | |||
using System; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public class DashboardMetric | |||
{ | |||
public DashboardMetric(string name, Func<RazorPage, Metric> func) | |||
: this(name, name, func) | |||
{ | |||
} | |||
public DashboardMetric(string name, string title, Func<RazorPage, Metric> func) | |||
{ | |||
Name = name; | |||
Title = title; | |||
Func = func; | |||
} | |||
public string Name { get; } | |||
public Func<RazorPage, Metric> Func { get; } | |||
public string Title { get; set; } | |||
} | |||
} |
@@ -0,0 +1,179 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using DotNetCore.CAP.Dashboard.Resources; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public static class DashboardMetrics | |||
{ | |||
private static readonly Dictionary<string, DashboardMetric> Metrics = new Dictionary<string, DashboardMetric>(); | |||
static DashboardMetrics() | |||
{ | |||
AddMetric(ServerCount); | |||
AddMetric(RecurringJobCount); | |||
AddMetric(RetriesCount); | |||
AddMetric(EnqueuedCountOrNull); | |||
AddMetric(FailedCountOrNull); | |||
AddMetric(EnqueuedAndQueueCount); | |||
AddMetric(ScheduledCount); | |||
AddMetric(ProcessingCount); | |||
AddMetric(SucceededCount); | |||
AddMetric(FailedCount); | |||
AddMetric(DeletedCount); | |||
AddMetric(AwaitingCount); | |||
} | |||
public static void AddMetric(DashboardMetric metric) | |||
{ | |||
if (metric == null) throw new ArgumentNullException(nameof(metric)); | |||
lock (Metrics) | |||
{ | |||
Metrics[metric.Name] = metric; | |||
} | |||
} | |||
public static IEnumerable<DashboardMetric> GetMetrics() | |||
{ | |||
lock (Metrics) | |||
{ | |||
return Metrics.Values.ToList(); | |||
} | |||
} | |||
public static readonly DashboardMetric ServerCount = new DashboardMetric( | |||
"servers:count", | |||
"Metrics_Servers", | |||
page => new Metric(page.Statistics.Servers.ToString("N0")) | |||
{ | |||
Style = page.Statistics.Servers == 0 ? MetricStyle.Warning : MetricStyle.Default, | |||
Highlighted = page.Statistics.Servers == 0, | |||
Title = page.Statistics.Servers == 0 | |||
? "No active servers found. Jobs will not be processed." | |||
: null | |||
}); | |||
public static readonly DashboardMetric RecurringJobCount = new DashboardMetric( | |||
"recurring:count", | |||
"Metrics_RecurringJobs", | |||
page => new Metric(page.Statistics.Recurring.ToString("N0"))); | |||
public static readonly DashboardMetric RetriesCount = new DashboardMetric( | |||
"retries:count", | |||
"Metrics_Retries", | |||
page => | |||
{ | |||
long retryCount; | |||
using (var connection = page.Storage.GetConnection()) | |||
{ | |||
var storageConnection = connection as IStorageConnection; | |||
if (storageConnection == null) | |||
{ | |||
return null; | |||
} | |||
retryCount = storageConnection.GetSetCount("retries"); | |||
} | |||
return new Metric(retryCount.ToString("N0")) | |||
{ | |||
Style = retryCount > 0 ? MetricStyle.Warning : MetricStyle.Default | |||
}; | |||
}); | |||
public static readonly DashboardMetric EnqueuedCountOrNull = new DashboardMetric( | |||
"enqueued:count-or-null", | |||
"Metrics_EnqueuedCountOrNull", | |||
page => page.Statistics.Enqueued > 0 || page.Statistics.Failed == 0 | |||
? new Metric(page.Statistics.Enqueued.ToString("N0")) | |||
{ | |||
Style = page.Statistics.Enqueued > 0 ? MetricStyle.Info : MetricStyle.Default, | |||
Highlighted = page.Statistics.Enqueued > 0 && page.Statistics.Failed == 0 | |||
} | |||
: null); | |||
public static readonly DashboardMetric FailedCountOrNull = new DashboardMetric( | |||
"failed:count-or-null", | |||
"Metrics_FailedJobs", | |||
page => page.Statistics.Failed > 0 | |||
? new Metric(page.Statistics.Failed.ToString("N0")) | |||
{ | |||
Style = MetricStyle.Danger, | |||
Highlighted = true, | |||
Title = string.Format(Strings.Metrics_FailedCountOrNull, page.Statistics.Failed) | |||
} | |||
: null); | |||
public static readonly DashboardMetric EnqueuedAndQueueCount = new DashboardMetric( | |||
"enqueued-queues:count", | |||
"Metrics_EnqueuedQueuesCount", | |||
page => new Metric($"{page.Statistics.Enqueued:N0} / {page.Statistics.Queues:N0}") | |||
{ | |||
Style = page.Statistics.Enqueued > 0 ? MetricStyle.Info : MetricStyle.Default, | |||
Highlighted = page.Statistics.Enqueued > 0 | |||
}); | |||
public static readonly DashboardMetric ScheduledCount = new DashboardMetric( | |||
"scheduled:count", | |||
"Metrics_ScheduledJobs", | |||
page => new Metric(page.Statistics.Scheduled.ToString("N0")) | |||
{ | |||
Style = page.Statistics.Scheduled > 0 ? MetricStyle.Info : MetricStyle.Default | |||
}); | |||
public static readonly DashboardMetric ProcessingCount = new DashboardMetric( | |||
"processing:count", | |||
"Metrics_ProcessingJobs", | |||
page => new Metric(page.Statistics.Processing.ToString("N0")) | |||
{ | |||
Style = page.Statistics.Processing > 0 ? MetricStyle.Warning : MetricStyle.Default | |||
}); | |||
public static readonly DashboardMetric SucceededCount = new DashboardMetric( | |||
"succeeded:count", | |||
"Metrics_SucceededJobs", | |||
page => new Metric(page.Statistics.Succeeded.ToString("N0")) | |||
{ | |||
IntValue = page.Statistics.Succeeded | |||
}); | |||
public static readonly DashboardMetric FailedCount = new DashboardMetric( | |||
"failed:count", | |||
"Metrics_FailedJobs", | |||
page => new Metric(page.Statistics.Failed.ToString("N0")) | |||
{ | |||
IntValue = page.Statistics.Failed, | |||
Style = page.Statistics.Failed > 0 ? MetricStyle.Danger : MetricStyle.Default, | |||
Highlighted = page.Statistics.Failed > 0 | |||
}); | |||
public static readonly DashboardMetric DeletedCount = new DashboardMetric( | |||
"deleted:count", | |||
"Metrics_DeletedJobs", | |||
page => new Metric(page.Statistics.Deleted.ToString("N0"))); | |||
public static readonly DashboardMetric AwaitingCount = new DashboardMetric( | |||
"awaiting:count", | |||
"Metrics_AwaitingCount", | |||
page => | |||
{ | |||
long awaitingCount = -1; | |||
using (var connection = page.Storage.GetConnection()) | |||
{ | |||
var storageConnection = connection as IStorageConnection; | |||
if (storageConnection != null) | |||
{ | |||
awaitingCount = storageConnection.GetSetCount("awaiting"); | |||
} | |||
} | |||
return new Metric(awaitingCount.ToString("N0")) | |||
{ | |||
Style = awaitingCount > 0 ? MetricStyle.Info : MetricStyle.Default | |||
}; | |||
}); | |||
} | |||
} |
@@ -0,0 +1,18 @@ | |||
using System.Collections.Generic; | |||
using System.Threading.Tasks; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public abstract class DashboardRequest | |||
{ | |||
public abstract string Method { get; } | |||
public abstract string Path { get; } | |||
public abstract string PathBase { get; } | |||
public abstract string LocalIpAddress { get; } | |||
public abstract string RemoteIpAddress { get; } | |||
public abstract string GetQuery(string key); | |||
public abstract Task<IList<string>> GetFormValuesAsync(string key); | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
using System; | |||
using System.IO; | |||
using System.Threading.Tasks; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public abstract class DashboardResponse | |||
{ | |||
public abstract string ContentType { get; set; } | |||
public abstract int StatusCode { get; set; } | |||
public abstract Stream Body { get; } | |||
public abstract void SetExpire(DateTimeOffset? value); | |||
public abstract Task WriteAsync(string text); | |||
} | |||
} |
@@ -0,0 +1,54 @@ | |||
using System; | |||
using System.Reflection; | |||
using System.Threading.Tasks; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
internal class EmbeddedResourceDispatcher : IDashboardDispatcher | |||
{ | |||
private readonly Assembly _assembly; | |||
private readonly string _resourceName; | |||
private readonly string _contentType; | |||
public EmbeddedResourceDispatcher( | |||
string contentType, | |||
Assembly assembly, | |||
string resourceName) | |||
{ | |||
if (contentType == null) throw new ArgumentNullException(nameof(contentType)); | |||
if (assembly == null) throw new ArgumentNullException(nameof(assembly)); | |||
_assembly = assembly; | |||
_resourceName = resourceName; | |||
_contentType = contentType; | |||
} | |||
public Task Dispatch(DashboardContext context) | |||
{ | |||
context.Response.ContentType = _contentType; | |||
context.Response.SetExpire(DateTimeOffset.Now.AddYears(1)); | |||
WriteResponse(context.Response); | |||
return Task.FromResult(true); | |||
} | |||
protected virtual void WriteResponse(DashboardResponse response) | |||
{ | |||
WriteResource(response, _assembly, _resourceName); | |||
} | |||
protected void WriteResource(DashboardResponse response, Assembly assembly, string resourceName) | |||
{ | |||
using (var inputStream = assembly.GetManifestResourceStream(resourceName)) | |||
{ | |||
if (inputStream == null) | |||
{ | |||
throw new ArgumentException($@"Resource with name {resourceName} not found in assembly {assembly}."); | |||
} | |||
inputStream.CopyTo(response.Body); | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,244 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Net; | |||
using System.Text; | |||
using System.ComponentModel; | |||
using System.Reflection; | |||
using System.Text.RegularExpressions; | |||
using DotNetCore.CAP.Dashboard.Resources; | |||
using DotNetCore.CAP.Dashboard.Pages; | |||
using DotNetCore.CAP.Infrastructure; | |||
using DotNetCore.CAP.Models; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public class HtmlHelper | |||
{ | |||
private readonly RazorPage _page; | |||
public HtmlHelper(RazorPage page) | |||
{ | |||
if (page == null) throw new ArgumentNullException(nameof(page)); | |||
_page = page; | |||
} | |||
//public NonEscapedString Breadcrumbs(string title, IDictionary<string, string> items) | |||
//{ | |||
// if (items == null) throw new ArgumentNullException(nameof(items)); | |||
// return RenderPartial(new Breadcrumbs(title, items)); | |||
//} | |||
//public NonEscapedString JobsSidebar() | |||
//{ | |||
// return RenderPartial(new SidebarMenu(JobsSidebarMenu.Items)); | |||
//} | |||
//public NonEscapedString SidebarMenu(IEnumerable<Func<RazorPage, MenuItem>> items) | |||
//{ | |||
// if (items == null) throw new ArgumentNullException(nameof(items)); | |||
// return RenderPartial(new SidebarMenu(items)); | |||
//} | |||
public NonEscapedString BlockMetric(DashboardMetric metric) | |||
{ | |||
if (metric == null) throw new ArgumentNullException(nameof(metric)); | |||
return RenderPartial(new BlockMetric(metric)); | |||
} | |||
public NonEscapedString InlineMetric(DashboardMetric metric) | |||
{ | |||
if (metric == null) throw new ArgumentNullException(nameof(metric)); | |||
return RenderPartial(new InlineMetric(metric)); | |||
} | |||
//public NonEscapedString Paginator(Pager pager) | |||
//{ | |||
// if (pager == null) throw new ArgumentNullException(nameof(pager)); | |||
// return RenderPartial(new Paginator(pager)); | |||
//} | |||
//public NonEscapedString PerPageSelector(Pager pager) | |||
//{ | |||
// if (pager == null) throw new ArgumentNullException(nameof(pager)); | |||
// return RenderPartial(new PerPageSelector(pager)); | |||
//} | |||
public NonEscapedString RenderPartial(RazorPage partialPage) | |||
{ | |||
partialPage.Assign(_page); | |||
return new NonEscapedString(partialPage.ToString()); | |||
} | |||
public NonEscapedString Raw(string value) | |||
{ | |||
return new NonEscapedString(value); | |||
} | |||
public NonEscapedString JobId(string jobId, bool shorten = true) | |||
{ | |||
Guid guid; | |||
return new NonEscapedString(Guid.TryParse(jobId, out guid) | |||
? (shorten ? jobId.Substring(0, 8) + "…" : jobId) | |||
: $"#{jobId}"); | |||
} | |||
public string JobName(Message job) | |||
{ | |||
if (job == null) | |||
{ | |||
return Strings.Common_CannotFindTargetMethod; | |||
} | |||
return job.ToString(); | |||
} | |||
public NonEscapedString StateLabel(string stateName) | |||
{ | |||
if (String.IsNullOrWhiteSpace(stateName)) | |||
{ | |||
return Raw($"<em>{Strings.Common_NoState}</em>"); | |||
} | |||
return Raw($"<span class=\"label label-default\" style=\"background-color: {JobHistoryRenderer.GetForegroundStateColor(stateName)};\">{stateName}</span>"); | |||
} | |||
public NonEscapedString JobIdLink(string jobId) | |||
{ | |||
return Raw($"<a href=\"{_page.Url.JobDetails(jobId)}\">{JobId(jobId)}</a>"); | |||
} | |||
public NonEscapedString JobNameLink(string jobId, Message job) | |||
{ | |||
return Raw($"<a class=\"job-method\" href=\"{_page.Url.JobDetails(jobId)}\">{HtmlEncode(JobName(job))}</a>"); | |||
} | |||
public NonEscapedString RelativeTime(DateTime value) | |||
{ | |||
return Raw($"<span data-moment=\"{Helper.ToTimestamp(value)}\">{value}</span>"); | |||
} | |||
public NonEscapedString MomentTitle(DateTime time, string value) | |||
{ | |||
return Raw($"<span data-moment-title=\"{Helper.ToTimestamp(time)}\">{value}</span>"); | |||
} | |||
public NonEscapedString LocalTime(DateTime value) | |||
{ | |||
return Raw($"<span data-moment-local=\"{Helper.ToTimestamp(value)}\">{value}</span>"); | |||
} | |||
public string ToHumanDuration(TimeSpan? duration, bool displaySign = true) | |||
{ | |||
if (duration == null) return null; | |||
var builder = new StringBuilder(); | |||
if (displaySign) | |||
{ | |||
builder.Append(duration.Value.TotalMilliseconds < 0 ? "-" : "+"); | |||
} | |||
duration = duration.Value.Duration(); | |||
if (duration.Value.Days > 0) | |||
{ | |||
builder.Append($"{duration.Value.Days}d "); | |||
} | |||
if (duration.Value.Hours > 0) | |||
{ | |||
builder.Append($"{duration.Value.Hours}h "); | |||
} | |||
if (duration.Value.Minutes > 0) | |||
{ | |||
builder.Append($"{duration.Value.Minutes}m "); | |||
} | |||
if (duration.Value.TotalHours < 1) | |||
{ | |||
if (duration.Value.Seconds > 0) | |||
{ | |||
builder.Append(duration.Value.Seconds); | |||
if (duration.Value.Milliseconds > 0) | |||
{ | |||
builder.Append($".{duration.Value.Milliseconds.ToString().PadLeft(3, '0')}"); | |||
} | |||
builder.Append("s "); | |||
} | |||
else | |||
{ | |||
if (duration.Value.Milliseconds > 0) | |||
{ | |||
builder.Append($"{duration.Value.Milliseconds}ms "); | |||
} | |||
} | |||
} | |||
if (builder.Length <= 1) | |||
{ | |||
builder.Append(" <1ms "); | |||
} | |||
builder.Remove(builder.Length - 1, 1); | |||
return builder.ToString(); | |||
} | |||
public string FormatProperties(IDictionary<string, string> properties) | |||
{ | |||
return String.Join(", ", properties.Select(x => $"{x.Key}: \"{x.Value}\"")); | |||
} | |||
public NonEscapedString QueueLabel(string queue) | |||
{ | |||
var label = queue != null | |||
? $"<a class=\"text-uppercase\" href=\"{_page.Url.Queue(queue)}\">{queue}</a>" | |||
: $"<span class=\"label label-danger\"><i>{Strings.Common_Unknown}</i></span>"; | |||
return new NonEscapedString(label); | |||
} | |||
public NonEscapedString ServerId(string serverId) | |||
{ | |||
var parts = serverId.Split(':'); | |||
var shortenedId = parts.Length > 1 | |||
? String.Join(":", parts.Take(parts.Length - 1)) | |||
: serverId; | |||
return new NonEscapedString( | |||
$"<span class=\"labe label-defult text-uppercase\" title=\"{serverId}\">{shortenedId}</span>"); | |||
} | |||
//private static readonly StackTraceHtmlFragments StackTraceHtmlFragments = new StackTraceHtmlFragments | |||
//{ | |||
// BeforeFrame = "<span class='st-frame'>" , AfterFrame = "</span>", | |||
// BeforeType = "<span class='st-type'>" , AfterType = "</span>", | |||
// BeforeMethod = "<span class='st-method'>" , AfterMethod = "</span>", | |||
// BeforeParameters = "<span class='st-params'>" , AfterParameters = "</span>", | |||
// BeforeParameterType = "<span class='st-param'><span class='st-param-type'>", AfterParameterType = "</span>", | |||
// BeforeParameterName = "<span class='st-param-name'>" , AfterParameterName = "</span></span>", | |||
// BeforeFile = "<span class='st-file'>" , AfterFile = "</span>", | |||
// BeforeLine = "<span class='st-line'>" , AfterLine = "</span>", | |||
//}; | |||
public NonEscapedString StackTrace(string stackTrace) | |||
{ | |||
try | |||
{ | |||
//return new NonEscapedString(StackTraceFormatter.FormatHtml(stackTrace, StackTraceHtmlFragments)); | |||
return new NonEscapedString(stackTrace); | |||
} | |||
catch (RegexMatchTimeoutException) | |||
{ | |||
return new NonEscapedString(HtmlEncode(stackTrace)); | |||
} | |||
} | |||
public string HtmlEncode(string text) | |||
{ | |||
return WebUtility.HtmlEncode(text); | |||
} | |||
} | |||
} |
@@ -0,0 +1,7 @@ | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public interface IDashboardAuthorizationFilter | |||
{ | |||
bool Authorize( DashboardContext context); | |||
} | |||
} |
@@ -0,0 +1,12 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public interface IDashboardDispatcher | |||
{ | |||
Task Dispatch( DashboardContext context); | |||
} | |||
} |
@@ -1,24 +1,8 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
using System; | |||
using System.Collections.Generic; | |||
using Hangfire.Storage.Monitoring; | |||
using DotNetCore.CAP.Dashboard.Monitoring; | |||
namespace Hangfire.Storage | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public interface IMonitoringApi | |||
{ | |||
@@ -0,0 +1,258 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using DotNetCore.CAP.Infrastructure; | |||
using DotNetCore.CAP.Processor.States; | |||
using Newtonsoft.Json; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public static class JobHistoryRenderer | |||
{ | |||
private static readonly IDictionary<string, Func<HtmlHelper, IDictionary<string, string>, NonEscapedString>> | |||
Renderers = new Dictionary<string, Func<HtmlHelper, IDictionary<string, string>, NonEscapedString>>(); | |||
private static readonly IDictionary<string, string> BackgroundStateColors | |||
= new Dictionary<string, string>(); | |||
private static readonly IDictionary<string, string> ForegroundStateColors | |||
= new Dictionary<string, string>(); | |||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")] | |||
static JobHistoryRenderer() | |||
{ | |||
Register(SucceededState.StateName, SucceededRenderer); | |||
Register(FailedState.StateName, FailedRenderer); | |||
Register(ProcessingState.StateName, ProcessingRenderer); | |||
Register(EnqueuedState.StateName, EnqueuedRenderer); | |||
Register(ScheduledState.StateName, ScheduledRenderer); | |||
//Register(DeletedState.StateName, NullRenderer); | |||
//Register(AwaitingState.StateName, AwaitingRenderer); | |||
BackgroundStateColors.Add(EnqueuedState.StateName, "#F5F5F5"); | |||
BackgroundStateColors.Add(SucceededState.StateName, "#EDF7ED"); | |||
BackgroundStateColors.Add(FailedState.StateName, "#FAEBEA"); | |||
BackgroundStateColors.Add(ProcessingState.StateName, "#FCEFDC"); | |||
BackgroundStateColors.Add(ScheduledState.StateName, "#E0F3F8"); | |||
//BackgroundStateColors.Add(DeletedState.StateName, "#ddd"); | |||
//BackgroundStateColors.Add(AwaitingState.StateName, "#F5F5F5"); | |||
ForegroundStateColors.Add(EnqueuedState.StateName, "#999"); | |||
ForegroundStateColors.Add(SucceededState.StateName, "#5cb85c"); | |||
ForegroundStateColors.Add(FailedState.StateName, "#d9534f"); | |||
ForegroundStateColors.Add(ProcessingState.StateName, "#f0ad4e"); | |||
ForegroundStateColors.Add(ScheduledState.StateName, "#5bc0de"); | |||
//ForegroundStateColors.Add(DeletedState.StateName, "#777"); | |||
//ForegroundStateColors.Add(AwaitingState.StateName, "#999"); | |||
} | |||
public static void AddBackgroundStateColor(string stateName, string color) | |||
{ | |||
BackgroundStateColors.Add(stateName, color); | |||
} | |||
public static string GetBackgroundStateColor(string stateName) | |||
{ | |||
if (stateName == null || !BackgroundStateColors.ContainsKey(stateName)) | |||
{ | |||
return "inherit"; | |||
} | |||
return BackgroundStateColors[stateName]; | |||
} | |||
public static void AddForegroundStateColor(string stateName, string color) | |||
{ | |||
ForegroundStateColors.Add(stateName, color); | |||
} | |||
public static string GetForegroundStateColor(string stateName) | |||
{ | |||
if (stateName == null || !ForegroundStateColors.ContainsKey(stateName)) | |||
{ | |||
return "inherit"; | |||
} | |||
return ForegroundStateColors[stateName]; | |||
} | |||
public static void Register(string state, Func<HtmlHelper, IDictionary<string, string>, NonEscapedString> renderer) | |||
{ | |||
if (!Renderers.ContainsKey(state)) | |||
{ | |||
Renderers.Add(state, renderer); | |||
} | |||
else | |||
{ | |||
Renderers[state] = renderer; | |||
} | |||
} | |||
public static bool Exists(string state) | |||
{ | |||
return Renderers.ContainsKey(state); | |||
} | |||
public static NonEscapedString RenderHistory( | |||
this HtmlHelper helper, | |||
string state, IDictionary<string, string> properties) | |||
{ | |||
var renderer = Renderers.ContainsKey(state) | |||
? Renderers[state] | |||
: DefaultRenderer; | |||
return renderer?.Invoke(helper, properties); | |||
} | |||
public static NonEscapedString NullRenderer(HtmlHelper helper, IDictionary<string, string> properties) | |||
{ | |||
return null; | |||
} | |||
public static NonEscapedString DefaultRenderer(HtmlHelper helper, IDictionary<string, string> stateData) | |||
{ | |||
if (stateData == null || stateData.Count == 0) return null; | |||
var builder = new StringBuilder(); | |||
builder.Append("<dl class=\"dl-horizontal\">"); | |||
foreach (var item in stateData) | |||
{ | |||
builder.Append($"<dt>{item.Key}</dt>"); | |||
builder.Append($"<dd>{item.Value}</dd>"); | |||
} | |||
builder.Append("</dl>"); | |||
return new NonEscapedString(builder.ToString()); | |||
} | |||
public static NonEscapedString SucceededRenderer(HtmlHelper html, IDictionary<string, string> stateData) | |||
{ | |||
var builder = new StringBuilder(); | |||
builder.Append("<dl class=\"dl-horizontal\">"); | |||
var itemsAdded = false; | |||
if (stateData.ContainsKey("Latency")) | |||
{ | |||
var latency = TimeSpan.FromMilliseconds(long.Parse(stateData["Latency"])); | |||
builder.Append($"<dt>Latency:</dt><dd>{html.ToHumanDuration(latency, false)}</dd>"); | |||
itemsAdded = true; | |||
} | |||
if (stateData.ContainsKey("PerformanceDuration")) | |||
{ | |||
var duration = TimeSpan.FromMilliseconds(long.Parse(stateData["PerformanceDuration"])); | |||
builder.Append($"<dt>Duration:</dt><dd>{html.ToHumanDuration(duration, false)}</dd>"); | |||
itemsAdded = true; | |||
} | |||
if (stateData.ContainsKey("Result") && !String.IsNullOrWhiteSpace(stateData["Result"])) | |||
{ | |||
var result = stateData["Result"]; | |||
builder.Append($"<dt>Result:</dt><dd>{System.Net.WebUtility.HtmlEncode(result)}</dd>"); | |||
itemsAdded = true; | |||
} | |||
builder.Append("</dl>"); | |||
if (!itemsAdded) return null; | |||
return new NonEscapedString(builder.ToString()); | |||
} | |||
private static NonEscapedString FailedRenderer(HtmlHelper html, IDictionary<string, string> stateData) | |||
{ | |||
var stackTrace = html.StackTrace(stateData["ExceptionDetails"]).ToString(); | |||
return new NonEscapedString( | |||
$"<h4 class=\"exception-type\">{stateData["ExceptionType"]}</h4><p class=\"text-muted\">{stateData["ExceptionMessage"]}</p>{"<pre class=\"stack-trace\">" + stackTrace + "</pre>"}"); | |||
} | |||
private static NonEscapedString ProcessingRenderer(HtmlHelper helper, IDictionary<string, string> stateData) | |||
{ | |||
var builder = new StringBuilder(); | |||
builder.Append("<dl class=\"dl-horizontal\">"); | |||
string serverId = null; | |||
if (stateData.ContainsKey("ServerId")) | |||
{ | |||
serverId = stateData["ServerId"]; | |||
} | |||
else if (stateData.ContainsKey("ServerName")) | |||
{ | |||
serverId = stateData["ServerName"]; | |||
} | |||
if (serverId != null) | |||
{ | |||
builder.Append("<dt>Server:</dt>"); | |||
builder.Append($"<dd>{helper.ServerId(serverId)}</dd>"); | |||
} | |||
if (stateData.ContainsKey("WorkerId")) | |||
{ | |||
builder.Append("<dt>Worker:</dt>"); | |||
builder.Append($"<dd>{stateData["WorkerId"].Substring(0, 8)}</dd>"); | |||
} | |||
else if (stateData.ContainsKey("WorkerNumber")) | |||
{ | |||
builder.Append("<dt>Worker:</dt>"); | |||
builder.Append($"<dd>#{stateData["WorkerNumber"]}</dd>"); | |||
} | |||
builder.Append("</dl>"); | |||
return new NonEscapedString(builder.ToString()); | |||
} | |||
private static NonEscapedString EnqueuedRenderer(HtmlHelper helper, IDictionary<string, string> stateData) | |||
{ | |||
return new NonEscapedString( | |||
$"<dl class=\"dl-horizontal\"><dt>Queue:</dt><dd>{helper.QueueLabel(stateData["Queue"])}</dd></dl>"); | |||
} | |||
private static NonEscapedString ScheduledRenderer(HtmlHelper helper, IDictionary<string, string> stateData) | |||
{ | |||
var enqueueAt = Helper.DeserializeDateTime(stateData["EnqueueAt"]); | |||
return new NonEscapedString( | |||
$"<dl class=\"dl-horizontal\"><dt>Enqueue at:</dt><dd data-moment=\"{Helper.ToTimestamp(enqueueAt)}\">{enqueueAt}</dd></dl>"); | |||
} | |||
private static NonEscapedString AwaitingRenderer(HtmlHelper helper, IDictionary<string, string> stateData) | |||
{ | |||
var builder = new StringBuilder(); | |||
builder.Append("<dl class=\"dl-horizontal\">"); | |||
if (stateData.ContainsKey("ParentId")) | |||
{ | |||
builder.Append($"<dt>Parent</dt><dd>{helper.JobIdLink(stateData["ParentId"])}</dd>"); | |||
} | |||
if (stateData.ContainsKey("NextState")) | |||
{ | |||
var nextState = JsonConvert.DeserializeObject<IState>( | |||
stateData["NextState"], | |||
new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All }); | |||
builder.Append($"<dt>Next State</dt><dd>{helper.StateLabel(nextState.Name)}</dd>"); | |||
} | |||
if (stateData.ContainsKey("Options")) | |||
{ | |||
builder.Append($"<dt>Options</dt><dd><code>{helper.HtmlEncode(stateData["Options"])}</code></dd>"); | |||
} | |||
builder.Append("</dl>"); | |||
return new NonEscapedString(builder.ToString()); | |||
} | |||
} | |||
} |
@@ -0,0 +1,57 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using DotNetCore.CAP.Dashboard.Resources; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public static class JobsSidebarMenu | |||
{ | |||
public static readonly List<Func<RazorPage, MenuItem>> Items | |||
= new List<Func<RazorPage, MenuItem>>(); | |||
static JobsSidebarMenu() | |||
{ | |||
Items.Add(page => new MenuItem(Strings.JobsSidebarMenu_Enqueued, page.Url.LinkToQueues()) | |||
{ | |||
Active = page.RequestPath.StartsWith("/jobs/enqueued"), | |||
Metric = DashboardMetrics.EnqueuedAndQueueCount | |||
}); | |||
Items.Add(page => new MenuItem(Strings.JobsSidebarMenu_Scheduled, page.Url.To("/jobs/scheduled")) | |||
{ | |||
Active = page.RequestPath.StartsWith("/jobs/scheduled"), | |||
Metric = DashboardMetrics.ScheduledCount | |||
}); | |||
Items.Add(page => new MenuItem(Strings.JobsSidebarMenu_Processing, page.Url.To("/jobs/processing")) | |||
{ | |||
Active = page.RequestPath.StartsWith("/jobs/processing"), | |||
Metric = DashboardMetrics.ProcessingCount | |||
}); | |||
Items.Add(page => new MenuItem(Strings.JobsSidebarMenu_Succeeded, page.Url.To("/jobs/succeeded")) | |||
{ | |||
Active = page.RequestPath.StartsWith("/jobs/succeeded"), | |||
Metric = DashboardMetrics.SucceededCount | |||
}); | |||
Items.Add(page => new MenuItem(Strings.JobsSidebarMenu_Failed, page.Url.To("/jobs/failed")) | |||
{ | |||
Active = page.RequestPath.StartsWith("/jobs/failed"), | |||
Metric = DashboardMetrics.FailedCount | |||
}); | |||
Items.Add(page => new MenuItem(Strings.JobsSidebarMenu_Deleted, page.Url.To("/jobs/deleted")) | |||
{ | |||
Active = page.RequestPath.StartsWith("/jobs/deleted"), | |||
Metric = DashboardMetrics.DeletedCount | |||
}); | |||
Items.Add(page => new MenuItem(Strings.JobsSidebarMenu_Awaiting, page.Url.To("/jobs/awaiting")) | |||
{ | |||
Active = page.RequestPath.StartsWith("/jobs/awaiting"), | |||
Metric = DashboardMetrics.AwaitingCount | |||
}); | |||
} | |||
} | |||
} |
@@ -0,0 +1,45 @@ | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Threading.Tasks; | |||
using Newtonsoft.Json; | |||
using Newtonsoft.Json.Converters; | |||
using Newtonsoft.Json.Serialization; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
internal class JsonStats : IDashboardDispatcher | |||
{ | |||
public async Task Dispatch(DashboardContext context) | |||
{ | |||
var requestedMetrics = await context.Request.GetFormValuesAsync("metrics[]"); | |||
var page = new StubPage(); | |||
page.Assign(context); | |||
var metrics = DashboardMetrics.GetMetrics().Where(x => requestedMetrics.Contains(x.Name)); | |||
var result = new Dictionary<string, Metric>(); | |||
foreach (var metric in metrics) | |||
{ | |||
var value = metric.Func(page); | |||
result.Add(metric.Name, value); | |||
} | |||
var settings = new JsonSerializerSettings | |||
{ | |||
ContractResolver = new CamelCasePropertyNamesContractResolver(), | |||
Converters = new JsonConverter[]{ new StringEnumConverter { CamelCaseText = true } } | |||
}; | |||
var serialized = JsonConvert.SerializeObject(result, settings); | |||
context.Response.ContentType = "application/json"; | |||
await context.Response.WriteAsync(serialized); | |||
} | |||
private class StubPage : RazorPage | |||
{ | |||
public override void Execute() | |||
{ | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,26 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public class LocalRequestsOnlyAuthorizationFilter : IDashboardAuthorizationFilter | |||
{ | |||
public bool Authorize(DashboardContext context) | |||
{ | |||
// if unknown, assume not local | |||
if (String.IsNullOrEmpty(context.Request.RemoteIpAddress)) | |||
return false; | |||
// check if localhost | |||
if (context.Request.RemoteIpAddress == "127.0.0.1" || context.Request.RemoteIpAddress == "::1") | |||
return true; | |||
// compare with local address | |||
if (context.Request.RemoteIpAddress == context.Request.LocalIpAddress) | |||
return true; | |||
return false; | |||
} | |||
} | |||
} |
@@ -0,0 +1,33 @@ | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public class MenuItem | |||
{ | |||
public MenuItem(string text, string url) | |||
{ | |||
Text = text; | |||
Url = url; | |||
} | |||
public string Text { get; } | |||
public string Url { get; } | |||
public bool Active { get; set; } | |||
public DashboardMetric Metric { get; set; } | |||
public DashboardMetric[] Metrics { get; set; } | |||
public IEnumerable<DashboardMetric> GetAllMetrics() | |||
{ | |||
var metrics = new List<DashboardMetric> { Metric }; | |||
if (Metrics != null) | |||
{ | |||
metrics.AddRange(Metrics); | |||
} | |||
return metrics.Where(x => x != null).ToList(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,42 @@ | |||
| |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public class Metric | |||
{ | |||
public Metric(string value) | |||
{ | |||
Value = value; | |||
} | |||
public string Value { get; } | |||
public long IntValue { get; set; } | |||
public MetricStyle Style { get; set; } | |||
public bool Highlighted { get; set; } | |||
public string Title { get; set; } | |||
} | |||
public enum MetricStyle | |||
{ | |||
Default, | |||
Info, | |||
Success, | |||
Warning, | |||
Danger, | |||
} | |||
internal static class MetricStyleExtensions | |||
{ | |||
public static string ToClassName(this MetricStyle style) | |||
{ | |||
switch (style) | |||
{ | |||
case MetricStyle.Default: return "metric-default"; | |||
case MetricStyle.Info: return "metric-info"; | |||
case MetricStyle.Success: return "metric-success"; | |||
case MetricStyle.Warning: return "metric-warning"; | |||
case MetricStyle.Danger: return "metric-danger"; | |||
default: return "metric-null"; | |||
} | |||
} | |||
} | |||
} |
@@ -1,7 +1,7 @@ | |||
using System; | |||
using Hangfire.Common; | |||
using DotNetCore.CAP.Models; | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class DeletedJobDto | |||
{ | |||
@@ -10,7 +10,7 @@ namespace Hangfire.Storage.Monitoring | |||
InDeletedState = true; | |||
} | |||
public Job Job { get; set; } | |||
public Message Message { get; set; } | |||
public DateTime? DeletedAt { get; set; } | |||
public bool InDeletedState { get; set; } | |||
} | |||
@@ -1,23 +1,7 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
using System; | |||
using DotNetCore.CAP.Models; | |||
using System; | |||
using Hangfire.Common; | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class EnqueuedJobDto | |||
{ | |||
@@ -26,7 +10,7 @@ namespace Hangfire.Storage.Monitoring | |||
InEnqueuedState = true; | |||
} | |||
public Job Job { get; set; } | |||
public Message Message { get; set; } | |||
public string State { get; set; } | |||
public DateTime? EnqueuedAt { get; set; } | |||
public bool InEnqueuedState { get; set; } | |||
@@ -1,23 +1,7 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
using System; | |||
using DotNetCore.CAP.Models; | |||
using System; | |||
using Hangfire.Common; | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class FailedJobDto | |||
{ | |||
@@ -26,7 +10,7 @@ namespace Hangfire.Storage.Monitoring | |||
InFailedState = true; | |||
} | |||
public Job Job { get; set; } | |||
public Message Message { get; set; } | |||
public string Reason { get; set; } | |||
public DateTime? FailedAt { get; set; } | |||
public string ExceptionType { get; set; } | |||
@@ -1,27 +1,11 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
using System; | |||
using DotNetCore.CAP.Models; | |||
using System; | |||
using Hangfire.Common; | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class FetchedJobDto | |||
{ | |||
public Job Job { get; set; } | |||
public Message Message { get; set; } | |||
public string State { get; set; } | |||
public DateTime? FetchedAt { get; set; } | |||
} | |||
@@ -1,28 +1,12 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
using System; | |||
using System; | |||
using System.Collections.Generic; | |||
using Hangfire.Common; | |||
using DotNetCore.CAP.Models; | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class JobDetailsDto | |||
{ | |||
public Job Job { get; set; } | |||
public Message Message { get; set; } | |||
public DateTime? CreatedAt { get; set; } | |||
public IDictionary<string, string> Properties { get; set; } | |||
public IList<StateHistoryDto> History { get; set; } | |||
@@ -1,22 +1,6 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
using System.Collections.Generic; | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class JobList<TDto> : List<KeyValuePair<string, TDto>> | |||
{ | |||
@@ -1,23 +1,7 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
using System; | |||
using DotNetCore.CAP.Models; | |||
using System; | |||
using Hangfire.Common; | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class ProcessingJobDto | |||
{ | |||
@@ -26,7 +10,7 @@ namespace Hangfire.Storage.Monitoring | |||
InProcessingState = true; | |||
} | |||
public Job Job { get; set; } | |||
public Message Message { get; set; } | |||
public bool InProcessingState { get; set; } | |||
public string ServerId { get; set; } | |||
public DateTime? StartedAt { get; set; } | |||
@@ -1,20 +1,4 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class QueueWithTopEnqueuedJobsDto | |||
{ | |||
@@ -1,23 +1,7 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
using System; | |||
using DotNetCore.CAP.Models; | |||
using System; | |||
using Hangfire.Common; | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class ScheduledJobDto | |||
{ | |||
@@ -26,7 +10,7 @@ namespace Hangfire.Storage.Monitoring | |||
InScheduledState = true; | |||
} | |||
public Job Job { get; set; } | |||
public Message Message { get; set; } | |||
public DateTime EnqueueAt { get; set; } | |||
public DateTime? ScheduledAt { get; set; } | |||
public bool InScheduledState { get; set; } | |||
@@ -1,23 +1,7 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
using System; | |||
using System; | |||
using System.Collections.Generic; | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class ServerDto | |||
{ | |||
@@ -1,23 +1,7 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
using System; | |||
using System; | |||
using System.Collections.Generic; | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class StateHistoryDto | |||
{ | |||
@@ -1,20 +1,4 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class StatisticsDto | |||
{ | |||
@@ -1,7 +1,7 @@ | |||
using System; | |||
using Hangfire.Common; | |||
using DotNetCore.CAP.Models; | |||
namespace Hangfire.Storage.Monitoring | |||
namespace DotNetCore.CAP.Dashboard.Monitoring | |||
{ | |||
public class SucceededJobDto | |||
{ | |||
@@ -10,7 +10,7 @@ namespace Hangfire.Storage.Monitoring | |||
InSucceededState = true; | |||
} | |||
public Job Job { get; set; } | |||
public Message Message { get; set; } | |||
public object Result { get; set; } | |||
public long? TotalDuration { get; set; } | |||
public DateTime? SucceededAt { get; set; } | |||
@@ -0,0 +1,42 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using DotNetCore.CAP.Dashboard.Resources; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public static class NavigationMenu | |||
{ | |||
public static readonly List<Func<RazorPage, MenuItem>> Items = new List<Func<RazorPage, MenuItem>>(); | |||
static NavigationMenu() | |||
{ | |||
Items.Add(page => new MenuItem(Strings.NavigationMenu_Jobs, page.Url.LinkToQueues()) | |||
{ | |||
Active = page.RequestPath.StartsWith("/jobs"), | |||
Metrics = new [] | |||
{ | |||
DashboardMetrics.EnqueuedCountOrNull, | |||
DashboardMetrics.FailedCountOrNull | |||
} | |||
}); | |||
Items.Add(page => new MenuItem(Strings.NavigationMenu_Retries, page.Url.To("/retries")) | |||
{ | |||
Active = page.RequestPath.StartsWith("/retries"), | |||
Metric = DashboardMetrics.RetriesCount | |||
}); | |||
Items.Add(page => new MenuItem(Strings.NavigationMenu_RecurringJobs, page.Url.To("/recurring")) | |||
{ | |||
Active = page.RequestPath.StartsWith("/recurring"), | |||
Metric = DashboardMetrics.RecurringJobCount | |||
}); | |||
Items.Add(page => new MenuItem(Strings.NavigationMenu_Servers, page.Url.To("/servers")) | |||
{ | |||
Active = page.RequestPath.Equals("/servers"), | |||
Metric = DashboardMetrics.ServerCount | |||
}); | |||
} | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public class NonEscapedString | |||
{ | |||
private readonly string _value; | |||
public NonEscapedString(string value) | |||
{ | |||
_value = value; | |||
} | |||
public override string ToString() | |||
{ | |||
return _value; | |||
} | |||
} | |||
} |
@@ -0,0 +1,156 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public class Pager | |||
{ | |||
private const int PageItemsCount = 7; | |||
private const int DefaultRecordsPerPage = 10; | |||
private int _startPageIndex = 1; | |||
private int _endPageIndex = 1; | |||
public Pager(int from, int perPage, long total) | |||
{ | |||
FromRecord = from >= 0 ? from : 0; | |||
RecordsPerPage = perPage > 0 ? perPage : DefaultRecordsPerPage; | |||
TotalRecordCount = total; | |||
CurrentPage = FromRecord / RecordsPerPage + 1; | |||
TotalPageCount = (int)Math.Ceiling((double)TotalRecordCount / RecordsPerPage); | |||
PagerItems = GenerateItems(); | |||
} | |||
public string BasePageUrl { get; set; } | |||
public int FromRecord { get; } | |||
public int RecordsPerPage { get; } | |||
public int CurrentPage { get; } | |||
public int TotalPageCount { get; } | |||
public long TotalRecordCount { get; } | |||
internal ICollection<Item> PagerItems { get; } | |||
public string PageUrl(int page) | |||
{ | |||
if (page < 1 || page > TotalPageCount) return "#"; | |||
return BasePageUrl + "?from=" + (page - 1) * RecordsPerPage + "&count=" + RecordsPerPage; | |||
} | |||
public string RecordsPerPageUrl(int perPage) | |||
{ | |||
if (perPage <= 0) return "#"; | |||
return BasePageUrl + "?from=0&count=" + perPage; | |||
} | |||
private ICollection<Item> GenerateItems() | |||
{ | |||
// start page index | |||
_startPageIndex = CurrentPage - PageItemsCount / 2; | |||
if (_startPageIndex + PageItemsCount > TotalPageCount) | |||
_startPageIndex = TotalPageCount + 1 - PageItemsCount; | |||
if (_startPageIndex < 1) | |||
_startPageIndex = 1; | |||
// end page index | |||
_endPageIndex = _startPageIndex + PageItemsCount - 1; | |||
if (_endPageIndex > TotalPageCount) | |||
_endPageIndex = TotalPageCount; | |||
var pagerItems = new List<Item>(); | |||
if (TotalPageCount == 0) return pagerItems; | |||
AddPrevious(pagerItems); | |||
// first page | |||
if (_startPageIndex > 1) | |||
pagerItems.Add(new Item(1, false, ItemType.Page)); | |||
// more page before numeric page buttons | |||
AddMoreBefore(pagerItems); | |||
// numeric page | |||
AddPageNumbers(pagerItems); | |||
// more page after numeric page buttons | |||
AddMoreAfter(pagerItems); | |||
// last page | |||
if (_endPageIndex < TotalPageCount) | |||
pagerItems.Add(new Item(TotalPageCount, false, ItemType.Page)); | |||
// Next page | |||
AddNext(pagerItems); | |||
return pagerItems; | |||
} | |||
private void AddPrevious(ICollection<Item> results) | |||
{ | |||
var item = new Item(CurrentPage - 1, CurrentPage == 1, ItemType.PrevPage); | |||
results.Add(item); | |||
} | |||
private void AddMoreBefore(ICollection<Item> results) | |||
{ | |||
if (_startPageIndex > 2) | |||
{ | |||
var index = _startPageIndex - 1; | |||
if (index < 1) index = 1; | |||
var item = new Item(index, false, ItemType.MorePage); | |||
results.Add(item); | |||
} | |||
} | |||
private void AddMoreAfter(ICollection<Item> results) | |||
{ | |||
if (_endPageIndex < TotalPageCount - 1) | |||
{ | |||
var index = _startPageIndex + PageItemsCount; | |||
if (index > TotalPageCount) { index = TotalPageCount; } | |||
var item = new Item(index, false, ItemType.MorePage); | |||
results.Add(item); | |||
} | |||
} | |||
private void AddPageNumbers(ICollection<Item> results) | |||
{ | |||
for (var pageIndex = _startPageIndex; pageIndex <= _endPageIndex; pageIndex++) | |||
{ | |||
var item = new Item(pageIndex, false, ItemType.Page); | |||
results.Add(item); | |||
} | |||
} | |||
private void AddNext(ICollection<Item> results) | |||
{ | |||
var item = new Item(CurrentPage + 1, CurrentPage >= TotalPageCount, ItemType.NextPage); | |||
results.Add(item); | |||
} | |||
internal class Item | |||
{ | |||
public Item(int pageIndex, bool disabled, ItemType type) | |||
{ | |||
PageIndex = pageIndex; | |||
Disabled = disabled; | |||
Type = type; | |||
} | |||
public int PageIndex { get; } | |||
public bool Disabled { get; } | |||
public ItemType Type { get; } | |||
} | |||
internal enum ItemType | |||
{ | |||
Page, | |||
PrevPage, | |||
NextPage, | |||
MorePage | |||
} | |||
} | |||
} |
@@ -1,11 +1,10 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: true *@ | |||
@using System | |||
@using System.Collections.Generic | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@using Hangfire.States | |||
@using Hangfire.Storage | |||
@using DotNetCore.CAP | |||
@using DotNetCore.CAP.Dashboard | |||
@using DotNetCore.CAP.Dashboard.Pages | |||
@using DotNetCore.CAP.Dashboard.Resources | |||
@inherits RazorPage | |||
@{ | |||
Layout = new LayoutPage(Strings.AwaitingJobsPage_Title); | |||
@@ -20,7 +19,7 @@ | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
var storageConnection = connection as JobStorageConnection; | |||
var storageConnection = connection as IStorageConnection; | |||
if (storageConnection != null) | |||
{ | |||
@@ -83,7 +82,7 @@ | |||
<tbody> | |||
@foreach (var jobId in jobIds) | |||
{ | |||
JobData jobData; | |||
MessageData jobData; | |||
StateData stateData; | |||
StateData parentStateData = null; | |||
@@ -92,10 +91,10 @@ | |||
jobData = connection.GetJobData(jobId); | |||
stateData = connection.GetStateData(jobId); | |||
if (stateData != null && stateData.Name == AwaitingState.StateName) | |||
{ | |||
parentStateData = connection.GetStateData(stateData.Data["ParentId"]); | |||
} | |||
//if (stateData != null && stateData.Name == AwaitingState.StateName) | |||
//{ | |||
// parentStateData = connection.GetStateData(stateData.Data["ParentId"]); | |||
//} | |||
} | |||
<tr class="js-jobs-list-row @(jobData != null ? "hover" : null)"> | |||
@@ -112,7 +111,7 @@ | |||
else | |||
{ | |||
<td class="word-break"> | |||
@Html.JobNameLink(jobId, jobData.Job) | |||
@Html.JobNameLink(jobId, jobData.Message) | |||
</td> | |||
<td class="min-width"> | |||
@if (stateData != null && stateData.Data.ContainsKey("Options") && !String.IsNullOrWhiteSpace(stateData.Data["Options"])) |
@@ -1,4 +1,4 @@ | |||
namespace Hangfire.Dashboard.Pages | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
partial class BlockMetric | |||
{ |
@@ -1,6 +1,6 @@ | |||
using System.Collections.Generic; | |||
namespace Hangfire.Dashboard.Pages | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
partial class Breadcrumbs | |||
{ |
@@ -1,9 +1,9 @@ | |||
using System.Collections.Generic; | |||
namespace Hangfire.Dashboard.Pages | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
partial class HomePage | |||
internal partial class HomePage | |||
{ | |||
public static readonly List<DashboardMetric> Metrics = new List<DashboardMetric>(); | |||
public static readonly List<DashboardMetric> Metrics = new List<DashboardMetric>(); | |||
} | |||
} |
@@ -1,9 +1,9 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ | |||
@using System | |||
@using System.Collections.Generic | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@using DotNetCore.CAP.Dashboard | |||
@using DotNetCore.CAP.Dashboard.Pages | |||
@using DotNetCore.CAP.Dashboard.Resources | |||
@using Newtonsoft.Json | |||
@inherits RazorPage | |||
@{ |
@@ -9,7 +9,7 @@ | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
#line 2 "..\..\Dashboard\Pages\HomePage.cshtml" | |||
@@ -27,19 +27,19 @@ namespace Hangfire.Dashboard.Pages | |||
using System.Text; | |||
#line 4 "..\..\Dashboard\Pages\HomePage.cshtml" | |||
using Hangfire.Dashboard; | |||
using DotNetCore.CAP.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 5 "..\..\Dashboard\Pages\HomePage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
using DotNetCore.CAP.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 6 "..\..\Dashboard\Pages\HomePage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
using DotNetCore.CAP.Dashboard.Resources; | |||
#line default | |||
#line hidden |
@@ -1,6 +1,6 @@ | |||
namespace Hangfire.Dashboard.Pages | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
partial class InlineMetric | |||
internal partial class InlineMetric | |||
{ | |||
public InlineMetric(DashboardMetric dashboardMetric) | |||
{ |
@@ -1,4 +1,4 @@ | |||
namespace Hangfire.Dashboard.Pages | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
partial class LayoutPage | |||
{ |
@@ -2,9 +2,9 @@ | |||
@using System | |||
@using System.Globalization | |||
@using System.Reflection | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@using DotNetCore.CAP.Dashboard | |||
@using DotNetCore.CAP.Dashboard.Pages | |||
@using DotNetCore.CAP.Dashboard.Resources | |||
@inherits RazorPage | |||
<!DOCTYPE html> | |||
<html lang="@CultureInfo.CurrentUICulture.TwoLetterISOLanguageName"> |
@@ -9,7 +9,7 @@ | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
#line 2 "..\..\Dashboard\Pages\LayoutPage.cshtml" | |||
@@ -34,19 +34,19 @@ namespace Hangfire.Dashboard.Pages | |||
using System.Text; | |||
#line 5 "..\..\Dashboard\Pages\LayoutPage.cshtml" | |||
using Hangfire.Dashboard; | |||
using DotNetCore.CAP.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 6 "..\..\Dashboard\Pages\LayoutPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
using DotNetCore.CAP.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 7 "..\..\Dashboard\Pages\LayoutPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
using DotNetCore.CAP.Dashboard.Resources; | |||
#line default | |||
#line hidden |
@@ -1,9 +1,9 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ | |||
@using System | |||
@using System.Linq | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@using DotNetCore.CAP.Dashboard | |||
@using DotNetCore.CAP.Dashboard.Pages | |||
@using DotNetCore.CAP.Dashboard.Resources | |||
@inherits RazorPage | |||
@{ | |||
Layout = new LayoutPage(Strings.ProcessingJobsPage_Title); |
@@ -0,0 +1,16 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
partial class SidebarMenu | |||
{ | |||
public SidebarMenu( IEnumerable<Func<RazorPage, MenuItem>> items) | |||
{ | |||
if (items == null) throw new ArgumentNullException(nameof(items)); | |||
Items = items; | |||
} | |||
public IEnumerable<Func<RazorPage, MenuItem>> Items { get; } | |||
} | |||
} |
@@ -1,8 +1,8 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ | |||
@using System | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@using DotNetCore.CAP.Dashboard | |||
@using DotNetCore.CAP.Dashboard.Pages | |||
@using DotNetCore.CAP.Dashboard.Resources | |||
@inherits RazorPage | |||
@{ | |||
Layout = new LayoutPage(Strings.SucceededJobsPage_Title); |
@@ -1,13 +1,13 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True TrimLeadingUnderscores : true *@ | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Resources | |||
@using DotNetCore.CAP.Dashboard | |||
@using DotNetCore.CAP.Dashboard.Resources | |||
@inherits RazorPage | |||
@{ | |||
var metric = DashboardMetric.Func(this); | |||
var className = metric == null ? "metric-null" : metric.Style.ToClassName(); | |||
var highlighted = metric != null && metric.Highlighted ? "highlighted" : null; | |||
} | |||
<div class="metric @className @highlighted"> | |||
<div class="metric @className @highlighted"> | |||
<div class="metric-body" data-metric="@DashboardMetric.Name"> | |||
@(metric?.Value) | |||
</div> |
@@ -9,7 +9,7 @@ | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
using System; | |||
using System.Collections.Generic; | |||
@@ -17,13 +17,13 @@ namespace Hangfire.Dashboard.Pages | |||
using System.Text; | |||
#line 2 "..\..\Dashboard\Pages\_BlockMetric.cshtml" | |||
using Hangfire.Dashboard; | |||
using DotNetCore.CAP.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 3 "..\..\Dashboard\Pages\_BlockMetric.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
using DotNetCore.CAP.Dashboard.Resources; | |||
#line default | |||
#line hidden |
@@ -1,5 +1,5 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True TrimLeadingUnderscores : true *@ | |||
@using Hangfire.Dashboard | |||
@using DotNetCore.CAP.Dashboard | |||
@inherits RazorPage | |||
<ol class="breadcrumb"> |
@@ -1,5 +1,5 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True TrimLeadingUnderscores : true *@ | |||
@using Hangfire.Dashboard | |||
@using DotNetCore.CAP.Dashboard | |||
@inherits RazorPage | |||
@{ | |||
var metric = DashboardMetric.Func(this); |
@@ -9,7 +9,7 @@ | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
using System; | |||
using System.Collections.Generic; | |||
@@ -17,7 +17,7 @@ namespace Hangfire.Dashboard.Pages | |||
using System.Text; | |||
#line 2 "..\..\Dashboard\Pages\_InlineMetric.cshtml" | |||
using Hangfire.Dashboard; | |||
using DotNetCore.CAP.Dashboard; | |||
#line default | |||
#line hidden |
@@ -1,5 +1,5 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True TrimLeadingUnderscores : true *@ | |||
@using Hangfire.Dashboard | |||
@using DotNetCore.CAP.Dashboard | |||
@inherits RazorPage | |||
@if (NavigationMenu.Items.Count > 0) | |||
{ |
@@ -9,7 +9,7 @@ | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
using System; | |||
using System.Collections.Generic; | |||
@@ -17,7 +17,7 @@ namespace Hangfire.Dashboard.Pages | |||
using System.Text; | |||
#line 2 "..\..\Dashboard\Pages\_Navigation.cshtml" | |||
using Hangfire.Dashboard; | |||
using DotNetCore.CAP.Dashboard; | |||
#line default | |||
#line hidden |
@@ -1,4 +1,4 @@ | |||
namespace Hangfire.Dashboard.Pages | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
partial class Paginator | |||
{ |
@@ -1,6 +1,6 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True TrimLeadingUnderscores : true *@ | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Resources; | |||
@using DotNetCore.CAP.Dashboard | |||
@using DotNetCore.CAP.Dashboard.Resources; | |||
@inherits RazorPage | |||
<div class="btn-toolbar"> |
@@ -1,4 +1,4 @@ | |||
namespace Hangfire.Dashboard.Pages | |||
namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
partial class PerPageSelector | |||
{ |
@@ -1,6 +1,6 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True TrimLeadingUnderscores : true *@ | |||
@using Hangfire.Dashboard.Resources; | |||
@inherits Hangfire.Dashboard.RazorPage | |||
@using DotNetCore.CAP.Dashboard.Resources; | |||
@inherits DotNetCore.CAP.Dashboard.RazorPage | |||
<div class="btn-group pull-right paginator"> | |||
@foreach (var count in new[] { 10, 20, 50, 100, 500 }) |
@@ -1,5 +1,5 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True TrimLeadingUnderscores : true *@ | |||
@using Hangfire.Dashboard | |||
@using DotNetCore.CAP.Dashboard | |||
@inherits RazorPage | |||
@if (Items.Any()) | |||
{ |
@@ -1,26 +1,11 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2013-2014 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
using System; | |||
using System; | |||
using System.Diagnostics; | |||
using System.Net; | |||
using System.Text; | |||
using Hangfire.Storage.Monitoring; | |||
using System.Threading.Tasks; | |||
using DotNetCore.CAP.Dashboard.Monitoring; | |||
namespace Hangfire.Dashboard | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public abstract class RazorPage | |||
{ | |||
@@ -39,7 +24,7 @@ namespace Hangfire.Dashboard | |||
public HtmlHelper Html { get; private set; } | |||
public UrlHelper Url { get; private set; } | |||
public JobStorage Storage { get; internal set; } | |||
public IStorage Storage { get; internal set; } | |||
public string AppPath { get; internal set; } | |||
public int StatsPollingInterval { get; internal set; } | |||
public Stopwatch GenerationTime { get; private set; } | |||
@@ -0,0 +1,26 @@ | |||
using System; | |||
using System.Text.RegularExpressions; | |||
using System.Threading.Tasks; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
internal class RazorPageDispatcher : IDashboardDispatcher | |||
{ | |||
private readonly Func<Match, RazorPage> _pageFunc; | |||
public RazorPageDispatcher(Func<Match, RazorPage> pageFunc) | |||
{ | |||
_pageFunc = pageFunc; | |||
} | |||
public Task Dispatch(DashboardContext context) | |||
{ | |||
context.Response.ContentType = "text/html"; | |||
var page = _pageFunc(context.UriMatch); | |||
page.Assign(context); | |||
return context.Response.WriteAsync(page.ToString()); | |||
} | |||
} | |||
} |
@@ -0,0 +1,44 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
namespace DotNetCore.CAP.Dashboard | |||
{ | |||
public class UrlHelper | |||
{ | |||
private readonly DashboardContext _context; | |||
public UrlHelper( DashboardContext context) | |||
{ | |||
if (context == null) throw new ArgumentNullException(nameof(context)); | |||
_context = context; | |||
} | |||
public string To(string relativePath) | |||
{ | |||
return | |||
_context.Request.PathBase | |||
+ relativePath; | |||
} | |||
public string Home() | |||
{ | |||
return To("/"); | |||
} | |||
public string JobDetails(string jobId) | |||
{ | |||
return To("/jobs/details/" + jobId); | |||
} | |||
public string LinkToQueues() | |||
{ | |||
return To("/jobs/enqueued"); | |||
} | |||
public string Queue(string queue) | |||
{ | |||
return To("/jobs/enqueued/" + queue); | |||
} | |||
} | |||
} |
@@ -1,638 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
#line 2 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
using System; | |||
#line default | |||
#line hidden | |||
#line 3 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
using System.Collections.Generic; | |||
#line default | |||
#line hidden | |||
using System.Linq; | |||
using System.Text; | |||
#line 4 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 5 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 6 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
#line 7 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
using Hangfire.States; | |||
#line default | |||
#line hidden | |||
#line 8 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
using Hangfire.Storage; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class AwaitingJobsPage : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 10 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Layout = new LayoutPage(Strings.AwaitingJobsPage_Title); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
List<string> jobIds = null; | |||
Pager pager = null; | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
var storageConnection = connection as JobStorageConnection; | |||
if (storageConnection != null) | |||
{ | |||
pager = new Pager(from, perPage, storageConnection.GetSetCount("awaiting")); | |||
jobIds = storageConnection.GetRangeFromSet("awaiting", pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1); | |||
} | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "); | |||
#line 35 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Html.JobsSidebar()); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n <div class=\"col-md-9\">\r\n <h1 class=\"page-header\">"); | |||
#line 38 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.AwaitingJobsPage_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h1>\r\n\r\n"); | |||
#line 40 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
if (jobIds == null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-warning\">\r\n <h4>"); | |||
#line 43 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.AwaitingJobsPage_ContinuationsWarning_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h4>\r\n <p>"); | |||
#line 44 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.AwaitingJobsPage_ContinuationsWarning_Text); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</p>\r\n </div>\r\n"); | |||
#line 46 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
} | |||
else if (jobIds.Count > 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar b" + | |||
"tn-toolbar-top\">\r\n <button class=\"js-jobs-list-command btn bt" + | |||
"n-sm btn-primary\"\r\n data-url=\""); | |||
#line 52 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Url.To("/jobs/awaiting/enqueue")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 53 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.Common_Enqueueing); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <span class=\"glyphicon glyphicon-repeat\"></span>\r\n " + | |||
" "); | |||
#line 55 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.Common_EnqueueButton_Text); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n <button class=\"js-jobs-lis" + | |||
"t-command btn btn-sm btn-default\"\r\n data-url=\""); | |||
#line 59 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Url.To("/jobs/awaiting/delete")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 60 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.Common_Deleting); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-confirm=\""); | |||
#line 61 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.Common_DeleteConfirm); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <span class=\"glyphicon glyphicon-remove\"></span>\r\n " + | |||
" "); | |||
#line 63 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.Common_DeleteSelected); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n "); | |||
#line 66 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Html.PerPageSelector(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral(@" | |||
</div> | |||
<div class=""table-responsive""> | |||
<table class=""table table-hover""> | |||
<thead> | |||
<tr> | |||
<th class=""min-width""> | |||
<input type=""checkbox"" class=""js-jobs-list-select-all"" /> | |||
</th> | |||
<th class=""min-width"">"); | |||
#line 76 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.Common_Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 77 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.Common_Job); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"min-width\">"); | |||
#line 78 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.AwaitingJobsPage_Table_Options); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"min-width\">"); | |||
#line 79 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.AwaitingJobsPage_Table_Parent); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right\">"); | |||
#line 80 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.Common_Created); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n " + | |||
" <tbody>\r\n"); | |||
#line 84 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
foreach (var jobId in jobIds) | |||
{ | |||
JobData jobData; | |||
StateData stateData; | |||
StateData parentStateData = null; | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
jobData = connection.GetJobData(jobId); | |||
stateData = connection.GetStateData(jobId); | |||
if (stateData != null && stateData.Name == AwaitingState.StateName) | |||
{ | |||
parentStateData = connection.GetStateData(stateData.Data["ParentId"]); | |||
} | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr class=\"js-jobs-list-row "); | |||
#line 101 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(jobData != null ? "hover" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <td>\r\n " + | |||
" <input type=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\""); | |||
#line 103 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(jobId); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" />\r\n </td>\r\n " + | |||
" <td class=\"min-width\">\r\n "); | |||
#line 106 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Html.JobIdLink(jobId)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
#line 108 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
if (jobData == null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td colspan=\"2\"><em>"); | |||
#line 110 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.Common_JobExpired); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em></td>\r\n"); | |||
#line 111 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td class=\"word-break\">\r\n " + | |||
" "); | |||
#line 115 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Html.JobNameLink(jobId, jobData.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"min-width\">\r\n"); | |||
#line 118 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
if (stateData != null && stateData.Data.ContainsKey("Options") && !String.IsNullOrWhiteSpace(stateData.Data["Options"])) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <code>"); | |||
#line 120 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(stateData.Data["Options"]); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</code>\r\n"); | |||
#line 121 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <em>"); | |||
#line 124 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.Common_NotAvailable); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em>\r\n"); | |||
#line 125 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
WriteLiteral(" <td class=\"min-width\">\r\n"); | |||
#line 128 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
if (parentStateData != null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <a href=\""); | |||
#line 130 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Url.JobDetails(stateData.Data["ParentId"])); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <span class=\"label label-" + | |||
"default label-hover\" style=\""); | |||
#line 131 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write($"background-color: {JobHistoryRenderer.GetForegroundStateColor(parentStateData.Name)};"); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n "); | |||
#line 132 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(parentStateData.Name); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </span>\r\n " + | |||
" </a>\r\n"); | |||
#line 135 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <em>"); | |||
#line 138 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.Common_NotAvailable); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em>\r\n"); | |||
#line 139 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
WriteLiteral(" <td class=\"min-width align-right\">\r\n " + | |||
" "); | |||
#line 142 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Html.RelativeTime(jobData.CreatedAt)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
#line 144 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tr>\r\n"); | |||
#line 146 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n </table>\r\n <" + | |||
"/div>\r\n "); | |||
#line 150 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Html.Paginator(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 152 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-info\">\r\n "); | |||
#line 156 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
Write(Strings.AwaitingJobsPage_NoJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 158 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n</div>\r\n"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,102 +0,0 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@inherits RazorPage | |||
@{ | |||
Layout = new LayoutPage(Strings.DeletedJobsPage_Title); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var pager = new Pager(from, perPage, monitor.DeletedListCount()); | |||
var jobs = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage); | |||
} | |||
<div class="row"> | |||
<div class="col-md-3"> | |||
@Html.JobsSidebar() | |||
</div> | |||
<div class="col-md-9"> | |||
<h1 class="page-header">@Strings.DeletedJobsPage_Title</h1> | |||
@if (pager.TotalPageCount == 0) | |||
{ | |||
<div class="alert alert-info"> | |||
@Strings.DeletedJobsPage_NoJobs | |||
</div> | |||
} | |||
else | |||
{ | |||
<div class="js-jobs-list"> | |||
<div class="btn-toolbar btn-toolbar-top"> | |||
<button class="js-jobs-list-command btn btn-sm btn-primary" | |||
data-url="@Url.To("/jobs/deleted/requeue")" | |||
data-loading-text="@Strings.Common_Enqueueing" | |||
disabled="disabled"> | |||
<span class="glyphicon glyphicon-repeat"></span> | |||
@Strings.Common_RequeueJobs | |||
</button> | |||
@Html.PerPageSelector(pager) | |||
</div> | |||
<div class="table-responsive"> | |||
<table class="table"> | |||
<thead> | |||
<tr> | |||
<th class="min-width"> | |||
<input type="checkbox" class="js-jobs-list-select-all" /> | |||
</th> | |||
<th class="min-width">@Strings.Common_Id</th> | |||
<th>@Strings.Common_Job</th> | |||
<th class="align-right">@Strings.DeletedJobsPage_Table_Deleted</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@foreach (var job in jobs) | |||
{ | |||
<tr class="js-jobs-list-row @(job.Value == null || !job.Value.InDeletedState ? "obsolete-data" : null) @(job.Value != null && job.Value.InDeletedState && job.Value != null ? "hover" : null)"> | |||
<td> | |||
@if (job.Value == null || job.Value.InDeletedState) | |||
{ | |||
<input type="checkbox" class="js-jobs-list-checkbox" name="jobs[]" value="@job.Key" /> | |||
} | |||
</td> | |||
<td class="min-width"> | |||
@Html.JobIdLink(job.Key) | |||
@if (job.Value != null && !job.Value.InDeletedState) | |||
{ | |||
<span title="@Strings.Common_JobStateChanged_Text" class="glyphicon glyphicon-question-sign"></span> | |||
} | |||
</td> | |||
@if (job.Value == null) | |||
{ | |||
<td colspan="2"><em>@Strings.Common_JobExpired</em></td> | |||
} | |||
else | |||
{ | |||
<td class="word-break"> | |||
@Html.JobNameLink(job.Key, job.Value.Job) | |||
</td> | |||
<td class="align-right"> | |||
@if (job.Value.DeletedAt.HasValue) | |||
{ | |||
@Html.RelativeTime(job.Value.DeletedAt.Value) | |||
} | |||
</td> | |||
} | |||
</tr> | |||
} | |||
</tbody> | |||
</table> | |||
</div> | |||
@Html.Paginator(pager) | |||
</div> | |||
} | |||
</div> | |||
</div> | |||
@@ -1,433 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
#line 2 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 3 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 4 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class DeletedJobsPage : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 6 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Layout = new LayoutPage(Strings.DeletedJobsPage_Title); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var pager = new Pager(from, perPage, monitor.DeletedListCount()); | |||
var jobs = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "); | |||
#line 21 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Html.JobsSidebar()); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n <div class=\"col-md-9\">\r\n <h1 class=\"page-header\">"); | |||
#line 24 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Strings.DeletedJobsPage_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h1>\r\n\r\n"); | |||
#line 26 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
if (pager.TotalPageCount == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-info\">\r\n "); | |||
#line 29 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Strings.DeletedJobsPage_NoJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 31 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar b" + | |||
"tn-toolbar-top\">\r\n <button class=\"js-jobs-list-command btn bt" + | |||
"n-sm btn-primary\"\r\n data-url=\""); | |||
#line 37 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Url.To("/jobs/deleted/requeue")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 38 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Strings.Common_Enqueueing); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n <spa" + | |||
"n class=\"glyphicon glyphicon-repeat\"></span>\r\n "); | |||
#line 41 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Strings.Common_RequeueJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n "); | |||
#line 43 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Html.PerPageSelector(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral(@" | |||
</div> | |||
<div class=""table-responsive""> | |||
<table class=""table""> | |||
<thead> | |||
<tr> | |||
<th class=""min-width""> | |||
<input type=""checkbox"" class=""js-jobs-list-select-all"" /> | |||
</th> | |||
<th class=""min-width"">"); | |||
#line 52 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Strings.Common_Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 53 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Strings.Common_Job); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right\">"); | |||
#line 54 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Strings.DeletedJobsPage_Table_Deleted); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n " + | |||
" <tbody>\r\n"); | |||
#line 58 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
foreach (var job in jobs) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr class=\"js-jobs-list-row "); | |||
#line 60 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(job.Value == null || !job.Value.InDeletedState ? "obsolete-data" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" "); | |||
#line 60 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(job.Value != null && job.Value.InDeletedState && job.Value != null ? "hover" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <td>\r\n"); | |||
#line 62 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
if (job.Value == null || job.Value.InDeletedState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <input type=\"checkbox\" class=\"js-jobs" + | |||
"-list-checkbox\" name=\"jobs[]\" value=\""); | |||
#line 64 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(job.Key); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" />\r\n"); | |||
#line 65 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <t" + | |||
"d class=\"min-width\">\r\n "); | |||
#line 68 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Html.JobIdLink(job.Key)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 69 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
if (job.Value != null && !job.Value.InDeletedState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <span title=\""); | |||
#line 71 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Strings.Common_JobStateChanged_Text); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n"); | |||
#line 72 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n\r\n"); | |||
#line 75 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
if (job.Value == null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td colspan=\"2\"><em>"); | |||
#line 77 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Strings.Common_JobExpired); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em></td>\r\n"); | |||
#line 78 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td class=\"word-break\">\r\n " + | |||
" "); | |||
#line 82 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Html.JobNameLink(job.Key, job.Value.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"align-right\">\r\n"); | |||
#line 85 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
if (job.Value.DeletedAt.HasValue) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 87 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Html.RelativeTime(job.Value.DeletedAt.Value)); | |||
#line default | |||
#line hidden | |||
#line 87 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
#line 90 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tr>\r\n"); | |||
#line 92 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n </table>\r\n <" + | |||
"/div>\r\n\r\n "); | |||
#line 97 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
Write(Html.Paginator(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 99 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n</div>\r\n\r\n"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,12 +0,0 @@ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
partial class EnqueuedJobsPage | |||
{ | |||
public EnqueuedJobsPage(string queue) | |||
{ | |||
Queue = queue; | |||
} | |||
public string Queue { get; } | |||
} | |||
} |
@@ -1,118 +0,0 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ | |||
@using System.Collections | |||
@using System.Collections.Generic | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@inherits RazorPage | |||
@{ | |||
Layout = new LayoutPage(Queue.ToUpperInvariant()); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue)); | |||
var enqueuedJobs = monitor.EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage); | |||
} | |||
<div class="row"> | |||
<div class="col-md-3"> | |||
@Html.JobsSidebar() | |||
</div> | |||
<div class="col-md-9"> | |||
@Html.Breadcrumbs(Queue.ToUpperInvariant(), new Dictionary<string, string> | |||
{ | |||
{ "Queues", Url.LinkToQueues() } | |||
}) | |||
<h1 class="page-header">@Queue.ToUpperInvariant() <small>@Strings.EnqueuedJobsPage_Title</small></h1> | |||
@if (pager.TotalPageCount == 0) | |||
{ | |||
<div class="alert alert-info"> | |||
@Strings.EnqueuedJobsPage_NoJobs | |||
</div> | |||
} | |||
else | |||
{ | |||
<div class="js-jobs-list"> | |||
<div class="btn-toolbar btn-toolbar-top"> | |||
<button class="js-jobs-list-command btn btn-sm btn-default" | |||
data-url="@Url.To("/jobs/enqueued/delete")" | |||
data-loading-text="@Strings.Common_Deleting" | |||
data-confirm="@Strings.Common_DeleteConfirm" | |||
disabled="disabled"> | |||
<span class="glyphicon glyphicon-remove"></span> | |||
@Strings.Common_DeleteSelected | |||
</button> | |||
@Html.PerPageSelector(pager) | |||
</div> | |||
<div class="table-responsive"> | |||
<table class="table"> | |||
<thead> | |||
<tr> | |||
<th class="min-width"> | |||
<input type="checkbox" class="js-jobs-list-select-all"/> | |||
</th> | |||
<th class="min-width">@Strings.Common_Id</th> | |||
<th class="min-width">@Strings.Common_State</th> | |||
<th>@Strings.Common_Job</th> | |||
<th class="align-right">@Strings.Common_Enqueued</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@foreach (var job in enqueuedJobs) | |||
{ | |||
<tr class="js-jobs-list-row hover @(job.Value == null || !job.Value.InEnqueuedState ? "obsolete-data" : null)"> | |||
<td> | |||
@if (job.Value != null) | |||
{ | |||
<input type="checkbox" class="js-jobs-list-checkbox" name="jobs[]" value="@job.Key"/> | |||
} | |||
</td> | |||
<td class="min-width"> | |||
@Html.JobIdLink(job.Key) | |||
@if (job.Value != null && !job.Value.InEnqueuedState) | |||
{ | |||
<span title="@Strings.Common_JobStateChanged_Text" class="glyphicon glyphicon-question-sign"></span> | |||
} | |||
</td> | |||
@if (job.Value == null) | |||
{ | |||
<td colspan="3"><em>@Strings.Common_JobExpired</em></td> | |||
} | |||
else | |||
{ | |||
<td class="min-width"> | |||
@Html.StateLabel(job.Value.State) | |||
</td> | |||
<td class="word-break"> | |||
@Html.JobNameLink(job.Key, job.Value.Job) | |||
</td> | |||
<td class="align-right"> | |||
@if (job.Value.EnqueuedAt.HasValue) | |||
{ | |||
@Html.RelativeTime(job.Value.EnqueuedAt.Value) | |||
} | |||
else | |||
{ | |||
<em>@Strings.Common_NotAvailable</em> | |||
} | |||
</td> | |||
} | |||
</tr> | |||
} | |||
</tbody> | |||
</table> | |||
</div> | |||
@Html.Paginator(pager) | |||
</div> | |||
} | |||
</div> | |||
</div> |
@@ -1,517 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
using System; | |||
#line 2 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
using System.Collections; | |||
#line default | |||
#line hidden | |||
#line 3 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
using System.Collections.Generic; | |||
#line default | |||
#line hidden | |||
using System.Linq; | |||
using System.Text; | |||
#line 4 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 5 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 6 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class EnqueuedJobsPage : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 8 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Layout = new LayoutPage(Queue.ToUpperInvariant()); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue)); | |||
var enqueuedJobs = monitor.EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "); | |||
#line 23 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Html.JobsSidebar()); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n <div class=\"col-md-9\">\r\n "); | |||
#line 26 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Html.Breadcrumbs(Queue.ToUpperInvariant(), new Dictionary<string, string> | |||
{ | |||
{ "Queues", Url.LinkToQueues() } | |||
})); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n\r\n <h1 class=\"page-header\">"); | |||
#line 31 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Queue.ToUpperInvariant()); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <small>"); | |||
#line 31 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Strings.EnqueuedJobsPage_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</small></h1>\r\n\r\n"); | |||
#line 33 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
if (pager.TotalPageCount == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-info\">\r\n "); | |||
#line 36 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Strings.EnqueuedJobsPage_NoJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 38 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar b" + | |||
"tn-toolbar-top\">\r\n <button class=\"js-jobs-list-command btn bt" + | |||
"n-sm btn-default\"\r\n data-url=\""); | |||
#line 44 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Url.To("/jobs/enqueued/delete")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 45 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Strings.Common_Deleting); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-confirm=\""); | |||
#line 46 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Strings.Common_DeleteConfirm); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n <spa" + | |||
"n class=\"glyphicon glyphicon-remove\"></span>\r\n "); | |||
#line 49 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Strings.Common_DeleteSelected); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n "); | |||
#line 52 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Html.PerPageSelector(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral(@" | |||
</div> | |||
<div class=""table-responsive""> | |||
<table class=""table""> | |||
<thead> | |||
<tr> | |||
<th class=""min-width""> | |||
<input type=""checkbox"" class=""js-jobs-list-select-all""/> | |||
</th> | |||
<th class=""min-width"">"); | |||
#line 62 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Strings.Common_Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"min-width\">"); | |||
#line 63 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Strings.Common_State); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 64 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Strings.Common_Job); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right\">"); | |||
#line 65 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Strings.Common_Enqueued); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n " + | |||
" <tbody>\r\n"); | |||
#line 69 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
foreach (var job in enqueuedJobs) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr class=\"js-jobs-list-row hover "); | |||
#line 71 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(job.Value == null || !job.Value.InEnqueuedState ? "obsolete-data" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <td>\r\n"); | |||
#line 73 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
if (job.Value != null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <input type=\"checkbox\" class=\"js-jobs-lis" + | |||
"t-checkbox\" name=\"jobs[]\" value=\""); | |||
#line 75 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(job.Key); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"/>\r\n"); | |||
#line 76 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <td class=" + | |||
"\"min-width\">\r\n "); | |||
#line 79 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Html.JobIdLink(job.Key)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 80 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
if (job.Value != null && !job.Value.InEnqueuedState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <span title=\""); | |||
#line 82 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Strings.Common_JobStateChanged_Text); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n"); | |||
#line 83 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
#line 85 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
if (job.Value == null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td colspan=\"3\"><em>"); | |||
#line 87 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Strings.Common_JobExpired); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em></td>\r\n"); | |||
#line 88 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td class=\"min-width\">\r\n " + | |||
" "); | |||
#line 92 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Html.StateLabel(job.Value.State)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"word-break\">\r\n " + | |||
" "); | |||
#line 95 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Html.JobNameLink(job.Key, job.Value.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"align-right\">\r\n"); | |||
#line 98 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
if (job.Value.EnqueuedAt.HasValue) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 100 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Html.RelativeTime(job.Value.EnqueuedAt.Value)); | |||
#line default | |||
#line hidden | |||
#line 100 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <em>"); | |||
#line 104 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Strings.Common_NotAvailable); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em>\r\n"); | |||
#line 105 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
#line 107 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tr>\r\n"); | |||
#line 109 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n </table>\r\n <" + | |||
"/div>\r\n\r\n "); | |||
#line 114 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
Write(Html.Paginator(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 116 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n</div>"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,135 +0,0 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ | |||
@using System | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@inherits RazorPage | |||
@{ | |||
Layout = new LayoutPage(Strings.FailedJobsPage_Title); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var pager = new Pager(from, perPage, monitor.FailedCount()); | |||
var failedJobs = monitor.FailedJobs(pager.FromRecord, pager.RecordsPerPage); | |||
} | |||
<div class="row"> | |||
<div class="col-md-3"> | |||
@Html.JobsSidebar() | |||
</div> | |||
<div class="col-md-9"> | |||
<h1 class="page-header">@Strings.FailedJobsPage_Title</h1> | |||
@if (pager.TotalPageCount == 0) | |||
{ | |||
<div class="alert alert-success"> | |||
@Strings.FailedJobsPage_NoJobs | |||
</div> | |||
} | |||
else | |||
{ | |||
<div class="alert alert-warning"> | |||
@Html.Raw(Strings.FailedJobsPage_FailedJobsNotExpire_Warning_Html) | |||
</div> | |||
<div class="js-jobs-list"> | |||
<div class="btn-toolbar btn-toolbar-top"> | |||
<button class="js-jobs-list-command btn btn-sm btn-primary" | |||
data-url="@Url.To("/jobs/failed/requeue")" | |||
data-loading-text="@Strings.Common_Enqueueing" | |||
disabled="disabled"> | |||
<span class="glyphicon glyphicon-repeat"></span> | |||
@Strings.Common_RequeueJobs | |||
</button> | |||
<button class="js-jobs-list-command btn btn-sm btn-default" | |||
data-url="@Url.To("/jobs/failed/delete")" | |||
data-loading-text="@Strings.Common_Deleting" | |||
data-confirm="@Strings.Common_DeleteConfirm"> | |||
<span class="glyphicon glyphicon-remove"></span> | |||
@Strings.Common_DeleteSelected | |||
</button> | |||
@Html.PerPageSelector(pager) | |||
</div> | |||
<div class="table-responsive"> | |||
<table class="table"> | |||
<thead> | |||
<tr> | |||
<th class="min-width"> | |||
<input type="checkbox" class="js-jobs-list-select-all" /> | |||
</th> | |||
<th class="min-width">@Strings.Common_Id</th> | |||
<th>@Strings.FailedJobsPage_Table_Failed</th> | |||
<th>@Strings.Common_Job</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@{ var index = 0; } | |||
@foreach (var job in failedJobs) | |||
{ | |||
<tr class="js-jobs-list-row @(!job.Value.InFailedState ? "obsolete-data" : null) @(job.Value.InFailedState ? "hover" : null)"> | |||
<td rowspan="@(job.Value.InFailedState ? "2" : "1")"> | |||
@if (job.Value.InFailedState) | |||
{ | |||
<input type="checkbox" class="js-jobs-list-checkbox" name="jobs[]" value="@job.Key" /> | |||
} | |||
</td> | |||
<td class="min-width" rowspan="@(job.Value.InFailedState ? "2" : "1")"> | |||
@Html.JobIdLink(job.Key) | |||
@if (!job.Value.InFailedState) | |||
{ | |||
<span title="@Strings.Common_JobStateChanged_Text" class="glyphicon glyphicon-question-sign"></span> | |||
} | |||
</td> | |||
<td class="min-width"> | |||
@if (job.Value.FailedAt.HasValue) | |||
{ | |||
@Html.RelativeTime(job.Value.FailedAt.Value) | |||
} | |||
</td> | |||
<td> | |||
<div class="word-break"> | |||
@Html.JobNameLink(job.Key, job.Value.Job) | |||
</div> | |||
@if (!String.IsNullOrEmpty(job.Value.ExceptionMessage)) | |||
{ | |||
<div style="color: #888;"> | |||
@job.Value.Reason <a class="expander" href="#">@(index == 0 ? Strings.Common_LessDetails : Strings.Common_MoreDetails)</a> | |||
</div> | |||
} | |||
</td> | |||
</tr> | |||
if (job.Value.InFailedState) | |||
{ | |||
<tr> | |||
<td colspan="2" class="failed-job-details"> | |||
<div class="expandable" style="@(index++ == 0 ? "display: block;" : null)"> | |||
<h4>@job.Value.ExceptionType</h4> | |||
<p class="text-muted"> | |||
@job.Value.ExceptionMessage | |||
</p> | |||
@if (!String.IsNullOrEmpty(job.Value.ExceptionDetails)) | |||
{ | |||
<pre class="stack-trace"><code>@Html.StackTrace(job.Value.ExceptionDetails)</code></pre> | |||
} | |||
</div> | |||
</td> | |||
</tr> | |||
} | |||
} | |||
</tbody> | |||
</table> | |||
</div> | |||
@Html.Paginator(pager) | |||
</div> | |||
} | |||
</div> | |||
</div> |
@@ -1,606 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
#line 2 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
using System; | |||
#line default | |||
#line hidden | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
#line 3 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 4 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 5 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class FailedJobsPage : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 7 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Layout = new LayoutPage(Strings.FailedJobsPage_Title); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var pager = new Pager(from, perPage, monitor.FailedCount()); | |||
var failedJobs = monitor.FailedJobs(pager.FromRecord, pager.RecordsPerPage); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "); | |||
#line 22 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Html.JobsSidebar()); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n <div class=\"col-md-9\">\r\n <h1 class=\"page-header\">"); | |||
#line 25 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Strings.FailedJobsPage_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h1>\r\n\r\n"); | |||
#line 27 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
if (pager.TotalPageCount == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-success\">\r\n "); | |||
#line 30 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Strings.FailedJobsPage_NoJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 32 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-warning\">\r\n "); | |||
#line 36 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Html.Raw(Strings.FailedJobsPage_FailedJobsNotExpire_Warning_Html)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 38 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar b" + | |||
"tn-toolbar-top\">\r\n <button class=\"js-jobs-list-command btn bt" + | |||
"n-sm btn-primary\"\r\n data-url=\""); | |||
#line 42 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Url.To("/jobs/failed/requeue")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 43 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Strings.Common_Enqueueing); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n <spa" + | |||
"n class=\"glyphicon glyphicon-repeat\"></span>\r\n "); | |||
#line 46 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Strings.Common_RequeueJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n <button class=\"js-jobs-lis" + | |||
"t-command btn btn-sm btn-default\"\r\n data-url=\""); | |||
#line 50 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Url.To("/jobs/failed/delete")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 51 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Strings.Common_Deleting); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-confirm=\""); | |||
#line 52 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Strings.Common_DeleteConfirm); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <span class=\"glyphicon glyphicon-remove\"></span>\r\n " + | |||
" "); | |||
#line 54 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Strings.Common_DeleteSelected); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n "); | |||
#line 57 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Html.PerPageSelector(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral(@" | |||
</div> | |||
<div class=""table-responsive""> | |||
<table class=""table""> | |||
<thead> | |||
<tr> | |||
<th class=""min-width""> | |||
<input type=""checkbox"" class=""js-jobs-list-select-all"" /> | |||
</th> | |||
<th class=""min-width"">"); | |||
#line 67 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Strings.Common_Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 68 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Strings.FailedJobsPage_Table_Failed); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 69 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Strings.Common_Job); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n " + | |||
" <tbody>\r\n"); | |||
#line 73 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
var index = 0; | |||
#line default | |||
#line hidden | |||
#line 74 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
foreach (var job in failedJobs) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr class=\"js-jobs-list-row "); | |||
#line 76 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(!job.Value.InFailedState ? "obsolete-data" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" "); | |||
#line 76 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(job.Value.InFailedState ? "hover" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <td rowspan=\""); | |||
#line 77 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(job.Value.InFailedState ? "2" : "1"); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n"); | |||
#line 78 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
if (job.Value.InFailedState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <input type=\"checkbox\" class=\"js-jobs" + | |||
"-list-checkbox\" name=\"jobs[]\" value=\""); | |||
#line 80 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(job.Key); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" />\r\n"); | |||
#line 81 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <t" + | |||
"d class=\"min-width\" rowspan=\""); | |||
#line 83 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(job.Value.InFailedState ? "2" : "1"); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n "); | |||
#line 84 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Html.JobIdLink(job.Key)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 85 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
if (!job.Value.InFailedState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <span title=\""); | |||
#line 87 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Strings.Common_JobStateChanged_Text); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n"); | |||
#line 88 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <t" + | |||
"d class=\"min-width\">\r\n"); | |||
#line 91 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
if (job.Value.FailedAt.HasValue) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 93 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Html.RelativeTime(job.Value.FailedAt.Value)); | |||
#line default | |||
#line hidden | |||
#line 93 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <t" + | |||
"d>\r\n <div class=\"word-break\">\r\n " + | |||
" "); | |||
#line 98 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Html.JobNameLink(job.Key, job.Value.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 100 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
if (!String.IsNullOrEmpty(job.Value.ExceptionMessage)) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div style=\"color: #888;\">\r\n " + | |||
" "); | |||
#line 103 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(job.Value.Reason); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <a class=\"expander\" href=\"#\">"); | |||
#line 103 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(index == 0 ? Strings.Common_LessDetails : Strings.Common_MoreDetails); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</a>\r\n </div>\r\n"); | |||
#line 105 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n </tr>\r" + | |||
"\n"); | |||
#line 108 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
if (job.Value.InFailedState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr>\r\n " + | |||
" <td colspan=\"2\" class=\"failed-job-details\">\r\n " + | |||
" <div class=\"expandable\" style=\""); | |||
#line 112 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(index++ == 0 ? "display: block;" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <h4>"); | |||
#line 113 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(job.Value.ExceptionType); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h4>\r\n <p class=\"text-muted\">\r\n " + | |||
" "); | |||
#line 115 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(job.Value.ExceptionMessage); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </p>\r\n\r\n"); | |||
#line 118 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
if (!String.IsNullOrEmpty(job.Value.ExceptionDetails)) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <pre class=\"stack-trace\"><cod" + | |||
"e>"); | |||
#line 120 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Html.StackTrace(job.Value.ExceptionDetails)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</code></pre>\r\n"); | |||
#line 121 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n " + | |||
" </td>\r\n </tr>\r\n"); | |||
#line 125 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
} | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n </table>\r\n <" + | |||
"/div>\r\n\r\n "); | |||
#line 131 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
Write(Html.Paginator(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 133 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n</div>"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,12 +0,0 @@ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
partial class FetchedJobsPage | |||
{ | |||
public FetchedJobsPage(string queue) | |||
{ | |||
Queue = queue; | |||
} | |||
public string Queue { get; } | |||
} | |||
} |
@@ -1,121 +0,0 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ | |||
@using System.Collections | |||
@using System.Collections.Generic | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@inherits RazorPage | |||
@{ | |||
Layout = new LayoutPage(Queue.ToUpperInvariant()); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var pager = new Pager(from, perPage, monitor.FetchedCount(Queue)); | |||
var fetchedJobs = monitor.FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage); | |||
} | |||
<div class="row"> | |||
<div class="col-md-3"> | |||
@Html.JobsSidebar() | |||
</div> | |||
<div class="col-md-9"> | |||
@Html.Breadcrumbs(Strings.FetchedJobsPage_Title, new Dictionary<string, string> | |||
{ | |||
{ "Queues", Url.LinkToQueues() }, | |||
{ Queue.ToUpperInvariant(), Url.Queue(Queue) } | |||
}) | |||
<h1 class="page-header"> | |||
@Queue.ToUpperInvariant() <small>@Strings.FetchedJobsPage_Title</small> | |||
</h1> | |||
@if (pager.TotalPageCount == 0) | |||
{ | |||
<div class="alert alert-info"> | |||
@Strings.FetchedJobsPage_NoJobs | |||
</div> | |||
} | |||
else | |||
{ | |||
<div class="js-jobs-list"> | |||
<div class="btn-toolbar btn-toolbar-top"> | |||
<button class="js-jobs-list-command btn btn-sm btn-primary" | |||
data-url="@Url.To("/jobs/enqueued/requeue")" | |||
data-loading-text="@Strings.Common_Enqueueing" | |||
disabled="disabled"> | |||
<span class="glyphicon glyphicon-repeat"></span> | |||
@Strings.Common_RequeueJobs | |||
</button> | |||
<button class="js-jobs-list-command btn btn-sm btn-default" | |||
data-url="@Url.To("/jobs/enqueued/delete")" | |||
data-loading-text="@Strings.Common_Deleting" | |||
data-confirm="@Strings.Common_DeleteConfirm" | |||
disabled="disabled"> | |||
<span class="glyphicon glyphicon-remove"></span> | |||
@Strings.Common_DeleteSelected | |||
</button> | |||
@Html.PerPageSelector(pager) | |||
</div> | |||
<div class="table-responsive"> | |||
<table class="table"> | |||
<thead> | |||
<tr> | |||
<th class="min-width"> | |||
<input type="checkbox" class="js-jobs-list-select-all" /> | |||
</th> | |||
<th class="min-width">@Strings.Common_Id</th> | |||
<th class="min-width">@Strings.Common_State</th> | |||
<th>@Strings.Common_Job</th> | |||
<th class="align-right">@Strings.Common_Fetched</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@foreach (var job in fetchedJobs) | |||
{ | |||
<tr class="js-jobs-list-row hover @(job.Value == null ? "obsolete-data" : null)"> | |||
<td> | |||
@if (job.Value != null) | |||
{ | |||
<input type="checkbox" class="js-jobs-list-checkbox" name="jobs[]" value="@job.Key" /> | |||
} | |||
</td> | |||
<td class="min-width"> | |||
@Html.JobIdLink(job.Key) | |||
</td> | |||
@if (job.Value == null) | |||
{ | |||
<td colspan="3"><em>@Strings.Common_JobExpired</em></td> | |||
} | |||
else | |||
{ | |||
<td class="min-width"> | |||
@Html.StateLabel(job.Value.State) | |||
</td> | |||
<td class="word-break"> | |||
@Html.JobNameLink(job.Key, job.Value.Job) | |||
</td> | |||
<td class="align-right"> | |||
@if (job.Value.FetchedAt.HasValue) | |||
{ | |||
@Html.RelativeTime(job.Value.FetchedAt.Value) | |||
} | |||
</td> | |||
} | |||
</tr> | |||
} | |||
</tbody> | |||
</table> | |||
</div> | |||
@Html.Paginator(pager) | |||
</div> | |||
} | |||
</div> | |||
</div> |
@@ -1,497 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
using System; | |||
#line 2 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
using System.Collections; | |||
#line default | |||
#line hidden | |||
#line 3 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
using System.Collections.Generic; | |||
#line default | |||
#line hidden | |||
using System.Linq; | |||
using System.Text; | |||
#line 4 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 5 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 6 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class FetchedJobsPage : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 8 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Layout = new LayoutPage(Queue.ToUpperInvariant()); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var pager = new Pager(from, perPage, monitor.FetchedCount(Queue)); | |||
var fetchedJobs = monitor.FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "); | |||
#line 23 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Html.JobsSidebar()); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n <div class=\"col-md-9\">\r\n "); | |||
#line 26 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Html.Breadcrumbs(Strings.FetchedJobsPage_Title, new Dictionary<string, string> | |||
{ | |||
{ "Queues", Url.LinkToQueues() }, | |||
{ Queue.ToUpperInvariant(), Url.Queue(Queue) } | |||
})); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n\r\n <h1 class=\"page-header\">\r\n "); | |||
#line 33 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Queue.ToUpperInvariant()); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <small>"); | |||
#line 33 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Strings.FetchedJobsPage_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</small>\r\n </h1>\r\n\r\n"); | |||
#line 36 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
if (pager.TotalPageCount == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-info\">\r\n "); | |||
#line 39 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Strings.FetchedJobsPage_NoJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 41 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar btn-toolb" + | |||
"ar-top\">\r\n <button class=\"js-jobs-list-command btn btn-sm btn-pri" + | |||
"mary\"\r\n data-url=\""); | |||
#line 47 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Url.To("/jobs/enqueued/requeue")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 48 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Strings.Common_Enqueueing); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n <span class=" + | |||
"\"glyphicon glyphicon-repeat\"></span>\r\n "); | |||
#line 51 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Strings.Common_RequeueJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n <button class=\"js-jobs-list-comman" + | |||
"d btn btn-sm btn-default\"\r\n data-url=\""); | |||
#line 55 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Url.To("/jobs/enqueued/delete")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 56 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Strings.Common_Deleting); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-confirm=\""); | |||
#line 57 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Strings.Common_DeleteConfirm); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n <span class=" + | |||
"\"glyphicon glyphicon-remove\"></span>\r\n "); | |||
#line 60 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Strings.Common_DeleteSelected); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n "); | |||
#line 63 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Html.PerPageSelector(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral(@" | |||
</div> | |||
<div class=""table-responsive""> | |||
<table class=""table""> | |||
<thead> | |||
<tr> | |||
<th class=""min-width""> | |||
<input type=""checkbox"" class=""js-jobs-list-select-all"" /> | |||
</th> | |||
<th class=""min-width"">"); | |||
#line 73 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Strings.Common_Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"min-width\">"); | |||
#line 74 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Strings.Common_State); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 75 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Strings.Common_Job); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right\">"); | |||
#line 76 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Strings.Common_Fetched); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n " + | |||
" <tbody>\r\n"); | |||
#line 80 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
foreach (var job in fetchedJobs) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr class=\"js-jobs-list-row hover "); | |||
#line 82 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(job.Value == null ? "obsolete-data" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <td>\r\n"); | |||
#line 84 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
if (job.Value != null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <input type=\"checkbox\" class=\"js-jobs-lis" + | |||
"t-checkbox\" name=\"jobs[]\" value=\""); | |||
#line 86 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(job.Key); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" />\r\n"); | |||
#line 87 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <td class=" + | |||
"\"min-width\">\r\n "); | |||
#line 90 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Html.JobIdLink(job.Key)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
#line 92 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
if (job.Value == null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td colspan=\"3\"><em>"); | |||
#line 94 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Strings.Common_JobExpired); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em></td>\r\n"); | |||
#line 95 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td class=\"min-width\">\r\n " + | |||
" "); | |||
#line 99 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Html.StateLabel(job.Value.State)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"word-break\">\r\n " + | |||
" "); | |||
#line 102 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Html.JobNameLink(job.Key, job.Value.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"align-right\">\r\n"); | |||
#line 105 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
if (job.Value.FetchedAt.HasValue) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 107 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Html.RelativeTime(job.Value.FetchedAt.Value)); | |||
#line default | |||
#line hidden | |||
#line 107 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
#line 110 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tr>\r\n"); | |||
#line 112 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n </table>\r\n </div>\r\n\r\n " + | |||
" "); | |||
#line 117 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
Write(Html.Paginator(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 119 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n</div>"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,15 +0,0 @@ | |||
using Hangfire.Annotations; | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
partial class JobDetailsPage | |||
{ | |||
public JobDetailsPage(string jobId) | |||
{ | |||
JobId = jobId; | |||
} | |||
public string JobId { get; } | |||
} | |||
} |
@@ -1,211 +0,0 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ | |||
@using System | |||
@using System.Collections.Generic | |||
@using System.Linq | |||
@using Hangfire | |||
@using Hangfire.Common | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@using Hangfire.States | |||
@using Hangfire.Storage | |||
@using Hangfire.Storage.Monitoring | |||
@inherits RazorPage | |||
@{ | |||
var monitor = Storage.GetMonitoringApi(); | |||
var job = monitor.JobDetails(JobId); | |||
string title = null; | |||
if (job != null) | |||
{ | |||
title = job.Job != null ? Html.JobName(job.Job) : null; | |||
job.History.Add(new StateHistoryDto { StateName = "Created", CreatedAt = job.CreatedAt ?? default(DateTime) }); | |||
} | |||
title = title ?? Strings.Common_Job; | |||
Layout = new LayoutPage(title); | |||
} | |||
<div class="row"> | |||
<div class="col-md-3"> | |||
@Html.JobsSidebar() | |||
</div> | |||
<div class="col-md-9"> | |||
<h1 class="page-header">@title</h1> | |||
@if (job == null) | |||
{ | |||
<div class="alert alert-warning"> | |||
@String.Format(Strings.JobDetailsPage_JobExpired, JobId) | |||
</div> | |||
} | |||
else | |||
{ | |||
var currentState = job.History[0]; | |||
if (currentState.StateName == ProcessingState.StateName) | |||
{ | |||
var server = monitor.Servers().FirstOrDefault(x => x.Name == currentState.Data["ServerId"]); | |||
if (server == null) | |||
{ | |||
<div class="alert alert-danger"> | |||
@Html.Raw(String.Format(Strings.JobDetailsPage_JobAbortedNotActive_Warning_Html, currentState.Data["ServerId"], Url.To("/servers"))) | |||
</div> | |||
} | |||
else if (server.Heartbeat.HasValue && server.Heartbeat < DateTime.UtcNow.AddMinutes(-1)) | |||
{ | |||
<div class="alert alert-warning"> | |||
@Html.Raw(String.Format(Strings.JobDetailsPage_JobAbortedWithHeartbeat_Warning_Html, server.Name)) | |||
</div> | |||
} | |||
} | |||
if (job.ExpireAt.HasValue) | |||
{ | |||
<div class="alert alert-info"> | |||
@Html.Raw(String.Format(Strings.JobDetailsPage_JobFinished_Warning_Html, JobHelper.ToTimestamp(job.ExpireAt.Value), job.ExpireAt)) | |||
</div> | |||
} | |||
<div class="job-snippet"> | |||
<div class="job-snippet-code"> | |||
<pre><code><span class="comment">// @Strings.JobDetailsPage_JobId: @Html.JobId(JobId.ToString(), false)</span> | |||
@JobMethodCallRenderer.Render(job.Job) | |||
</code></pre> | |||
</div> | |||
@if (job.Properties.Count > 0) | |||
{ | |||
<div class="job-snippet-properties"> | |||
<dl> | |||
@foreach (var property in job.Properties.Where(x => x.Key != "Continuations")) | |||
{ | |||
<dt>@property.Key</dt> | |||
<dd><pre><code>@property.Value</code></pre></dd> | |||
} | |||
</dl> | |||
</div> | |||
} | |||
</div> | |||
if (job.Properties.ContainsKey("Continuations")) | |||
{ | |||
List<ContinuationsSupportAttribute.Continuation> continuations; | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
continuations = JobHelper.FromJson<List<ContinuationsSupportAttribute.Continuation>>(connection.GetJobParameter( | |||
JobId, "Continuations")) ?? new List<ContinuationsSupportAttribute.Continuation>(); | |||
} | |||
if (continuations.Count > 0) | |||
{ | |||
<h3>@Strings.Common_Continuations</h3> | |||
<div class="table-responsive"> | |||
<table class="table"> | |||
<thead> | |||
<tr> | |||
<th class="min-width">@Strings.Common_Id</th> | |||
<th class="min-width">@Strings.Common_Condition</th> | |||
<th class="min-width">@Strings.Common_State</th> | |||
<th>@Strings.Common_Job</th> | |||
<th class="align-right">@Strings.Common_Created</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@foreach (var continuation in continuations) | |||
{ | |||
JobData jobData; | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
jobData = connection.GetJobData(continuation.JobId); | |||
} | |||
<tr> | |||
@if (jobData == null) | |||
{ | |||
<td colspan="5"><em>@String.Format(Strings.JobDetailsPage_JobExpired, continuation.JobId)</em></td> | |||
} | |||
else | |||
{ | |||
<td class="min-width">@Html.JobIdLink(continuation.JobId)</td> | |||
<td class="min-width"><code>@continuation.Options.ToString("G")</code></td> | |||
<td class="min-width">@Html.StateLabel(jobData.State)</td> | |||
<td class="word-break">@Html.JobNameLink(continuation.JobId, jobData.Job)</td> | |||
<td class="align-right">@Html.RelativeTime(jobData.CreatedAt)</td> | |||
} | |||
</tr> | |||
} | |||
</tbody> | |||
</table> | |||
</div> | |||
} | |||
} | |||
<h3> | |||
@if (job.History.Count > 1) | |||
{ | |||
<span class="job-snippet-buttons pull-right"> | |||
<button class="btn btn-sm btn-default" data-ajax="@Url.To("/jobs/actions/requeue/" + JobId)" data-loading-text="@Strings.Common_Enqueueing">@Strings.JobDetailsPage_Requeue</button> | |||
<button class="btn btn-sm btn-death" data-ajax="@Url.To("/jobs/actions/delete/" + JobId)" data-loading-text="@Strings.Common_Deleting" data-confirm="@Strings.JobDetailsPage_DeleteConfirm">@Strings.Common_Delete</button> | |||
</span> | |||
} | |||
@Strings.JobDetailsPage_State | |||
</h3> | |||
var index = 0; | |||
foreach (var entry in job.History) | |||
{ | |||
var accentColor = JobHistoryRenderer.GetForegroundStateColor(entry.StateName); | |||
var backgroundColor = JobHistoryRenderer.GetBackgroundStateColor(entry.StateName); | |||
<div class="state-card" style="@(index == 0 ? $"border-color: {accentColor}" : null)"> | |||
<h4 class="state-card-title" style="@(index == 0 ? $"color: {accentColor}" : null)"> | |||
<small class="pull-right text-muted"> | |||
@if (index == job.History.Count - 1) | |||
{ | |||
@Html.RelativeTime(entry.CreatedAt) | |||
} | |||
else | |||
{ | |||
var duration = Html.ToHumanDuration(entry.CreatedAt - job.History[index + 1].CreatedAt); | |||
if (index == 0) | |||
{ | |||
@: @Html.RelativeTime(entry.CreatedAt) (@duration) | |||
} | |||
else | |||
{ | |||
@: @Html.MomentTitle(entry.CreatedAt, duration) | |||
} | |||
} | |||
</small> | |||
@entry.StateName | |||
</h4> | |||
@if (!String.IsNullOrWhiteSpace(entry.Reason)) | |||
{ | |||
<p class="state-card-text text-muted">@entry.Reason</p> | |||
} | |||
@{ | |||
var rendered = Html.RenderHistory(entry.StateName, entry.Data); | |||
} | |||
@if (rendered != null) | |||
{ | |||
<div class="state-card-body" style="@(index == 0 ? $"background-color: {backgroundColor}" : null)"> | |||
@rendered | |||
</div> | |||
} | |||
</div> | |||
index++; | |||
} | |||
} | |||
</div> | |||
</div> |
@@ -1,932 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
#line 2 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
using System; | |||
#line default | |||
#line hidden | |||
#line 3 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
using System.Collections.Generic; | |||
#line default | |||
#line hidden | |||
#line 4 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
using System.Linq; | |||
#line default | |||
#line hidden | |||
using System.Text; | |||
#line 5 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
using Hangfire; | |||
#line default | |||
#line hidden | |||
#line 6 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
using Hangfire.Common; | |||
#line default | |||
#line hidden | |||
#line 7 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 8 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 9 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
#line 10 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
using Hangfire.States; | |||
#line default | |||
#line hidden | |||
#line 11 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
using Hangfire.Storage; | |||
#line default | |||
#line hidden | |||
#line 12 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
using Hangfire.Storage.Monitoring; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class JobDetailsPage : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 14 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
var monitor = Storage.GetMonitoringApi(); | |||
var job = monitor.JobDetails(JobId); | |||
string title = null; | |||
if (job != null) | |||
{ | |||
title = job.Job != null ? Html.JobName(job.Job) : null; | |||
job.History.Add(new StateHistoryDto { StateName = "Created", CreatedAt = job.CreatedAt ?? default(DateTime) }); | |||
} | |||
title = title ?? Strings.Common_Job; | |||
Layout = new LayoutPage(title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "); | |||
#line 32 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Html.JobsSidebar()); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n <div class=\"col-md-9\">\r\n <h1 class=\"page-header\">"); | |||
#line 35 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h1>\r\n\r\n"); | |||
#line 37 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
if (job == null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-warning\">\r\n "); | |||
#line 40 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(String.Format(Strings.JobDetailsPage_JobExpired, JobId)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 42 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
else | |||
{ | |||
var currentState = job.History[0]; | |||
if (currentState.StateName == ProcessingState.StateName) | |||
{ | |||
var server = monitor.Servers().FirstOrDefault(x => x.Name == currentState.Data["ServerId"]); | |||
if (server == null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-danger\">\r\n "); | |||
#line 52 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Html.Raw(String.Format(Strings.JobDetailsPage_JobAbortedNotActive_Warning_Html, currentState.Data["ServerId"], Url.To("/servers")))); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 54 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
else if (server.Heartbeat.HasValue && server.Heartbeat < DateTime.UtcNow.AddMinutes(-1)) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-warning\">\r\n "); | |||
#line 58 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Html.Raw(String.Format(Strings.JobDetailsPage_JobAbortedWithHeartbeat_Warning_Html, server.Name))); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 60 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
} | |||
if (job.ExpireAt.HasValue) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-info\">\r\n "); | |||
#line 66 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Html.Raw(String.Format(Strings.JobDetailsPage_JobFinished_Warning_Html, JobHelper.ToTimestamp(job.ExpireAt.Value), job.ExpireAt))); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 68 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"job-snippet\">\r\n <div class=\"job-snippet-co" + | |||
"de\">\r\n <pre><code><span class=\"comment\">// "); | |||
#line 72 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.JobDetailsPage_JobId); | |||
#line default | |||
#line hidden | |||
WriteLiteral(": "); | |||
#line 72 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Html.JobId(JobId.ToString(), false)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</span>\r\n"); | |||
#line 73 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(JobMethodCallRenderer.Render(job.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n</code></pre>\r\n </div>\r\n\r\n"); | |||
#line 77 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
if (job.Properties.Count > 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"job-snippet-properties\">\r\n " + | |||
" <dl>\r\n"); | |||
#line 81 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
foreach (var property in job.Properties.Where(x => x.Key != "Continuations")) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <dt>"); | |||
#line 83 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(property.Key); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</dt>\r\n"); | |||
WriteLiteral(" <dd><pre><code>"); | |||
#line 84 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(property.Value); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</code></pre></dd>\r\n"); | |||
#line 85 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </dl>\r\n </div>\r\n"); | |||
#line 88 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n"); | |||
#line 90 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
if (job.Properties.ContainsKey("Continuations")) | |||
{ | |||
List<ContinuationsSupportAttribute.Continuation> continuations; | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
continuations = JobHelper.FromJson<List<ContinuationsSupportAttribute.Continuation>>(connection.GetJobParameter( | |||
JobId, "Continuations")) ?? new List<ContinuationsSupportAttribute.Continuation>(); | |||
} | |||
if (continuations.Count > 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <h3>"); | |||
#line 103 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.Common_Continuations); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h3>\r\n"); | |||
WriteLiteral(" <div class=\"table-responsive\">\r\n <tabl" + | |||
"e class=\"table\">\r\n <thead>\r\n " + | |||
" <tr>\r\n <th class=\"min-width\">"); | |||
#line 108 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.Common_Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"min-width\">"); | |||
#line 109 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.Common_Condition); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"min-width\">"); | |||
#line 110 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.Common_State); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 111 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.Common_Job); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right\">"); | |||
#line 112 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.Common_Created); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n " + | |||
" <tbody>\r\n"); | |||
#line 116 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
foreach (var continuation in continuations) | |||
{ | |||
JobData jobData; | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
jobData = connection.GetJobData(continuation.JobId); | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr>\r\n"); | |||
#line 126 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
if (jobData == null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td colspan=\"5\"><em>"); | |||
#line 128 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(String.Format(Strings.JobDetailsPage_JobExpired, continuation.JobId)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em></td>\r\n"); | |||
#line 129 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td class=\"min-width\">"); | |||
#line 132 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Html.JobIdLink(continuation.JobId)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</td>\r\n"); | |||
WriteLiteral(" <td class=\"min-width\"><code>"); | |||
#line 133 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(continuation.Options.ToString("G")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</code></td>\r\n"); | |||
WriteLiteral(" <td class=\"min-width\">"); | |||
#line 134 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Html.StateLabel(jobData.State)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</td>\r\n"); | |||
WriteLiteral(" <td class=\"word-break\">"); | |||
#line 135 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Html.JobNameLink(continuation.JobId, jobData.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</td>\r\n"); | |||
WriteLiteral(" <td class=\"align-right\">"); | |||
#line 136 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Html.RelativeTime(jobData.CreatedAt)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</td>\r\n"); | |||
#line 137 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tr>\r\n"); | |||
#line 139 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n </table>\r\n " + | |||
" </div>\r\n"); | |||
#line 143 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <h3>\r\n"); | |||
#line 147 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
if (job.History.Count > 1) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <span class=\"job-snippet-buttons pull-right\">\r\n " + | |||
" <button class=\"btn btn-sm btn-default\" data-ajax=\""); | |||
#line 150 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Url.To("/jobs/actions/requeue/" + JobId)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" data-loading-text=\""); | |||
#line 150 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.Common_Enqueueing); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">"); | |||
#line 150 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.JobDetailsPage_Requeue); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</button>\r\n <button class=\"btn btn-sm btn-death\" data-ajax" + | |||
"=\""); | |||
#line 151 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Url.To("/jobs/actions/delete/" + JobId)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" data-loading-text=\""); | |||
#line 151 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.Common_Deleting); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" data-confirm=\""); | |||
#line 151 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.JobDetailsPage_DeleteConfirm); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">"); | |||
#line 151 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.Common_Delete); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</button>\r\n </span>\r\n"); | |||
#line 153 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n "); | |||
#line 155 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Strings.JobDetailsPage_State); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </h3>\r\n"); | |||
#line 157 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
var index = 0; | |||
foreach (var entry in job.History) | |||
{ | |||
var accentColor = JobHistoryRenderer.GetForegroundStateColor(entry.StateName); | |||
var backgroundColor = JobHistoryRenderer.GetBackgroundStateColor(entry.StateName); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"state-card\" style=\""); | |||
#line 165 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(index == 0 ? $"border-color: {accentColor}" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <h4 class=\"state-card-title\" style=\""); | |||
#line 166 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(index == 0 ? $"color: {accentColor}" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <small class=\"pull-right text-muted\">\r\n"); | |||
#line 168 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
if (index == job.History.Count - 1) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 170 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Html.RelativeTime(entry.CreatedAt)); | |||
#line default | |||
#line hidden | |||
#line 170 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
else | |||
{ | |||
var duration = Html.ToHumanDuration(entry.CreatedAt - job.History[index + 1].CreatedAt); | |||
if (index == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" "); | |||
WriteLiteral(" "); | |||
#line 178 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Html.RelativeTime(entry.CreatedAt)); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" ("); | |||
#line 178 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(duration); | |||
#line default | |||
#line hidden | |||
WriteLiteral(")\r\n"); | |||
#line 179 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" "); | |||
WriteLiteral(" "); | |||
#line 182 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(Html.MomentTitle(entry.CreatedAt, duration)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 183 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </small>\r\n\r\n "); | |||
#line 187 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(entry.StateName); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </h4>\r\n\r\n"); | |||
#line 190 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
if (!String.IsNullOrWhiteSpace(entry.Reason)) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <p class=\"state-card-text text-muted\">"); | |||
#line 192 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(entry.Reason); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</p>\r\n"); | |||
#line 193 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 195 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
var rendered = Html.RenderHistory(entry.StateName, entry.Data); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 199 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
if (rendered != null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"state-card-body\" style=\""); | |||
#line 201 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(index == 0 ? $"background-color: {backgroundColor}" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n "); | |||
#line 202 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
Write(rendered); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 204 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n"); | |||
#line 206 "..\..\Dashboard\Pages\JobDetailsPage.cshtml" | |||
index++; | |||
} | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n</div>"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,544 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
#line 2 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
using System; | |||
#line default | |||
#line hidden | |||
using System.Collections.Generic; | |||
#line 3 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
using System.Linq; | |||
#line default | |||
#line hidden | |||
using System.Text; | |||
#line 4 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 5 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 6 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class ProcessingJobsPage : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 8 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Layout = new LayoutPage(Strings.ProcessingJobsPage_Title); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var pager = new Pager(from, perPage, monitor.ProcessingCount()); | |||
var processingJobs = monitor.ProcessingJobs(pager.FromRecord, pager.RecordsPerPage); | |||
var servers = monitor.Servers(); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "); | |||
#line 24 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Html.JobsSidebar()); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n <div class=\"col-md-9\">\r\n <h1 class=\"page-header\">"); | |||
#line 27 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.ProcessingJobsPage_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h1>\r\n\r\n"); | |||
#line 29 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
if (pager.TotalPageCount == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-info\">\r\n "); | |||
#line 32 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.ProcessingJobsPage_NoJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 34 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar b" + | |||
"tn-toolbar-top\">\r\n <button class=\"js-jobs-list-command btn bt" + | |||
"n-sm btn-primary\"\r\n data-url=\""); | |||
#line 40 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Url.To("/jobs/processing/requeue")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 41 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.Common_Enqueueing); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n <spa" + | |||
"n class=\"glyphicon glyphicon-repeat\"></span>\r\n "); | |||
#line 44 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.Common_RequeueJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n <button class=\"js-jobs-lis" + | |||
"t-command btn btn-sm btn-default\"\r\n data-url=\""); | |||
#line 48 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Url.To("/jobs/processing/delete")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 49 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.Common_Deleting); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-confirm=\""); | |||
#line 50 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.Common_DeleteConfirm); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n <spa" + | |||
"n class=\"glyphicon glyphicon-remove\"></span>\r\n "); | |||
#line 53 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.Common_DeleteSelected); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n "); | |||
#line 56 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Html.PerPageSelector(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral(@" | |||
</div> | |||
<div class=""table-responsive""> | |||
<table class=""table""> | |||
<thead> | |||
<tr> | |||
<th class=""min-width""> | |||
<input type=""checkbox"" class=""js-jobs-list-select-all"" /> | |||
</th> | |||
<th class=""min-width"">"); | |||
#line 66 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.Common_Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"min-width\">"); | |||
#line 67 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.Common_Server); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 68 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.Common_Job); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right\">"); | |||
#line 69 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.ProcessingJobsPage_Table_Started); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n " + | |||
" <tbody>\r\n"); | |||
#line 73 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
foreach (var job in processingJobs) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr class=\"js-jobs-list-row "); | |||
#line 75 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(!job.Value.InProcessingState ? "obsolete-data" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" "); | |||
#line 75 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(job.Value.InProcessingState ? "hover" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <td>\r\n"); | |||
#line 77 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
if (job.Value.InProcessingState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <input type=\"checkbox\" class=\"js-jobs" + | |||
"-list-checkbox\" name=\"jobs[]\" value=\""); | |||
#line 79 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(job.Key); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" />\r\n"); | |||
#line 80 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <t" + | |||
"d class=\"min-width\">\r\n "); | |||
#line 83 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Html.JobIdLink(job.Key)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 84 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
if (!job.Value.InProcessingState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <span title=\""); | |||
#line 86 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.Common_JobStateChanged_Text); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n"); | |||
#line 87 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
#line 89 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
if (!job.Value.InProcessingState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td colspan=\"3\">"); | |||
#line 91 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.Common_JobStateChanged_Text); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</td>\r\n"); | |||
#line 92 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td class=\"min-width\">\r\n " + | |||
" "); | |||
#line 96 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Html.ServerId(job.Value.ServerId)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"word-break\">\r\n"); | |||
#line 99 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
if (servers.All(x => x.Name != job.Value.ServerId || x.Heartbeat < DateTime.UtcNow.AddMinutes(-1))) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <span title=\""); | |||
#line 101 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Strings.ProcessingJobsPage_Aborted); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" class=\"glyphicon glyphicon-warning-sign\" style=\"font-size: 10px;\"></span>\r\n"); | |||
#line 102 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n "); | |||
#line 104 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Html.JobNameLink(job.Key, job.Value.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"align-right\">\r\n"); | |||
#line 107 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
if (job.Value.StartedAt.HasValue) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 109 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Html.RelativeTime(job.Value.StartedAt.Value)); | |||
#line default | |||
#line hidden | |||
#line 109 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
#line 112 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tr>\r\n"); | |||
#line 114 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n </table>\r\n <" + | |||
"/div>\r\n\r\n "); | |||
#line 119 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
Write(Html.Paginator(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 121 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n</div>"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,122 +0,0 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ | |||
@using System.Linq | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@inherits RazorPage | |||
@{ | |||
Layout = new LayoutPage(Strings.QueuesPage_Title); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var queues = monitor.Queues(); | |||
} | |||
<div class="row"> | |||
<div class="col-md-3"> | |||
@Html.JobsSidebar() | |||
</div> | |||
<div class="col-md-9"> | |||
<h1 class="page-header">@Strings.QueuesPage_Title</h1> | |||
@if (queues.Count == 0) | |||
{ | |||
<div class="alert alert-warning"> | |||
@Strings.QueuesPage_NoQueues | |||
</div> | |||
} | |||
else | |||
{ | |||
<div class="table-responsive"> | |||
<table class="table table-striped"> | |||
<thead> | |||
<tr> | |||
<th style="min-width: 200px;">@Strings.QueuesPage_Table_Queue</th> | |||
<th>@Strings.QueuesPage_Table_Length</th> | |||
<th>@Strings.Common_Fetched</th> | |||
<th>@Strings.QueuesPage_Table_NextsJobs</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@foreach (var queue in queues) | |||
{ | |||
<tr> | |||
<td>@Html.QueueLabel(queue.Name)</td> | |||
<td>@queue.Length</td> | |||
<td> | |||
@if (queue.Fetched.HasValue) | |||
{ | |||
<a href="@Url.To("/jobs/enqueued/fetched/" + queue.Name)"> | |||
@queue.Fetched | |||
</a> | |||
} | |||
else | |||
{ | |||
<em>@Strings.Common_NotAvailable</em> | |||
} | |||
</td> | |||
<td> | |||
@if (queue.FirstJobs.Count == 0) | |||
{ | |||
<em> | |||
@Strings.QueuesPage_NoJobs | |||
</em> | |||
} | |||
else | |||
{ | |||
<table class="table table-condensed table-inner"> | |||
<thead> | |||
<tr> | |||
<th class="min-width">@Strings.Common_Id</th> | |||
<th class="min-width">@Strings.Common_State</th> | |||
<th>@Strings.Common_Job</th> | |||
<th class="align-right min-width">@Strings.Common_Enqueued</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@foreach (var job in queue.FirstJobs) | |||
{ | |||
<tr class="@(job.Value == null || !job.Value.InEnqueuedState ? "obsolete-data" : null)"> | |||
<td class="min-width"> | |||
@Html.JobIdLink(job.Key) | |||
@if (job.Value != null && !job.Value.InEnqueuedState) | |||
{ | |||
<span title="@Strings.Common_JobStateChanged_Text" class="glyphicon glyphicon-question-sign"></span> | |||
} | |||
</td> | |||
@if (job.Value == null) | |||
{ | |||
<td colspan="3"><em>@Strings.Common_JobExpired</em></td> | |||
} | |||
else | |||
{ | |||
<td class="min-width"> | |||
@Html.StateLabel(job.Value.State) | |||
</td> | |||
<td class="word-break"> | |||
@Html.JobNameLink(job.Key, job.Value.Job) | |||
</td> | |||
<td class="align-right min-width"> | |||
@if (job.Value.EnqueuedAt.HasValue) | |||
{ | |||
@Html.RelativeTime(job.Value.EnqueuedAt.Value) | |||
} | |||
else | |||
{ | |||
<em>@Strings.Common_NotAvailable</em> | |||
} | |||
</td> | |||
} | |||
</tr> | |||
} | |||
</tbody> | |||
</table> | |||
} | |||
</td> | |||
</tr> | |||
} | |||
</tbody> | |||
</table> | |||
</div> | |||
} | |||
</div> | |||
</div> |
@@ -1,574 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
using System; | |||
using System.Collections.Generic; | |||
#line 2 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
using System.Linq; | |||
#line default | |||
#line hidden | |||
using System.Text; | |||
#line 3 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 4 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 5 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class QueuesPage : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 7 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Layout = new LayoutPage(Strings.QueuesPage_Title); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var queues = monitor.Queues(); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "); | |||
#line 16 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Html.JobsSidebar()); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n <div class=\"col-md-9\">\r\n <h1 class=\"page-header\">"); | |||
#line 19 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.QueuesPage_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h1>\r\n\r\n"); | |||
#line 21 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
if (queues.Count == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-warning\">\r\n "); | |||
#line 24 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.QueuesPage_NoQueues); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 26 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"table-responsive\">\r\n <table class=\"table t" + | |||
"able-striped\">\r\n <thead>\r\n <tr>\r\n " + | |||
" <th style=\"min-width: 200px;\">"); | |||
#line 33 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.QueuesPage_Table_Queue); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 34 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.QueuesPage_Table_Length); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 35 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.Common_Fetched); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 36 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.QueuesPage_Table_NextsJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n " + | |||
" <tbody>\r\n"); | |||
#line 40 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
foreach (var queue in queues) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr>\r\n <td>"); | |||
#line 43 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Html.QueueLabel(queue.Name)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</td>\r\n <td>"); | |||
#line 44 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(queue.Length); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</td>\r\n <td>\r\n"); | |||
#line 46 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
if (queue.Fetched.HasValue) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <a href=\""); | |||
#line 48 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Url.To("/jobs/enqueued/fetched/" + queue.Name)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n "); | |||
#line 49 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(queue.Fetched); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </a>\r\n"); | |||
#line 51 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <em>"); | |||
#line 54 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.Common_NotAvailable); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em>\r\n"); | |||
#line 55 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <td>\r\n"); | |||
#line 58 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
if (queue.FirstJobs.Count == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <em>\r\n " + | |||
" "); | |||
#line 61 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.QueuesPage_NoJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </em>\r\n"); | |||
#line 63 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(@" <table class=""table table-condensed table-inner""> | |||
<thead> | |||
<tr> | |||
<th class=""min-width"">"); | |||
#line 69 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.Common_Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"min-width\">" + | |||
""); | |||
#line 70 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.Common_State); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 71 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.Common_Job); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right" + | |||
" min-width\">"); | |||
#line 72 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.Common_Enqueued); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n " + | |||
" </thead>\r\n <" + | |||
"tbody>\r\n"); | |||
#line 76 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
foreach (var job in queue.FirstJobs) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr class=\""); | |||
#line 78 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(job.Value == null || !job.Value.InEnqueuedState ? "obsolete-data" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <td class=\"min-width\"" + | |||
">\r\n "); | |||
#line 80 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Html.JobIdLink(job.Key)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 81 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
if (job.Value != null && !job.Value.InEnqueuedState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <span title=\""); | |||
#line 83 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.Common_JobStateChanged_Text); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n"); | |||
#line 84 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
#line 86 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
if (job.Value == null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td colspan=\"3\"><em>"); | |||
#line 88 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.Common_JobExpired); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em></td>\r\n"); | |||
#line 89 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td class=\"min-width\"" + | |||
">\r\n "); | |||
#line 93 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Html.StateLabel(job.Value.State)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"word-break" + | |||
"\">\r\n "); | |||
#line 96 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Html.JobNameLink(job.Key, job.Value.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"align-righ" + | |||
"t min-width\">\r\n"); | |||
#line 99 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
if (job.Value.EnqueuedAt.HasValue) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 101 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Html.RelativeTime(job.Value.EnqueuedAt.Value)); | |||
#line default | |||
#line hidden | |||
#line 101 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <em>"); | |||
#line 105 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
Write(Strings.Common_NotAvailable); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em>\r\n"); | |||
#line 106 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
#line 108 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tr>\r\n"); | |||
#line 110 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n " + | |||
" </table>\r\n"); | |||
#line 113 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n </tr>\r\n"); | |||
#line 116 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n </table>\r\n </div>\r\n"); | |||
#line 120 "..\..\Dashboard\Pages\QueuesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n</div>"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,196 +0,0 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: true *@ | |||
@using System | |||
@using System.Collections.Generic | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@using Hangfire.Storage | |||
@inherits RazorPage | |||
@{ | |||
Layout = new LayoutPage(Strings.RecurringJobsPage_Title); | |||
List<RecurringJobDto> recurringJobs; | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
Pager pager = null; | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
var storageConnection = connection as JobStorageConnection; | |||
if (storageConnection != null) | |||
{ | |||
pager = new Pager(from, perPage, storageConnection.GetRecurringJobCount()); | |||
recurringJobs = storageConnection.GetRecurringJobs(pager.FromRecord, pager.FromRecord + pager.RecordsPerPage); | |||
} | |||
else | |||
{ | |||
recurringJobs = connection.GetRecurringJobs(); | |||
} | |||
} | |||
} | |||
<div class="row"> | |||
<div class="col-md-12"> | |||
<h1 class="page-header">@Strings.RecurringJobsPage_Title</h1> | |||
@if (recurringJobs.Count == 0) | |||
{ | |||
<div class="alert alert-info"> | |||
@Strings.RecurringJobsPage_NoJobs | |||
</div> | |||
} | |||
else | |||
{ | |||
<div class="js-jobs-list"> | |||
<div class="btn-toolbar btn-toolbar-top"> | |||
<button class="js-jobs-list-command btn btn-sm btn-primary" | |||
data-url="@Url.To("/recurring/trigger")" | |||
data-loading-text="@Strings.RecurringJobsPage_Triggering" | |||
disabled="disabled"> | |||
<span class="glyphicon glyphicon-play-circle"></span> | |||
@Strings.RecurringJobsPage_TriggerNow | |||
</button> | |||
<button class="js-jobs-list-command btn btn-sm btn-default" | |||
data-url="@Url.To("/recurring/remove")" | |||
data-loading-text="@Strings.Common_Deleting" | |||
data-confirm="@Strings.Common_DeleteConfirm" | |||
disabled="disabled"> | |||
<span class="glyphicon glyphicon-remove"></span> | |||
@Strings.Common_Delete | |||
</button> | |||
@if (pager != null) | |||
{ | |||
@: @Html.PerPageSelector(pager) | |||
} | |||
</div> | |||
<div class="table-responsive"> | |||
<table class="table"> | |||
<thead> | |||
<tr> | |||
<th class="min-width"> | |||
<input type="checkbox" class="js-jobs-list-select-all" /> | |||
</th> | |||
<th class="min-width">@Strings.Common_Id</th> | |||
<th class="min-width">@Strings.RecurringJobsPage_Table_Cron</th> | |||
<th class="min-width">@Strings.RecurringJobsPage_Table_TimeZone</th> | |||
<th>@Strings.Common_Job</th> | |||
<th class="align-right min-width">@Strings.RecurringJobsPage_Table_NextExecution</th> | |||
<th class="align-right min-width">@Strings.RecurringJobsPage_Table_LastExecution</th> | |||
<th class="align-right min-width">@Strings.Common_Created</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@foreach (var job in recurringJobs) | |||
{ | |||
<tr class="js-jobs-list-row hover"> | |||
<td> | |||
<input type="checkbox" class="js-jobs-list-checkbox" name="jobs[]" value="@job.Id" /> | |||
</td> | |||
<td class="min-width">@job.Id</td> | |||
<td class="min-width"> | |||
@* ReSharper disable once EmptyGeneralCatchClause *@ | |||
@{ | |||
string cronDescription = null; | |||
#if NETFULL | |||
try | |||
{ | |||
cronDescription = string.IsNullOrEmpty(job.Cron) ? null : CronExpressionDescriptor.ExpressionDescriptor.GetDescription(job.Cron); | |||
} | |||
catch (FormatException) | |||
{ | |||
} | |||
#endif | |||
} | |||
@if (cronDescription != null) | |||
{ | |||
<code title="@cronDescription">@job.Cron</code> | |||
} | |||
else | |||
{ | |||
<code>@job.Cron</code> | |||
} | |||
</td> | |||
<td class="min-width"> | |||
@if (!String.IsNullOrWhiteSpace(job.TimeZoneId)) | |||
{ | |||
<span title="@TimeZoneInfo.FindSystemTimeZoneById(job.TimeZoneId).DisplayName" data-container="body">@job.TimeZoneId</span> | |||
} | |||
else | |||
{ | |||
@: UTC | |||
} | |||
</td> | |||
<td class="word-break"> | |||
@if (job.Job != null) | |||
{ | |||
@: @Html.JobName(job.Job) | |||
} | |||
else | |||
{ | |||
<em>@job.LoadException.InnerException.Message</em> | |||
} | |||
</td> | |||
<td class="align-right min-width"> | |||
@if (job.NextExecution != null) | |||
{ | |||
@Html.RelativeTime(job.NextExecution.Value) | |||
} | |||
else | |||
{ | |||
<em>@Strings.Common_NotAvailable</em> | |||
} | |||
</td> | |||
<td class="align-right min-width"> | |||
@if (job.LastExecution != null) | |||
{ | |||
if (!String.IsNullOrEmpty(job.LastJobId)) | |||
{ | |||
<a href="@Url.JobDetails(job.LastJobId)"> | |||
<span class="label label-default label-hover" style="@($"background-color: {JobHistoryRenderer.GetForegroundStateColor(job.LastJobState)};")"> | |||
@Html.RelativeTime(job.LastExecution.Value) | |||
</span> | |||
</a> | |||
} | |||
else | |||
{ | |||
<em> | |||
@Strings.RecurringJobsPage_Canceled @Html.RelativeTime(job.LastExecution.Value) | |||
</em> | |||
} | |||
} | |||
else | |||
{ | |||
<em>@Strings.Common_NotAvailable</em> | |||
} | |||
</td> | |||
<td class="align-right min-width"> | |||
@if (job.CreatedAt != null) | |||
{ | |||
@Html.RelativeTime(job.CreatedAt.Value) | |||
} | |||
else | |||
{ | |||
<em>N/A</em> | |||
} | |||
</td> | |||
</tr> | |||
} | |||
</tbody> | |||
</table> | |||
</div> | |||
@if (pager != null) | |||
{ | |||
@: @Html.Paginator(pager) | |||
} | |||
</div> | |||
} | |||
</div> | |||
</div> |
@@ -1,831 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
#line 2 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
using System; | |||
#line default | |||
#line hidden | |||
#line 3 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
using System.Collections.Generic; | |||
#line default | |||
#line hidden | |||
using System.Linq; | |||
using System.Text; | |||
#line 4 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 5 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 6 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
#line 7 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
using Hangfire.Storage; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class RecurringJobsPage : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 9 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Layout = new LayoutPage(Strings.RecurringJobsPage_Title); | |||
List<RecurringJobDto> recurringJobs; | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
Pager pager = null; | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
var storageConnection = connection as JobStorageConnection; | |||
if (storageConnection != null) | |||
{ | |||
pager = new Pager(from, perPage, storageConnection.GetRecurringJobCount()); | |||
recurringJobs = storageConnection.GetRecurringJobs(pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1); | |||
} | |||
else | |||
{ | |||
recurringJobs = connection.GetRecurringJobs(); | |||
} | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <h1 class=\"page-header\"" + | |||
">"); | |||
#line 37 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.RecurringJobsPage_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h1>\r\n\r\n"); | |||
#line 39 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
if (recurringJobs.Count == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-info\">\r\n "); | |||
#line 42 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.RecurringJobsPage_NoJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 44 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar b" + | |||
"tn-toolbar-top\">\r\n <button class=\"js-jobs-list-command btn bt" + | |||
"n-sm btn-primary\"\r\n data-url=\""); | |||
#line 50 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Url.To("/recurring/trigger")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 51 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.RecurringJobsPage_Triggering); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n <spa" + | |||
"n class=\"glyphicon glyphicon-play-circle\"></span>\r\n "); | |||
#line 54 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.RecurringJobsPage_TriggerNow); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n <button class=\"js-jobs-lis" + | |||
"t-command btn btn-sm btn-default\"\r\n data-url=\""); | |||
#line 58 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Url.To("/recurring/remove")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 59 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.Common_Deleting); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-confirm=\""); | |||
#line 60 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.Common_DeleteConfirm); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n <spa" + | |||
"n class=\"glyphicon glyphicon-remove\"></span>\r\n "); | |||
#line 63 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.Common_Delete); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n"); | |||
#line 66 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
if (pager != null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" "); | |||
WriteLiteral(" "); | |||
#line 68 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Html.PerPageSelector(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 69 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(@" </div> | |||
<div class=""table-responsive""> | |||
<table class=""table""> | |||
<thead> | |||
<tr> | |||
<th class=""min-width""> | |||
<input type=""checkbox"" class=""js-jobs-list-select-all"" /> | |||
</th> | |||
<th class=""min-width"">"); | |||
#line 79 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.Common_Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"min-width\">"); | |||
#line 80 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.RecurringJobsPage_Table_Cron); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"min-width\">"); | |||
#line 81 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.RecurringJobsPage_Table_TimeZone); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 82 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.Common_Job); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right min-width\">"); | |||
#line 83 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.RecurringJobsPage_Table_NextExecution); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right min-width\">"); | |||
#line 84 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.RecurringJobsPage_Table_LastExecution); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right min-width\">"); | |||
#line 85 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.Common_Created); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n " + | |||
" <tbody>\r\n"); | |||
#line 89 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
foreach (var job in recurringJobs) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr class=\"js-jobs-list-row hover\">\r\n " + | |||
" <td>\r\n <input typ" + | |||
"e=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\""); | |||
#line 93 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(job.Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" />\r\n </td>\r\n " + | |||
" <td class=\"min-width\">"); | |||
#line 95 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(job.Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</td>\r\n <td class=\"min-width\">\r\n " + | |||
" "); | |||
WriteLiteral("\r\n"); | |||
#line 98 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
string cronDescription = null; | |||
#if NETFULL | |||
try | |||
{ | |||
cronDescription = string.IsNullOrEmpty(job.Cron) ? null : CronExpressionDescriptor.ExpressionDescriptor.GetDescription(job.Cron); | |||
} | |||
catch (FormatException) | |||
{ | |||
} | |||
#endif | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 111 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
if (cronDescription != null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <code title=\""); | |||
#line 113 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(cronDescription); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">"); | |||
#line 113 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(job.Cron); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</code>\r\n"); | |||
#line 114 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <code>"); | |||
#line 117 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(job.Cron); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</code>\r\n"); | |||
#line 118 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <t" + | |||
"d class=\"min-width\">\r\n"); | |||
#line 121 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
if (!String.IsNullOrWhiteSpace(job.TimeZoneId)) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <span title=\""); | |||
#line 123 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(TimeZoneInfo.FindSystemTimeZoneById(job.TimeZoneId).DisplayName); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" data-container=\"body\">"); | |||
#line 123 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(job.TimeZoneId); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</span>\r\n"); | |||
#line 124 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" "); | |||
WriteLiteral(" UTC\r\n"); | |||
#line 128 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <t" + | |||
"d class=\"word-break\">\r\n"); | |||
#line 131 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
if (job.Job != null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" "); | |||
WriteLiteral(" "); | |||
#line 133 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Html.JobName(job.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 134 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <em>"); | |||
#line 137 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(job.LoadException.InnerException.Message); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em>\r\n"); | |||
#line 138 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <t" + | |||
"d class=\"align-right min-width\">\r\n"); | |||
#line 141 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
if (job.NextExecution != null) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 143 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Html.RelativeTime(job.NextExecution.Value)); | |||
#line default | |||
#line hidden | |||
#line 143 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <em>"); | |||
#line 147 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.Common_NotAvailable); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em>\r\n"); | |||
#line 148 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <t" + | |||
"d class=\"align-right min-width\">\r\n"); | |||
#line 151 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
if (job.LastExecution != null) | |||
{ | |||
if (!String.IsNullOrEmpty(job.LastJobId)) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <a href=\""); | |||
#line 155 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Url.JobDetails(job.LastJobId)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <span class=\"label label-" + | |||
"default label-hover\" style=\""); | |||
#line 156 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write($"background-color: {JobHistoryRenderer.GetForegroundStateColor(job.LastJobState)};"); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n "); | |||
#line 157 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Html.RelativeTime(job.LastExecution.Value)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </span>\r\n " + | |||
" </a>\r\n"); | |||
#line 160 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <em>\r\n " + | |||
" "); | |||
#line 164 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.RecurringJobsPage_Canceled); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" "); | |||
#line 164 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Html.RelativeTime(job.LastExecution.Value)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </em>\r\n"); | |||
#line 166 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <em>"); | |||
#line 170 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Strings.Common_NotAvailable); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em>\r\n"); | |||
#line 171 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <t" + | |||
"d class=\"align-right min-width\">\r\n"); | |||
#line 174 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
if (job.CreatedAt != null) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 176 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Html.RelativeTime(job.CreatedAt.Value)); | |||
#line default | |||
#line hidden | |||
#line 176 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <em>N/A</em>\r\n"); | |||
#line 181 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n </tr>\r" + | |||
"\n"); | |||
#line 184 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n </table>\r\n <" + | |||
"/div>\r\n\r\n"); | |||
#line 189 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
if (pager != null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" "); | |||
WriteLiteral(" "); | |||
#line 191 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
Write(Html.Paginator(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 192 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n"); | |||
#line 194 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n</div> "); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,143 +0,0 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ | |||
@using System.Collections.Generic | |||
@using Hangfire.Common | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@using Hangfire.Storage | |||
@inherits RazorPage | |||
@{ | |||
Layout = new LayoutPage(Strings.RetriesPage_Title); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
Pager pager = null; | |||
List<string> jobIds = null; | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
var storageConnection = connection as JobStorageConnection; | |||
if (storageConnection != null) | |||
{ | |||
pager = new Pager(@from, perPage, storageConnection.GetSetCount("retries")); | |||
jobIds = storageConnection.GetRangeFromSet("retries", pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1); | |||
} | |||
} | |||
} | |||
@if (pager == null) | |||
{ | |||
<div class="alert alert-warning"> | |||
@Html.Raw(String.Format(Strings.RetriesPage_Warning_Html, Url.To("/jobs/scheduled"))) | |||
</div> | |||
} | |||
else | |||
{ | |||
<div class="row"> | |||
<div class="col-md-12"> | |||
<h1 class="page-header">@Strings.RetriesPage_Title</h1> | |||
@if (jobIds.Count == 0) | |||
{ | |||
<div class="alert alert-success"> | |||
@Strings.RetriesPage_NoJobs | |||
</div> | |||
} | |||
else | |||
{ | |||
<div class="js-jobs-list"> | |||
<div class="btn-toolbar btn-toolbar-top"> | |||
<button class="js-jobs-list-command btn btn-sm btn-primary" | |||
data-url="@Url.To("/jobs/scheduled/enqueue")" | |||
data-loading-text="@Strings.Common_Enqueueing" | |||
disabled="disabled"> | |||
<span class="glyphicon glyphicon-repeat"></span> | |||
@Strings.Common_EnqueueButton_Text | |||
</button> | |||
<button class="js-jobs-list-command btn btn-sm btn-default" | |||
data-url="@Url.To("/jobs/scheduled/delete")" | |||
data-loading-text="@Strings.Common_Deleting" | |||
data-confirm="@Strings.Common_DeleteConfirm" | |||
disabled="disabled"> | |||
<span class="glyphicon glyphicon-remove"></span> | |||
@Strings.Common_DeleteSelected | |||
</button> | |||
@Html.PerPageSelector(pager) | |||
</div> | |||
<div class="table-responsive"> | |||
<table class="table table-hover"> | |||
<thead> | |||
<tr> | |||
<th class="min-width"> | |||
<input type="checkbox" class="js-jobs-list-select-all" /> | |||
</th> | |||
<th class="min-width">@Strings.Common_Id</th> | |||
<th class="min-width">@Strings.Common_State</th> | |||
<th>@Strings.Common_Job</th> | |||
<th>@Strings.Common_Reason</th> | |||
<th class="align-right">@Strings.Common_Retry</th> | |||
<th class="align-right">@Strings.Common_Created</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@foreach (var jobId in jobIds) | |||
{ | |||
JobData jobData; | |||
StateData stateData; | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
jobData = connection.GetJobData(jobId); | |||
stateData = connection.GetStateData(jobId); | |||
} | |||
<tr class="js-jobs-list-row @(jobData != null ? "hover" : null)"> | |||
<td> | |||
<input type="checkbox" class="js-jobs-list-checkbox" name="jobs[]" value="@jobId" /> | |||
</td> | |||
<td class="min-width"> | |||
@Html.JobIdLink(jobId) | |||
</td> | |||
@if (jobData == null) | |||
{ | |||
<td colspan="5"><em>Job expired.</em></td> | |||
} | |||
else | |||
{ | |||
<td class="min-width"> | |||
@Html.StateLabel(jobData.State) | |||
</td> | |||
<td class="word-break"> | |||
@Html.JobNameLink(jobId, jobData.Job) | |||
</td> | |||
<td> | |||
@(stateData?.Reason) | |||
</td> | |||
<td class="align-right"> | |||
@if (stateData != null && stateData.Data.ContainsKey("EnqueueAt")) | |||
{ | |||
@Html.RelativeTime(JobHelper.DeserializeDateTime(stateData.Data["EnqueueAt"])) | |||
} | |||
</td> | |||
<td class="align-right"> | |||
@Html.RelativeTime(jobData.CreatedAt) | |||
</td> | |||
} | |||
</tr> | |||
} | |||
</tbody> | |||
</table> | |||
</div> | |||
@Html.Paginator(pager) | |||
</div> | |||
} | |||
</div> | |||
</div> | |||
} |
@@ -1,555 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
using System; | |||
#line 2 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
using System.Collections.Generic; | |||
#line default | |||
#line hidden | |||
using System.Linq; | |||
using System.Text; | |||
#line 3 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
using Hangfire.Common; | |||
#line default | |||
#line hidden | |||
#line 4 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 5 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 6 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
#line 7 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
using Hangfire.Storage; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class RetriesPage : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 9 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Layout = new LayoutPage(Strings.RetriesPage_Title); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
Pager pager = null; | |||
List<string> jobIds = null; | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
var storageConnection = connection as JobStorageConnection; | |||
if (storageConnection != null) | |||
{ | |||
pager = new Pager(@from, perPage, storageConnection.GetSetCount("retries")); | |||
jobIds = storageConnection.GetRangeFromSet("retries", pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1); | |||
} | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 32 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
if (pager == null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-warning\">\r\n "); | |||
#line 35 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Html.Raw(String.Format(Strings.RetriesPage_Warning_Html, Url.To("/jobs/scheduled")))); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 37 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <h1 class=\"pa" + | |||
"ge-header\">"); | |||
#line 42 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.RetriesPage_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h1>\r\n"); | |||
#line 43 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
if (jobIds.Count == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-success\">\r\n "); | |||
#line 46 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.RetriesPage_NoJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 48 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-t" + | |||
"oolbar btn-toolbar-top\">\r\n <button class=\"js-jobs-list-co" + | |||
"mmand btn btn-sm btn-primary\"\r\n data-url=\""); | |||
#line 54 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Url.To("/jobs/scheduled/enqueue")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 55 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.Common_Enqueueing); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n " + | |||
" <span class=\"glyphicon glyphicon-repeat\"></span>\r\n " + | |||
" "); | |||
#line 58 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.Common_EnqueueButton_Text); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n <button class=\"js-" + | |||
"jobs-list-command btn btn-sm btn-default\"\r\n data-" + | |||
"url=\""); | |||
#line 62 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Url.To("/jobs/scheduled/delete")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 63 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.Common_Deleting); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-confirm=\""); | |||
#line 64 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.Common_DeleteConfirm); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n " + | |||
" <span class=\"glyphicon glyphicon-remove\"></span>\r\n " + | |||
" "); | |||
#line 67 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.Common_DeleteSelected); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n "); | |||
#line 70 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Html.PerPageSelector(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral(@" | |||
</div> | |||
<div class=""table-responsive""> | |||
<table class=""table table-hover""> | |||
<thead> | |||
<tr> | |||
<th class=""min-width""> | |||
<input type=""checkbox"" class=""js-jobs-list-select-all"" /> | |||
</th> | |||
<th class=""min-width"">"); | |||
#line 80 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.Common_Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"min-width\">"); | |||
#line 81 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.Common_State); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 82 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.Common_Job); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 83 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.Common_Reason); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right\">"); | |||
#line 84 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.Common_Retry); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right\">"); | |||
#line 85 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Strings.Common_Created); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead" + | |||
">\r\n <tbody>\r\n"); | |||
#line 89 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
foreach (var jobId in jobIds) | |||
{ | |||
JobData jobData; | |||
StateData stateData; | |||
using (var connection = Storage.GetConnection()) | |||
{ | |||
jobData = connection.GetJobData(jobId); | |||
stateData = connection.GetStateData(jobId); | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr class=\"js-jobs-list-row "); | |||
#line 100 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(jobData != null ? "hover" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <td>\r\n " + | |||
" <input type=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" " + | |||
"value=\""); | |||
#line 102 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(jobId); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" />\r\n </td>\r\n " + | |||
" <td class=\"min-width\">\r\n " + | |||
""); | |||
#line 105 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Html.JobIdLink(jobId)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
#line 107 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
if (jobData == null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td colspan=\"5\"><em>Job expired.</em>" + | |||
"</td>\r\n"); | |||
#line 110 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td class=\"min-width\">\r\n " + | |||
" "); | |||
#line 114 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Html.StateLabel(jobData.State)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"word-break\">\r\n " + | |||
" "); | |||
#line 117 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Html.JobNameLink(jobId, jobData.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td>\r\n " + | |||
" "); | |||
#line 120 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(stateData?.Reason); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"align-right\">\r\n"); | |||
#line 123 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
if (stateData != null && stateData.Data.ContainsKey("EnqueueAt")) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 125 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Html.RelativeTime(JobHelper.DeserializeDateTime(stateData.Data["EnqueueAt"]))); | |||
#line default | |||
#line hidden | |||
#line 125 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
WriteLiteral(" <td class=\"align-right\">\r\n " + | |||
" "); | |||
#line 129 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Html.RelativeTime(jobData.CreatedAt)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
#line 131 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tr>\r\n"); | |||
#line 133 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n </table>\r\n " + | |||
" </div>\r\n\r\n "); | |||
#line 138 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
Write(Html.Paginator(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 140 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n </div>\r\n"); | |||
#line 143 "..\..\Dashboard\Pages\RetriesPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,106 +0,0 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@inherits RazorPage | |||
@{ | |||
Layout = new LayoutPage(Strings.ScheduledJobsPage_Title); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var pager = new Pager(from, perPage, monitor.ScheduledCount()); | |||
var scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage); | |||
} | |||
<div class="row"> | |||
<div class="col-md-3"> | |||
@Html.JobsSidebar() | |||
</div> | |||
<div class="col-md-9"> | |||
<h1 class="page-header">@Strings.ScheduledJobsPage_Title</h1> | |||
@if (pager.TotalPageCount == 0) | |||
{ | |||
<div class="alert alert-info"> | |||
@Strings.ScheduledJobsPage_NoJobs | |||
</div> | |||
} | |||
else | |||
{ | |||
<div class="js-jobs-list"> | |||
<div class="btn-toolbar btn-toolbar-top"> | |||
<button class="js-jobs-list-command btn btn-sm btn-primary" | |||
data-url="@Url.To("/jobs/scheduled/enqueue")" | |||
data-loading-text="@Strings.Common_Enqueueing" | |||
disabled="disabled"> | |||
<span class="glyphicon glyphicon-play"></span> | |||
@Strings.ScheduledJobsPage_EnqueueNow | |||
</button> | |||
<button class="js-jobs-list-command btn btn-sm btn-default" | |||
data-url="@Url.To("/jobs/scheduled/delete")" | |||
data-loading-text="@Strings.Common_Deleting" | |||
data-confirm="@Strings.Common_DeleteConfirm" | |||
disabled="disabled"> | |||
<span class="glyphicon glyphicon-remove"></span> | |||
@Strings.Common_DeleteSelected | |||
</button> | |||
@Html.PerPageSelector(pager) | |||
</div> | |||
<div class="table-responsive"> | |||
<table class="table"> | |||
<thead> | |||
<tr> | |||
<th class="min-width"> | |||
<input type="checkbox" class="js-jobs-list-select-all" /> | |||
</th> | |||
<th class="min-width">@Strings.Common_Id</th> | |||
<th>@Strings.ScheduledJobsPage_Table_Enqueue</th> | |||
<th>@Strings.Common_Job</th> | |||
<th class="align-right">@Strings.ScheduledJobsPage_Table_Scheduled</th> | |||
</tr> | |||
</thead> | |||
@foreach (var job in scheduledJobs) | |||
{ | |||
<tr class="js-jobs-list-row @(!job.Value.InScheduledState ? "obsolete-data" : null) @(job.Value.InScheduledState ? "hover" : null)"> | |||
<td> | |||
@if (job.Value.InScheduledState) | |||
{ | |||
<input type="checkbox" class="js-jobs-list-checkbox" name="jobs[]" value="@job.Key" /> | |||
} | |||
</td> | |||
<td class="min-width"> | |||
@Html.JobIdLink(job.Key) | |||
@if (!job.Value.InScheduledState) | |||
{ | |||
<span title="@Strings.Common_JobStateChanged_Text" class="glyphicon glyphicon-question-sign"></span> | |||
} | |||
</td> | |||
<td class="min-width"> | |||
@Html.RelativeTime(job.Value.EnqueueAt) | |||
</td> | |||
<td class="word-break"> | |||
@Html.JobNameLink(job.Key, job.Value.Job) | |||
</td> | |||
<td class="align-right"> | |||
@if (job.Value.ScheduledAt.HasValue) | |||
{ | |||
@Html.RelativeTime(job.Value.ScheduledAt.Value) | |||
} | |||
</td> | |||
</tr> | |||
} | |||
</table> | |||
</div> | |||
@Html.Paginator(pager) | |||
</div> | |||
} | |||
</div> | |||
</div> |
@@ -1,449 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
#line 2 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 3 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 4 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class ScheduledJobsPage : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 6 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Layout = new LayoutPage(Strings.ScheduledJobsPage_Title); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var pager = new Pager(from, perPage, monitor.ScheduledCount()); | |||
var scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "); | |||
#line 21 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Html.JobsSidebar()); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n <div class=\"col-md-9\">\r\n <h1 class=\"page-header\">"); | |||
#line 24 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Strings.ScheduledJobsPage_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h1>\r\n\r\n"); | |||
#line 26 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
if (pager.TotalPageCount == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-info\">\r\n "); | |||
#line 29 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Strings.ScheduledJobsPage_NoJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 31 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar b" + | |||
"tn-toolbar-top\">\r\n <button class=\"js-jobs-list-command btn bt" + | |||
"n-sm btn-primary\"\r\n data-url=\""); | |||
#line 37 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Url.To("/jobs/scheduled/enqueue")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 38 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Strings.Common_Enqueueing); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n <spa" + | |||
"n class=\"glyphicon glyphicon-play\"></span>\r\n "); | |||
#line 41 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Strings.ScheduledJobsPage_EnqueueNow); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n <button class=\"js-jobs-lis" + | |||
"t-command btn btn-sm btn-default\"\r\n data-url=\""); | |||
#line 45 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Url.To("/jobs/scheduled/delete")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 46 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Strings.Common_Deleting); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-confirm=\""); | |||
#line 47 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Strings.Common_DeleteConfirm); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n <spa" + | |||
"n class=\"glyphicon glyphicon-remove\"></span>\r\n "); | |||
#line 50 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Strings.Common_DeleteSelected); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n "); | |||
#line 53 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Html.PerPageSelector(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral(@" | |||
</div> | |||
<div class=""table-responsive""> | |||
<table class=""table""> | |||
<thead> | |||
<tr> | |||
<th class=""min-width""> | |||
<input type=""checkbox"" class=""js-jobs-list-select-all"" /> | |||
</th> | |||
<th class=""min-width"">"); | |||
#line 63 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Strings.Common_Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 64 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Strings.ScheduledJobsPage_Table_Enqueue); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 65 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Strings.Common_Job); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right\">"); | |||
#line 66 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Strings.ScheduledJobsPage_Table_Scheduled); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n"); | |||
#line 69 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
foreach (var job in scheduledJobs) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr class=\"js-jobs-list-row "); | |||
#line 71 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(!job.Value.InScheduledState ? "obsolete-data" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" "); | |||
#line 71 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(job.Value.InScheduledState ? "hover" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <td>\r\n"); | |||
#line 73 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
if (job.Value.InScheduledState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <input type=\"checkbox\" class=\"js-jobs-lis" + | |||
"t-checkbox\" name=\"jobs[]\" value=\""); | |||
#line 75 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(job.Key); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" />\r\n"); | |||
#line 76 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <td class=" + | |||
"\"min-width\">\r\n "); | |||
#line 79 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Html.JobIdLink(job.Key)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 80 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
if (!job.Value.InScheduledState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <span title=\""); | |||
#line 82 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Strings.Common_JobStateChanged_Text); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n"); | |||
#line 83 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <td class=" + | |||
"\"min-width\">\r\n "); | |||
#line 86 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Html.RelativeTime(job.Value.EnqueueAt)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n <td clas" + | |||
"s=\"word-break\">\r\n "); | |||
#line 89 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Html.JobNameLink(job.Key, job.Value.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n <td clas" + | |||
"s=\"align-right\">\r\n"); | |||
#line 92 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
if (job.Value.ScheduledAt.HasValue) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 94 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Html.RelativeTime(job.Value.ScheduledAt.Value)); | |||
#line default | |||
#line hidden | |||
#line 94 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n </tr>\r\n"); | |||
#line 98 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </table>\r\n </div>\r\n\r\n "); | |||
#line 102 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
Write(Html.Paginator(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 104 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n</div>"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,60 +0,0 @@ | |||
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ | |||
@using System | |||
@using System.Linq | |||
@using Hangfire.Common | |||
@using Hangfire.Dashboard | |||
@using Hangfire.Dashboard.Pages | |||
@using Hangfire.Dashboard.Resources | |||
@inherits RazorPage | |||
@{ | |||
Layout = new LayoutPage(Strings.ServersPage_Title); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var servers = monitor.Servers(); | |||
} | |||
<div class="row"> | |||
<div class="col-md-12"> | |||
<h1 class="page-header">@Strings.ServersPage_Title</h1> | |||
@if (servers.Count == 0) | |||
{ | |||
<div class="alert alert-warning"> | |||
@Strings.ServersPage_NoServers | |||
</div> | |||
} | |||
else | |||
{ | |||
<div class="table-responsive"> | |||
<table class="table"> | |||
<thead> | |||
<tr> | |||
<th>@Strings.ServersPage_Table_Name</th> | |||
<th>@Strings.ServersPage_Table_Workers</th> | |||
<th>@Strings.ServersPage_Table_Queues</th> | |||
<th>@Strings.ServersPage_Table_Started</th> | |||
<th>@Strings.ServersPage_Table_Heartbeat</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@foreach (var server in servers) | |||
{ | |||
<tr> | |||
<td>@Html.ServerId(server.Name)</td> | |||
<td>@server.WorkersCount</td> | |||
<td>@Html.Raw(String.Join(", ", server.Queues.Select(Html.QueueLabel)))</td> | |||
<td data-moment="@JobHelper.ToTimestamp(server.StartedAt)">@server.StartedAt</td> | |||
<td> | |||
@if (server.Heartbeat.HasValue) | |||
{ | |||
@Html.RelativeTime(server.Heartbeat.Value) | |||
} | |||
</td> | |||
</tr> | |||
} | |||
</tbody> | |||
</table> | |||
</div> | |||
} | |||
</div> | |||
</div> |
@@ -1,294 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
#line 2 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
using System; | |||
#line default | |||
#line hidden | |||
using System.Collections.Generic; | |||
#line 3 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
using System.Linq; | |||
#line default | |||
#line hidden | |||
using System.Text; | |||
#line 4 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
using Hangfire.Common; | |||
#line default | |||
#line hidden | |||
#line 5 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 6 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 7 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class ServersPage : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 9 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Layout = new LayoutPage(Strings.ServersPage_Title); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var servers = monitor.Servers(); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <h1 class=\"page-header\"" + | |||
">"); | |||
#line 18 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(Strings.ServersPage_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h1>\r\n\r\n"); | |||
#line 20 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
if (servers.Count == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-warning\">\r\n "); | |||
#line 23 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(Strings.ServersPage_NoServers); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 25 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"table-responsive\">\r\n <table class=\"table\">" + | |||
"\r\n <thead>\r\n <tr>\r\n " + | |||
" <th>"); | |||
#line 32 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(Strings.ServersPage_Table_Name); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 33 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(Strings.ServersPage_Table_Workers); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 34 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(Strings.ServersPage_Table_Queues); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 35 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(Strings.ServersPage_Table_Started); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 36 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(Strings.ServersPage_Table_Heartbeat); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n " + | |||
" <tbody>\r\n"); | |||
#line 40 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
foreach (var server in servers) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr>\r\n <td>"); | |||
#line 43 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(Html.ServerId(server.Name)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</td>\r\n <td>"); | |||
#line 44 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(server.WorkersCount); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</td>\r\n <td>"); | |||
#line 45 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(Html.Raw(String.Join(", ", server.Queues.Select(Html.QueueLabel)))); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</td>\r\n <td data-moment=\""); | |||
#line 46 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(JobHelper.ToTimestamp(server.StartedAt)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">"); | |||
#line 46 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(server.StartedAt); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</td>\r\n <td>\r\n"); | |||
#line 48 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
if (server.Heartbeat.HasValue) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 50 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
Write(Html.RelativeTime(server.Heartbeat.Value)); | |||
#line default | |||
#line hidden | |||
#line 50 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n </tr>\r\n"); | |||
#line 54 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n </table>\r\n </div>\r\n"); | |||
#line 58 "..\..\Dashboard\Pages\ServersPage.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n</div>"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,33 +0,0 @@ | |||
// This file is part of Hangfire. | |||
// Copyright © 2015 Sergey Odinokov. | |||
// | |||
// Hangfire is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU Lesser General Public License as | |||
// published by the Free Software Foundation, either version 3 | |||
// of the License, or any later version. | |||
// | |||
// Hangfire is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU Lesser General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU Lesser General Public | |||
// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>. | |||
using System; | |||
using System.Collections.Generic; | |||
using Hangfire.Annotations; | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
partial class SidebarMenu | |||
{ | |||
public SidebarMenu([NotNull] IEnumerable<Func<RazorPage, MenuItem>> items) | |||
{ | |||
if (items == null) throw new ArgumentNullException(nameof(items)); | |||
Items = items; | |||
} | |||
public IEnumerable<Func<RazorPage, MenuItem>> Items { get; } | |||
} | |||
} |
@@ -1,481 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
#line 2 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
using System; | |||
#line default | |||
#line hidden | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
#line 3 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 4 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
using Hangfire.Dashboard.Pages; | |||
#line default | |||
#line hidden | |||
#line 5 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class SucceededJobs : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 7 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Layout = new LayoutPage(Strings.SucceededJobsPage_Title); | |||
int from, perPage; | |||
int.TryParse(Query("from"), out from); | |||
int.TryParse(Query("count"), out perPage); | |||
var monitor = Storage.GetMonitoringApi(); | |||
var pager = new Pager(from, perPage, monitor.SucceededListCount()); | |||
var succeededJobs = monitor.SucceededJobs(pager.FromRecord, pager.RecordsPerPage); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "); | |||
#line 22 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Html.JobsSidebar()); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n <div class=\"col-md-9\">\r\n <h1 class=\"page-header\">"); | |||
#line 25 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Strings.SucceededJobsPage_Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</h1>\r\n\r\n"); | |||
#line 27 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
if (pager.TotalPageCount == 0) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"alert alert-info\">\r\n "); | |||
#line 30 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Strings.SucceededJobsPage_NoJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 32 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar b" + | |||
"tn-toolbar-top\">\r\n <button class=\"js-jobs-list-command btn bt" + | |||
"n-sm btn-primary\"\r\n data-url=\""); | |||
#line 38 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Url.To("/jobs/succeeded/requeue")); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n data-loading-text=\""); | |||
#line 39 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Strings.Common_Enqueueing); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"\r\n disabled=\"disabled\">\r\n <spa" + | |||
"n class=\"glyphicon glyphicon-repeat\"></span>\r\n "); | |||
#line 42 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Strings.Common_RequeueJobs); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </button>\r\n\r\n "); | |||
#line 45 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Html.PerPageSelector(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral(@" | |||
</div> | |||
<div class=""table-responsive""> | |||
<table class=""table""> | |||
<thead> | |||
<tr> | |||
<th class=""min-width""> | |||
<input type=""checkbox"" class=""js-jobs-list-select-all"" /> | |||
</th> | |||
<th class=""min-width"">"); | |||
#line 55 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Strings.Common_Id); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th>"); | |||
#line 56 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Strings.Common_Job); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"min-width\">"); | |||
#line 57 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Strings.SucceededJobsPage_Table_TotalDuration); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n <th class=\"align-right\">"); | |||
#line 58 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Strings.SucceededJobsPage_Table_Succeeded); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n " + | |||
" <tbody>\r\n"); | |||
#line 62 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
foreach (var job in succeededJobs) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <tr class=\"js-jobs-list-row "); | |||
#line 64 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(job.Value == null || !job.Value.InSucceededState ? "obsolete-data" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" "); | |||
#line 64 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(job.Value != null && job.Value.InSucceededState ? "hover" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n <td>\r\n"); | |||
#line 66 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
if (job.Value == null || job.Value.InSucceededState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <input type=\"checkbox\" class=\"js-jobs" + | |||
"-list-checkbox\" name=\"jobs[]\" value=\""); | |||
#line 68 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(job.Key); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" />\r\n"); | |||
#line 69 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n <t" + | |||
"d class=\"min-width\">\r\n "); | |||
#line 72 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Html.JobIdLink(job.Key)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n"); | |||
#line 73 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
if (job.Value != null && !job.Value.InSucceededState) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <span title=\""); | |||
#line 75 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Strings.Common_JobStateChanged_Text); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n"); | |||
#line 76 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n\r\n"); | |||
#line 79 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
if (job.Value == null) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td colspan=\"3\">\r\n " + | |||
" <em>"); | |||
#line 82 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Strings.Common_JobExpired); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</em>\r\n </td>\r\n"); | |||
#line 84 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
} | |||
else | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <td class=\"word-break\">\r\n " + | |||
" "); | |||
#line 88 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Html.JobNameLink(job.Key, job.Value.Job)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </td>\r\n"); | |||
WriteLiteral(" <td class=\"min-width align-right\">\r\n"); | |||
#line 91 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
if (job.Value.TotalDuration.HasValue) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 93 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Html.ToHumanDuration(TimeSpan.FromMilliseconds(job.Value.TotalDuration.Value), false)); | |||
#line default | |||
#line hidden | |||
#line 93 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
WriteLiteral(" <td class=\"min-width align-right\">\r\n"); | |||
#line 97 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
if (job.Value.SucceededAt.HasValue) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 99 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Html.RelativeTime(job.Value.SucceededAt.Value)); | |||
#line default | |||
#line hidden | |||
#line 99 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </td>\r\n"); | |||
#line 102 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tr>\r\n"); | |||
#line 104 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </tbody>\r\n </table>\r\n <" + | |||
"/div>\r\n\r\n "); | |||
#line 109 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
Write(Html.Paginator(pager)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n"); | |||
#line 111 "..\..\Dashboard\Pages\SucceededJobs.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n</div>"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,105 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
#line 2 "..\..\Dashboard\Pages\_Breadcrumbs.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class Breadcrumbs : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
WriteLiteral("\r\n<ol class=\"breadcrumb\">\r\n <li><a href=\""); | |||
#line 6 "..\..\Dashboard\Pages\_Breadcrumbs.cshtml" | |||
Write(Url.Home()); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\"><span class=\"glyphicon glyphicon-home\"></span></a></li>\r\n"); | |||
#line 7 "..\..\Dashboard\Pages\_Breadcrumbs.cshtml" | |||
foreach (var item in Items) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <li><a href=\""); | |||
#line 9 "..\..\Dashboard\Pages\_Breadcrumbs.cshtml" | |||
Write(item.Value); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">"); | |||
#line 9 "..\..\Dashboard\Pages\_Breadcrumbs.cshtml" | |||
Write(item.Key); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</a></li>\r\n"); | |||
#line 10 "..\..\Dashboard\Pages\_Breadcrumbs.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <li class=\"active\">"); | |||
#line 11 "..\..\Dashboard\Pages\_Breadcrumbs.cshtml" | |||
Write(Title); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</li>\r\n</ol>"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,248 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
#line 2 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
#line 3 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class Paginator : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
WriteLiteral("\r\n"); | |||
WriteLiteral("<div class=\"btn-toolbar\">\r\n"); | |||
#line 7 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
if (_pager.TotalPageCount > 1) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div class=\"btn-group paginator\">\r\n"); | |||
#line 10 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
foreach (var page in _pager.PagerItems) | |||
{ | |||
switch (page.Type) | |||
{ | |||
case Pager.ItemType.Page: | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <a href=\""); | |||
#line 15 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
Write(_pager.PageUrl(page.PageIndex)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" class=\"btn btn-default "); | |||
#line 15 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
Write(_pager.CurrentPage == page.PageIndex ? "active" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n "); | |||
#line 16 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
Write(page.PageIndex); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" \r\n </a>\r\n"); | |||
#line 18 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
break; | |||
case Pager.ItemType.NextPage: | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <a href=\""); | |||
#line 20 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
Write(_pager.PageUrl(page.PageIndex)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" class=\"btn btn-default "); | |||
#line 20 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
Write(page.Disabled ? "disabled" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n "); | |||
#line 21 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
Write(Strings.Paginator_Next); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </a>\r\n"); | |||
#line 23 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
break; | |||
case Pager.ItemType.PrevPage: | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <a href=\""); | |||
#line 25 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
Write(_pager.PageUrl(page.PageIndex)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" class=\"btn btn-default "); | |||
#line 25 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
Write(page.Disabled ? "disabled" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n "); | |||
#line 26 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
Write(Strings.Paginator_Prev); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </a>\r\n"); | |||
#line 28 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
break; | |||
case Pager.ItemType.MorePage: | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <a href=\"#\" class=\"btn btn-default disabled\">\r\n " + | |||
" …\r\n </a>\r\n"); | |||
#line 33 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
break; | |||
} | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n"); | |||
WriteLiteral(" <div class=\"btn-toolbar-spacer\"></div>\r\n"); | |||
#line 38 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n <div class=\"btn-toolbar-label\">\r\n "); | |||
#line 41 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
Write(Strings.Paginator_TotalItems); | |||
#line default | |||
#line hidden | |||
WriteLiteral(": "); | |||
#line 41 "..\..\Dashboard\Pages\_Paginator.cshtml" | |||
Write(_pager.TotalRecordCount); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n </div>\r\n</div>\r\n"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,106 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
#line 2 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" | |||
using Hangfire.Dashboard.Resources; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class PerPageSelector : Hangfire.Dashboard.RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
WriteLiteral("\r\n <div class=\"btn-group pull-right paginator\">\r\n"); | |||
#line 6 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" | |||
foreach (var count in new[] { 10, 20, 50, 100, 500 }) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <a class=\"btn btn-sm btn-default "); | |||
#line 8 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" | |||
Write(count == _pager.RecordsPerPage ? "active" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" \r\n href=\""); | |||
#line 9 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" | |||
Write(_pager.RecordsPerPageUrl(count)); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">"); | |||
#line 9 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" | |||
Write(count); | |||
#line default | |||
#line hidden | |||
WriteLiteral("</a> \r\n"); | |||
#line 10 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n <div class=\"btn-toolbar-spacer pull-right\"></div>\r\n <div class" + | |||
"=\"btn-toolbar-label btn-toolbar-label-sm pull-right\">\r\n "); | |||
#line 14 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" | |||
Write(Strings.PerPageSelector_ItemsPerPage); | |||
#line default | |||
#line hidden | |||
WriteLiteral(":\r\n </div>\r\n"); | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |
@@ -1,139 +0,0 @@ | |||
#pragma warning disable 1591 | |||
//------------------------------------------------------------------------------ | |||
// <auto-generated> | |||
// This code was generated by a tool. | |||
// Runtime Version:4.0.30319.42000 | |||
// | |||
// Changes to this file may cause incorrect behavior and will be lost if | |||
// the code is regenerated. | |||
// </auto-generated> | |||
//------------------------------------------------------------------------------ | |||
namespace Hangfire.Dashboard.Pages | |||
{ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
#line 2 "..\..\Dashboard\Pages\_SidebarMenu.cshtml" | |||
using Hangfire.Dashboard; | |||
#line default | |||
#line hidden | |||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] | |||
internal partial class SidebarMenu : RazorPage | |||
{ | |||
#line hidden | |||
public override void Execute() | |||
{ | |||
WriteLiteral("\r\n"); | |||
#line 4 "..\..\Dashboard\Pages\_SidebarMenu.cshtml" | |||
if (Items.Any()) | |||
{ | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <div id=\"stats\" class=\"list-group\">\r\n"); | |||
#line 7 "..\..\Dashboard\Pages\_SidebarMenu.cshtml" | |||
foreach (var item in Items) | |||
{ | |||
var itemValue = item(this); | |||
#line default | |||
#line hidden | |||
WriteLiteral(" <a href=\""); | |||
#line 10 "..\..\Dashboard\Pages\_SidebarMenu.cshtml" | |||
Write(itemValue.Url); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\" class=\"list-group-item "); | |||
#line 10 "..\..\Dashboard\Pages\_SidebarMenu.cshtml" | |||
Write(itemValue.Active ? "active" : null); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\">\r\n "); | |||
#line 11 "..\..\Dashboard\Pages\_SidebarMenu.cshtml" | |||
Write(itemValue.Text); | |||
#line default | |||
#line hidden | |||
WriteLiteral("\r\n <span class=\"pull-right\">\r\n"); | |||
#line 13 "..\..\Dashboard\Pages\_SidebarMenu.cshtml" | |||
foreach (var metric in itemValue.GetAllMetrics()) | |||
{ | |||
#line default | |||
#line hidden | |||
#line 15 "..\..\Dashboard\Pages\_SidebarMenu.cshtml" | |||
Write(Html.InlineMetric(metric)); | |||
#line default | |||
#line hidden | |||
#line 15 "..\..\Dashboard\Pages\_SidebarMenu.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </span>\r\n </a>\r\n"); | |||
#line 19 "..\..\Dashboard\Pages\_SidebarMenu.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
WriteLiteral(" </div>\r\n"); | |||
#line 21 "..\..\Dashboard\Pages\_SidebarMenu.cshtml" | |||
} | |||
#line default | |||
#line hidden | |||
} | |||
} | |||
} | |||
#pragma warning restore 1591 |