Ejemplo n.º 1
0
        public override void Execute()
        {
            WriteLiteral("\n");



            #line 10 "..\..\Pages\FetchedJobsPage.cshtml"

            Layout = new LayoutPage
            {
                Title       = Queue.ToUpperInvariant(),
                Subtitle    = "Fetched jobs",
                Breadcrumbs = new Dictionary <string, string>
                {
                    { "Queues", Request.LinkTo("/queues") },
                    { Queue.ToUpperInvariant(), Request.LinkTo("/queues/" + Queue) }
                },
                BreadcrumbsTitle = "Fetched jobs",
            };

            int from, perPage;

            int.TryParse(Request.QueryString["from"], out from);
            int.TryParse(Request.QueryString["count"], out perPage);

            var   monitor = JobStorage.Current.GetMonitoringApi();
            Pager pager   = new Pager(from, perPage, monitor.FetchedCount(Queue))
            {
                BasePageUrl = Request.LinkTo("/queues/fetched/" + Queue)
            };

            JobList <FetchedJobDto> fetchedJobs = monitor
                                                  .FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);



            #line default
            #line hidden
            WriteLiteral("\n");



            #line 38 "..\..\Pages\FetchedJobsPage.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"alert alert-info\">\n        The queue is empty.\n    </div>\n");



            #line 43 "..\..\Pages\FetchedJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"js-jobs-list\">\n        <div class=\"btn-toolbar btn-toolbar-top\">\n" +
                             "            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\n        " +
                             "            data-url=\"");



            #line 49 "..\..\Pages\FetchedJobsPage.cshtml"
                Write(Request.LinkTo("/enqueued/requeue"));


            #line default
            #line hidden
                WriteLiteral(@"""
                    data-loading-text=""Enqueueing..."">
                <span class=""glyphicon glyphicon-repeat""></span>
                Requeue jobs
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");



            #line 56 "..\..\Pages\FetchedJobsPage.cshtml"
                Write(Request.LinkTo("/enqueued/delete"));


            #line default
            #line hidden
                WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");



            #line 63 "..\..\Pages\FetchedJobsPage.cshtml"
                Write(RenderPartial(new PerPageSelector(pager)));


            #line default
            #line hidden
                WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th class=""min-width"">State</th>
                    <th>Job</th>
                    <th class=""align-right"">Fetched</th>
                </tr>
            </thead>
            <tbody>
");



            #line 79 "..\..\Pages\FetchedJobsPage.cshtml"
                foreach (var job in fetchedJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <tr class=\"js-jobs-list-row hover\">\n                        <" +
                                 "td>\n                            <input type=\"checkbox\" class=\"js-jobs-list-check" +
                                 "box\" name=\"jobs[]\" value=\"");



            #line 83 "..\..\Pages\FetchedJobsPage.cshtml"
                    Write(job.Key);


            #line default
            #line hidden
                    WriteLiteral("\" />\n                        </td>\n                        <td class=\"min-width\">" +
                                 "\n                            <a href=\"");



            #line 86 "..\..\Pages\FetchedJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">");



            #line 86 "..\..\Pages\FetchedJobsPage.cshtml"
                    Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                    WriteLiteral("</a>\n                        </td>\n                        <td class=\"min-width\">" +
                                 "\n                            <span class=\"label label-default\" style=\"");



            #line 89 "..\..\Pages\FetchedJobsPage.cshtml"
                    Write(JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.Value.State) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.Value.State]) : null);


            #line default
            #line hidden
                    WriteLiteral("\">\n                                ");



            #line 90 "..\..\Pages\FetchedJobsPage.cshtml"
                    Write(job.Value.State);


            #line default
            #line hidden
                    WriteLiteral("\n                            </span>\n                        </td>\n              " +
                                 "          <td>\n                            <a class=\"job-method\" href=\"");



            #line 94 "..\..\Pages\FetchedJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\n                                ");



            #line 95 "..\..\Pages\FetchedJobsPage.cshtml"
                    Write(HtmlHelper.DisplayMethod(job.Value.Job));


            #line default
            #line hidden
                    WriteLiteral("\n                            </a>\n                        </td>\n                 " +
                                 "       <td class=\"align-right\">\n");



            #line 99 "..\..\Pages\FetchedJobsPage.cshtml"
                    if (job.Value.FetchedAt.HasValue)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span data-moment=\"");



            #line 101 "..\..\Pages\FetchedJobsPage.cshtml"
                        Write(JobHelper.ToTimestamp(job.Value.FetchedAt.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\n                                    ");



            #line 102 "..\..\Pages\FetchedJobsPage.cshtml"
                        Write(job.Value.FetchedAt);


            #line default
            #line hidden
                        WriteLiteral("\n                                </span>\n");



            #line 104 "..\..\Pages\FetchedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\n                    </tr>\n");



            #line 107 "..\..\Pages\FetchedJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </tbody>\n        </table>\n    </div>\n");



            #line 111 "..\..\Pages\FetchedJobsPage.cshtml"


            #line default
            #line hidden

            #line 111 "..\..\Pages\FetchedJobsPage.cshtml"
                Write(RenderPartial(new Paginator(pager)));


            #line default
            #line hidden

            #line 111 "..\..\Pages\FetchedJobsPage.cshtml"
            }


            #line default
            #line hidden
        }
        public override void Execute()
        {


WriteLiteral("\n");







            
            #line 7 "..\..\Pages\ProcessingJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Processing Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    var monitor = JobStorage.Current.GetMonitoringApi();
    Pager pager = new Pager(from, perPage, monitor.ProcessingCount())
    {
        BasePageUrl = Request.LinkTo("/processing")
    };

    JobList<ProcessingJobDto> processingJobs = monitor
        .ProcessingJobs(pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\n");


            
            #line 25 "..\..\Pages\ProcessingJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\n        No jobs are being processed right now." +
"\n    </div>\n");


            
            #line 30 "..\..\Pages\ProcessingJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\n        <div class=\"btn-toolbar btn-toolbar-top\">\n" +
"            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\n        " +
"            data-url=\"");


            
            #line 36 "..\..\Pages\ProcessingJobsPage.cshtml"
                         Write(Request.LinkTo("/processing/requeue"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Enqueueing..."">
                <span class=""glyphicon glyphicon-repeat""></span>
                Requeue jobs
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");


            
            #line 43 "..\..\Pages\ProcessingJobsPage.cshtml"
                         Write(Request.LinkTo("/processing/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");


            
            #line 50 "..\..\Pages\ProcessingJobsPage.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th class=""min-width"">Server</th>
                    <th>Job</th>
                    <th class=""align-right"">Started</th>
                </tr>
            </thead>
            <tbody>
");


            
            #line 66 "..\..\Pages\ProcessingJobsPage.cshtml"
                 foreach (var job in processingJobs)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr class=\"js-jobs-list-row ");


            
            #line 68 "..\..\Pages\ProcessingJobsPage.cshtml"
                                            Write(!job.Value.InProcessingState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 68 "..\..\Pages\ProcessingJobsPage.cshtml"
                                                                                                     Write(job.Value.InProcessingState ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\n                        <td>\n");


            
            #line 70 "..\..\Pages\ProcessingJobsPage.cshtml"
                             if (job.Value.InProcessingState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <input type=\"checkbox\" class=\"js-jobs-list-checkb" +
"ox\" name=\"jobs[]\" value=\"");


            
            #line 72 "..\..\Pages\ProcessingJobsPage.cshtml"
                                                                                                     Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\n");


            
            #line 73 "..\..\Pages\ProcessingJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\n                        <td class=\"min-width\">\n    " +
"                        <a href=\"");


            
            #line 76 "..\..\Pages\ProcessingJobsPage.cshtml"
                                Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                ");


            
            #line 77 "..\..\Pages\ProcessingJobsPage.cshtml"
                           Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\n                            </a>\n");


            
            #line 79 "..\..\Pages\ProcessingJobsPage.cshtml"
                             if (!job.Value.InProcessingState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
"etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\n");


            
            #line 82 "..\..\Pages\ProcessingJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\n                        <td class=\"min-width\">\n    " +
"                        ");


            
            #line 85 "..\..\Pages\ProcessingJobsPage.cshtml"
                       Write(job.Value.ServerId.ToUpperInvariant());

            
            #line default
            #line hidden
WriteLiteral("\n                        </td>\n                        <td>\n                     " +
"       <a class=\"job-method\" href=\"");


            
            #line 88 "..\..\Pages\ProcessingJobsPage.cshtml"
                                                   Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                ");


            
            #line 89 "..\..\Pages\ProcessingJobsPage.cshtml"
                           Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\n                            </a>\n                        </td>\n                 " +
"       <td class=\"align-right\">\n");


            
            #line 93 "..\..\Pages\ProcessingJobsPage.cshtml"
                             if (job.Value.StartedAt.HasValue)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span data-moment=\"");


            
            #line 95 "..\..\Pages\ProcessingJobsPage.cshtml"
                                              Write(JobHelper.ToTimestamp(job.Value.StartedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                    ");


            
            #line 96 "..\..\Pages\ProcessingJobsPage.cshtml"
                               Write(job.Value.StartedAt);

            
            #line default
            #line hidden
WriteLiteral("\n                                </span>\n");


            
            #line 98 "..\..\Pages\ProcessingJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\n                    </tr>\n");


            
            #line 101 "..\..\Pages\ProcessingJobsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\n        </table>\n    </div>\n");


            
            #line 105 "..\..\Pages\ProcessingJobsPage.cshtml"
    
            
            #line default
            #line hidden
            
            #line 105 "..\..\Pages\ProcessingJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 105 "..\..\Pages\ProcessingJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
Ejemplo n.º 3
0
        public override void Execute()
        {


WriteLiteral("\r\n");








            
            #line 8 "..\..\Pages\DashboardPage.cshtml"
  
    Layout = new LayoutPage { Title = "Dashboard" };
    IDictionary<DateTime, long> succeeded = null;
    IDictionary<DateTime, long> failed = null;

    var period = Request.QueryString["period"]?? "day";

    var monitor = JobStorage.Current.GetMonitoringApi();
    if ("week".Equals(period, StringComparison.OrdinalIgnoreCase))
    {
        succeeded = monitor.SucceededByDatesCount();
        failed = monitor.FailedByDatesCount();
    }
    else if ("day".Equals(period, StringComparison.OrdinalIgnoreCase))
    {
        succeeded = monitor.HourlySucceededJobs();
        failed = monitor.HourlyFailedJobs();
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n<h3>Realtime graph</h3>\r\n<div id=\"realtimeGraph\"></div>\r\n\r\n<h3>\r\n    <div class" +
"=\"btn-group pull-right\" style=\"margin-top: 2px;\">\r\n        <a href=\"?period=day\"" +
" class=\"btn btn-sm btn-default ");


            
            #line 33 "..\..\Pages\DashboardPage.cshtml"
                                                        Write("day".Equals(period, StringComparison.OrdinalIgnoreCase) ? "active" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n            Day\r\n        </a>\r\n        <a href=\"?period=week\" class=\"btn btn-" +
"sm btn-default ");


            
            #line 36 "..\..\Pages\DashboardPage.cshtml"
                                                         Write("week".Equals(period, StringComparison.OrdinalIgnoreCase) ? "active" : null);

            
            #line default
            #line hidden
WriteLiteral("\">Week</a>\r\n    </div>\r\n    History graph\r\n</h3>\r\n\r\n");


            
            #line 41 "..\..\Pages\DashboardPage.cshtml"
 if (succeeded != null && failed != null)
{

            
            #line default
            #line hidden
WriteLiteral("    <div id=\"historyGraph\" \r\n          data-succeeded=\"");


            
            #line 44 "..\..\Pages\DashboardPage.cshtml"
                     Write(JsonConvert.SerializeObject(succeeded));

            
            #line default
            #line hidden
WriteLiteral("\" \r\n          data-failed=\"");


            
            #line 45 "..\..\Pages\DashboardPage.cshtml"
                  Write(JsonConvert.SerializeObject(failed));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n    </div>\r\n");


            
            #line 47 "..\..\Pages\DashboardPage.cshtml"
}
            
            #line default
            #line hidden

        }
        public override void Execute()
        {


WriteLiteral("\n");








            
            #line 8 "..\..\Pages\DeletedJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Deleted Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    var monitor = JobStorage.Current.GetMonitoringApi();
    Pager pager = new Pager(from, perPage, monitor.DeletedListCount())
    {
        BasePageUrl = Request.LinkTo("/deleted")
    };

    JobList<DeletedJobDto> jobs = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\n");


            
            #line 25 "..\..\Pages\DeletedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\n        No deleted jobs found.\n    </div>\n");


            
            #line 30 "..\..\Pages\DeletedJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\n        <div class=\"btn-toolbar btn-toolbar-top\">\n" +
"            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\n        " +
"            data-url=\"");


            
            #line 36 "..\..\Pages\DeletedJobsPage.cshtml"
                         Write(Request.LinkTo("/deleted/requeue"));

            
            #line default
            #line hidden
WriteLiteral("\"\n                    data-loading-text=\"Enqueueing...\">\n                <span cl" +
"ass=\"glyphicon glyphicon-repeat\"></span>\n                Requeue jobs\n          " +
"  </button>\n            ");


            
            #line 41 "..\..\Pages\DeletedJobsPage.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>
        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th>Job</th>
                    <th class=""align-right"">Deleted</th>
                </tr>
            </thead>
            <tbody>
");


            
            #line 55 "..\..\Pages\DeletedJobsPage.cshtml"
                 foreach (var job in jobs)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr class=\"js-jobs-list-row ");


            
            #line 57 "..\..\Pages\DeletedJobsPage.cshtml"
                                            Write(job.Value != null && !job.Value.InDeletedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 57 "..\..\Pages\DeletedJobsPage.cshtml"
                                                                                                                       Write(job.Value != null && job.Value.InDeletedState && job.Value != null ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\n                        <td>\n");


            
            #line 59 "..\..\Pages\DeletedJobsPage.cshtml"
                             if (job.Value != null && job.Value.InDeletedState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <input type=\"checkbox\" class=\"js-jobs-list-checkb" +
"ox\" name=\"jobs[]\" value=\"");


            
            #line 61 "..\..\Pages\DeletedJobsPage.cshtml"
                                                                                                     Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\n");


            
            #line 62 "..\..\Pages\DeletedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\n                        <td class=\"min-width\">\n    " +
"                        <a href=\"");


            
            #line 65 "..\..\Pages\DeletedJobsPage.cshtml"
                                Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                ");


            
            #line 66 "..\..\Pages\DeletedJobsPage.cshtml"
                           Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\n                            </a>\n");


            
            #line 68 "..\..\Pages\DeletedJobsPage.cshtml"
                             if (job.Value != null && !job.Value.InDeletedState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
"etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\n");


            
            #line 71 "..\..\Pages\DeletedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\n\n");


            
            #line 74 "..\..\Pages\DeletedJobsPage.cshtml"
                         if (job.Value == null)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <td colspan=\"2\">\n                                <em>" +
"Job was expired.</em>\n                            </td>\n");


            
            #line 79 "..\..\Pages\DeletedJobsPage.cshtml"
                        }
                        else
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <td>\n                                <a class=\"job-me" +
"thod\" href=\"");


            
            #line 83 "..\..\Pages\DeletedJobsPage.cshtml"
                                                       Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                    ");


            
            #line 84 "..\..\Pages\DeletedJobsPage.cshtml"
                               Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\n                                </a>\n                            </td>\n");



WriteLiteral("                            <td class=\"align-right\">\n");


            
            #line 88 "..\..\Pages\DeletedJobsPage.cshtml"
                                 if (job.Value.DeletedAt.HasValue)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span data-moment=\"");


            
            #line 90 "..\..\Pages\DeletedJobsPage.cshtml"
                                                  Write(JobHelper.ToTimestamp(job.Value.DeletedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                        ");


            
            #line 91 "..\..\Pages\DeletedJobsPage.cshtml"
                                   Write(job.Value.DeletedAt);

            
            #line default
            #line hidden
WriteLiteral("\n                                    </span>\n");


            
            #line 93 "..\..\Pages\DeletedJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\n");


            
            #line 95 "..\..\Pages\DeletedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </tr>\n");


            
            #line 97 "..\..\Pages\DeletedJobsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\n        </table>\n    </div>\n");


            
            #line 101 "..\..\Pages\DeletedJobsPage.cshtml"
    
            
            #line default
            #line hidden
            
            #line 101 "..\..\Pages\DeletedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 101 "..\..\Pages\DeletedJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
Ejemplo n.º 5
0
        public override void Execute()
        {


WriteLiteral("\r\n");










            
            #line 10 "..\..\Pages\FetchedJobsPage.cshtml"
  
    Layout = new LayoutPage
        {
            Title = Queue.ToUpperInvariant(),
            Subtitle = "Fetched jobs",
            Breadcrumbs = new Dictionary<string, string>
                {
                    { "Queues", Request.LinkTo("/queues") },
                    { Queue.ToUpperInvariant(), Request.LinkTo("/queues/" + Queue) }
                },
            BreadcrumbsTitle = "Fetched jobs",    
        };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<FetchedJobDto> fetchedJobs;
    
    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.FetchedCount(Queue))
        {
            BasePageUrl = Request.LinkTo("/queues/fetched/" + Queue)
        };

        fetchedJobs = monitor
            .FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 43 "..\..\Pages\FetchedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        The queue is empty.\r\n    </div>\r\n");


            
            #line 48 "..\..\Pages\FetchedJobsPage.cshtml"
}
else
{
    
            
            #line default
            #line hidden
            
            #line 51 "..\..\Pages\FetchedJobsPage.cshtml"
Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
            
            #line 51 "..\..\Pages\FetchedJobsPage.cshtml"
                                              
    

            
            #line default
            #line hidden
WriteLiteral(@"    <table class=""table"">
        <thead>
            <tr>
                <th>Id</th>
                <th>State</th>
                <th>Job</th>
                <th>Created</th>
                <th>Fetched</th>
            </tr>
        </thead>
        <tbody>
");


            
            #line 64 "..\..\Pages\FetchedJobsPage.cshtml"
             foreach (var job in fetchedJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr>\r\n                    <td>\r\n                        <a href=\"" +
"");


            
            #line 68 "..\..\Pages\FetchedJobsPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 68 "..\..\Pages\FetchedJobsPage.cshtml"
                                                                Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("</a>\r\n                    </td>\r\n                    <td>\r\n                      " +
"  <span class=\"label label-default\" style=\"");


            
            #line 71 "..\..\Pages\FetchedJobsPage.cshtml"
                                                             Write(JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.Value.State) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.Value.State]) : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 72 "..\..\Pages\FetchedJobsPage.cshtml"
                       Write(job.Value.State);

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n                    </td>\r\n                    <td>\r\n                   " +
"     <span title=\"");


            
            #line 75 "..\..\Pages\FetchedJobsPage.cshtml"
                                Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 76 "..\..\Pages\FetchedJobsPage.cshtml"
                       Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </span>\r\n                    </td>\r\n                   " +
" <td>\r\n");


            
            #line 80 "..\..\Pages\FetchedJobsPage.cshtml"
                         if (job.Value.CreatedAt.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 82 "..\..\Pages\FetchedJobsPage.cshtml"
                                          Write(JobHelper.ToStringTimestamp(job.Value.CreatedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 83 "..\..\Pages\FetchedJobsPage.cshtml"
                           Write(job.Value.CreatedAt);

            
            #line default
            #line hidden
WriteLiteral(" \r\n                            </span>\r\n");


            
            #line 85 "..\..\Pages\FetchedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td>\r\n");


            
            #line 88 "..\..\Pages\FetchedJobsPage.cshtml"
                         if (job.Value.FetchedAt.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 90 "..\..\Pages\FetchedJobsPage.cshtml"
                                          Write(JobHelper.ToStringTimestamp(job.Value.FetchedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 91 "..\..\Pages\FetchedJobsPage.cshtml"
                           Write(job.Value.FetchedAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </span>\r\n");


            
            #line 93 "..\..\Pages\FetchedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 96 "..\..\Pages\FetchedJobsPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 99 "..\..\Pages\FetchedJobsPage.cshtml"
    
    
            
            #line default
            #line hidden
            
            #line 100 "..\..\Pages\FetchedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 100 "..\..\Pages\FetchedJobsPage.cshtml"
                                        
}
            
            #line default
            #line hidden

        }
        public override void Execute()
        {


WriteLiteral("\r\n");










            
            #line 10 "..\..\Pages\FetchedJobsPage.cshtml"
  
    Layout = new LayoutPage
        {
            Title = Queue.ToUpperInvariant(),
            Subtitle = "Fetched jobs",
            Breadcrumbs = new Dictionary<string, string>
                {
                    { "Queues", Request.LinkTo("/queues") },
                    { Queue.ToUpperInvariant(), Request.LinkTo("/queues/" + Queue) }
                },
            BreadcrumbsTitle = "Fetched jobs",
        };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<FetchedJobDto> fetchedJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.FetchedCount(Queue))
        {
            BasePageUrl = Request.LinkTo("/queues/fetched/" + Queue)
        };

        fetchedJobs = monitor
            .FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 43 "..\..\Pages\FetchedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        The queue is empty.\r\n    </div>\r\n");


            
            #line 48 "..\..\Pages\FetchedJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
"\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n     " +
"               data-url=\"");


            
            #line 54 "..\..\Pages\FetchedJobsPage.cshtml"
                         Write(Request.LinkTo("/enqueued/requeue"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Enqueueing..."">
                <span class=""glyphicon glyphicon-repeat""></span>
                Requeue jobs
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");


            
            #line 61 "..\..\Pages\FetchedJobsPage.cshtml"
                         Write(Request.LinkTo("/enqueued/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");


            
            #line 68 "..\..\Pages\FetchedJobsPage.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th class=""min-width"">State</th>
                    <th>Job</th>
                    <th class=""align-right"">Fetched</th>
                </tr>
            </thead>
            <tbody>
");


            
            #line 84 "..\..\Pages\FetchedJobsPage.cshtml"
                 foreach (var job in fetchedJobs)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr class=\"js-jobs-list-row hover\">\r\n                        " +
"<td>\r\n                            <input type=\"checkbox\" class=\"js-jobs-list-che" +
"ckbox\" name=\"jobs[]\" value=\"");


            
            #line 88 "..\..\Pages\FetchedJobsPage.cshtml"
                                                                                                 Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n                        </td>\r\n                        <td class=\"min-width" +
"\">\r\n                            <a href=\"");


            
            #line 91 "..\..\Pages\FetchedJobsPage.cshtml"
                                Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 91 "..\..\Pages\FetchedJobsPage.cshtml"
                                                                    Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("</a>\r\n                        </td>\r\n                        <td class=\"min-width" +
"\">\r\n                            <span class=\"label label-default\" style=\"");


            
            #line 94 "..\..\Pages\FetchedJobsPage.cshtml"
                                                                 Write(JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.Value.State) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.Value.State]) : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 95 "..\..\Pages\FetchedJobsPage.cshtml"
                           Write(job.Value.State);

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </span>\r\n                        </td>\r\n           " +
"             <td>\r\n                            <a class=\"job-method\" href=\"");


            
            #line 99 "..\..\Pages\FetchedJobsPage.cshtml"
                                                   Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 100 "..\..\Pages\FetchedJobsPage.cshtml"
                           Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </a>\r\n                        </td>\r\n              " +
"          <td class=\"align-right\">\r\n");


            
            #line 104 "..\..\Pages\FetchedJobsPage.cshtml"
                             if (job.Value.FetchedAt.HasValue)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span data-moment=\"");


            
            #line 106 "..\..\Pages\FetchedJobsPage.cshtml"
                                              Write(JobHelper.ToStringTimestamp(job.Value.FetchedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 107 "..\..\Pages\FetchedJobsPage.cshtml"
                               Write(job.Value.FetchedAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </span>\r\n");


            
            #line 109 "..\..\Pages\FetchedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                    </tr>\r\n");


            
            #line 112 "..\..\Pages\FetchedJobsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");


            
            #line 116 "..\..\Pages\FetchedJobsPage.cshtml"
    
            
            #line default
            #line hidden
            
            #line 116 "..\..\Pages\FetchedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 116 "..\..\Pages\FetchedJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
        public override void Execute()
        {
            WriteLiteral("\n");



            #line 7 "..\..\Pages\ScheduledJobsPage.cshtml"

            Layout = new LayoutPage {
                Title = "Scheduled Jobs"
            };

            int from, perPage;

            int.TryParse(Request.QueryString["from"], out from);
            int.TryParse(Request.QueryString["count"], out perPage);

            var   monitor = JobStorage.Current.GetMonitoringApi();
            Pager pager   = new Pager(from, perPage, monitor.ScheduledCount())
            {
                BasePageUrl = Request.LinkTo("/scheduled")
            };

            JobList <ScheduledJobDto> scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage);



            #line default
            #line hidden
            WriteLiteral("\n");



            #line 24 "..\..\Pages\ScheduledJobsPage.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"alert alert-info\">\n        There are no scheduled jobs.\n    </div" +
                             ">\n");



            #line 29 "..\..\Pages\ScheduledJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"js-jobs-list\">\n        <div class=\"btn-toolbar btn-toolbar-top\">\n" +
                             "            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\n        " +
                             "            data-url=\"");



            #line 35 "..\..\Pages\ScheduledJobsPage.cshtml"
                Write(Request.LinkTo("/scheduled/enqueue"));


            #line default
            #line hidden
                WriteLiteral(@"""
                    data-loading-text=""Enqueueing..."">
                <span class=""glyphicon glyphicon-play""></span>
                Enqueue now
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");



            #line 42 "..\..\Pages\ScheduledJobsPage.cshtml"
                Write(Request.LinkTo("/scheduled/delete"));


            #line default
            #line hidden
                WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");



            #line 49 "..\..\Pages\ScheduledJobsPage.cshtml"
                Write(RenderPartial(new PerPageSelector(pager)));


            #line default
            #line hidden
                WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th>Enqueue</th>
                    <th>Job</th>
                    <th class=""align-right"">Scheduled</th>
                </tr>
            </thead>
");



            #line 64 "..\..\Pages\ScheduledJobsPage.cshtml"
                foreach (var job in scheduledJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                <tr class=\"js-jobs-list-row ");



            #line 66 "..\..\Pages\ScheduledJobsPage.cshtml"
                    Write(!job.Value.InScheduledState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral(" ");



            #line 66 "..\..\Pages\ScheduledJobsPage.cshtml"
                    Write(job.Value.InScheduledState ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\n                    <td>\n");



            #line 68 "..\..\Pages\ScheduledJobsPage.cshtml"
                    if (job.Value.InScheduledState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <input type=\"checkbox\" class=\"js-jobs-list-checkbox\" " +
                                     "name=\"jobs[]\" value=\"");



            #line 70 "..\..\Pages\ScheduledJobsPage.cshtml"
                        Write(job.Key);


            #line default
            #line hidden
                        WriteLiteral("\" />\n");



            #line 71 "..\..\Pages\ScheduledJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </td>\n                    <td class=\"min-width\">\n            " +
                                 "            <a href=\"");



            #line 74 "..\..\Pages\ScheduledJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\n                            ");



            #line 75 "..\..\Pages\ScheduledJobsPage.cshtml"
                    Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\n                        </a>\n");



            #line 77 "..\..\Pages\ScheduledJobsPage.cshtml"
                    if (!job.Value.InScheduledState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <span title=\"Job\'s state has been changed while fetch" +
                                     "ing data.\" class=\"glyphicon glyphicon-question-sign\"></span>\n");



            #line 80 "..\..\Pages\ScheduledJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </td>\n                    <td class=\"min-width\">\n            " +
                                 "            <span data-moment=\"");



            #line 83 "..\..\Pages\ScheduledJobsPage.cshtml"
                    Write(JobHelper.ToStringTimestamp(job.Value.EnqueueAt));


            #line default
            #line hidden
                    WriteLiteral("\">\n                            ");



            #line 84 "..\..\Pages\ScheduledJobsPage.cshtml"
                    Write(job.Value.EnqueueAt);


            #line default
            #line hidden
                    WriteLiteral("\n                        </span>\n                    </td>\n                    <t" +
                                 "d>\n                        <a class=\"job-method\" href=\"");



            #line 88 "..\..\Pages\ScheduledJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\n                            ");



            #line 89 "..\..\Pages\ScheduledJobsPage.cshtml"
                    Write(HtmlHelper.DisplayMethod(job.Value.Job));


            #line default
            #line hidden
                    WriteLiteral("\n                        </a>\n                    </td>\n                    <td c" +
                                 "lass=\"align-right\">\n");



            #line 93 "..\..\Pages\ScheduledJobsPage.cshtml"
                    if (job.Value.ScheduledAt != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <span data-moment=\"");



            #line 95 "..\..\Pages\ScheduledJobsPage.cshtml"
                        Write(JobHelper.ToStringTimestamp(job.Value.ScheduledAt.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\n                                ");



            #line 96 "..\..\Pages\ScheduledJobsPage.cshtml"
                        Write(job.Value.ScheduledAt);


            #line default
            #line hidden
                        WriteLiteral("\n                            </span>\n");



            #line 98 "..\..\Pages\ScheduledJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </td>\n                </tr>\n");



            #line 101 "..\..\Pages\ScheduledJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("        </table>\n    </div>\n");



            #line 104 "..\..\Pages\ScheduledJobsPage.cshtml"



            #line default
            #line hidden

            #line 105 "..\..\Pages\ScheduledJobsPage.cshtml"
                Write(RenderPartial(new Paginator(pager)));


            #line default
            #line hidden

            #line 105 "..\..\Pages\ScheduledJobsPage.cshtml"
            }


            #line default
            #line hidden
        }
        public override void Execute()
        {


WriteLiteral("\r\n");












            
            #line 12 "..\..\Pages\RecurringJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Recurring jobs" };


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 16 "..\..\Pages\RecurringJobsPage.cshtml"
 if (RecurringJobs.Count == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        No recurring jobs found.\r\n    </div>\r" +
"\n");


            
            #line 21 "..\..\Pages\RecurringJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
"\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n     " +
"               data-url=\"");


            
            #line 27 "..\..\Pages\RecurringJobsPage.cshtml"
                         Write(Request.LinkTo("/recurring/trigger"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Triggering..."">
                <span class=""glyphicon glyphicon-play-circle""></span>
                Trigger now
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");


            
            #line 34 "..\..\Pages\RecurringJobsPage.cshtml"
                         Write(Request.LinkTo("/recurring/remove"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Removing...""
                    data-confirm=""Do you really want to REMOVE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Remove
            </button>
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th class=""min-width"">Cron</th>
                    <th>Job</th>
                    <th class=""align-right min-width"">Next execution</th>
                    <th class=""align-right min-width"">Last execution</th>
                </tr>
            </thead>
            <tbody>
");


            
            #line 56 "..\..\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 type=\"checkbox\" class=\"js-jobs-list-che" +
"ckbox\" name=\"jobs[]\" value=\"");


            
            #line 60 "..\..\Pages\RecurringJobsPage.cshtml"
                                                                                                 Write(job.Id);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n                        </td>\r\n                        <td class=\"min-width" +
"\">");


            
            #line 62 "..\..\Pages\RecurringJobsPage.cshtml"
                                         Write(job.Id);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                        <td class=\"min-width\">");


            
            #line 63 "..\..\Pages\RecurringJobsPage.cshtml"
                                          Write(CronExpressionDescriptor.ExpressionDescriptor.GetDescription(job.Cron));

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                        <td>\r\n");


            
            #line 65 "..\..\Pages\RecurringJobsPage.cshtml"
                             if (job.Job != null)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                ");

WriteLiteral(" ");


            
            #line 67 "..\..\Pages\RecurringJobsPage.cshtml"
                              Write(HtmlHelper.DisplayMethod(job.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 68 "..\..\Pages\RecurringJobsPage.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <em>");


            
            #line 71 "..\..\Pages\RecurringJobsPage.cshtml"
                               Write(job.LoadException.InnerException.Message);

            
            #line default
            #line hidden
WriteLiteral("</em>\r\n");


            
            #line 72 "..\..\Pages\RecurringJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td class=\"align-right min" +
"-width\">\r\n");


            
            #line 75 "..\..\Pages\RecurringJobsPage.cshtml"
                             if (job.NextExecution != null)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span data-moment=\"");


            
            #line 77 "..\..\Pages\RecurringJobsPage.cshtml"
                                               Write(JobHelper.SerializeDateTime(job.NextExecution.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 78 "..\..\Pages\RecurringJobsPage.cshtml"
                               Write(job.NextExecution.Value);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </span>\r\n");


            
            #line 80 "..\..\Pages\RecurringJobsPage.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <em>N/A</em>\r\n");


            
            #line 84 "..\..\Pages\RecurringJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td class=\"align-right min" +
"-width\">\r\n");


            
            #line 87 "..\..\Pages\RecurringJobsPage.cshtml"
                             if (job.LastExecution != null)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <a href=\"");


            
            #line 89 "..\..\Pages\RecurringJobsPage.cshtml"
                                    Write(Request.LinkTo("/job/" + job.LastJobId));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    <span class=\"label label-default label-ho" +
"ver\" data-moment=\"");


            
            #line 90 "..\..\Pages\RecurringJobsPage.cshtml"
                                                                                           Write(JobHelper.SerializeDateTime(job.LastExecution.Value));

            
            #line default
            #line hidden
WriteLiteral("\" style=\"");


            
            #line 90 "..\..\Pages\RecurringJobsPage.cshtml"
                                                                                                                                                           Write(job.LastJobState != null && JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.LastJobState) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.LastJobState]) : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                        ");


            
            #line 91 "..\..\Pages\RecurringJobsPage.cshtml"
                                   Write(job.LastExecution.Value);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                    </span>\r\n                                </" +
"a>\r\n");


            
            #line 94 "..\..\Pages\RecurringJobsPage.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <em>N/A</em>\r\n");


            
            #line 98 "..\..\Pages\RecurringJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                    </tr>\r\n");


            
            #line 101 "..\..\Pages\RecurringJobsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");


            
            #line 105 "..\..\Pages\RecurringJobsPage.cshtml"
}

            
            #line default
            #line hidden
WriteLiteral("    ");


        }
Ejemplo n.º 9
0
        public override void Execute()
        {


WriteLiteral("\r\n");








            
            #line 8 "..\..\Pages\FailedJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Failed Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<FailedJobDto> failedJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.FailedCount())
        {
            BasePageUrl = Request.LinkTo("/failed")
        };

        failedJobs = monitor
            .FailedJobs(pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 31 "..\..\Pages\FailedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-success\">\r\n        You have no failed jobs at the mom" +
"ent.\r\n    </div>\r\n");


            
            #line 36 "..\..\Pages\FailedJobsPage.cshtml"
}
else
{
    
            
            #line default
            #line hidden
            
            #line 39 "..\..\Pages\FailedJobsPage.cshtml"
Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
            
            #line 39 "..\..\Pages\FailedJobsPage.cshtml"
                                              
    

            
            #line default
            #line hidden
WriteLiteral("    <table class=\"table failed-table\">\r\n        <thead>\r\n            <tr>\r\n      " +
"          <th>Id</th>\r\n                <th>Failed</th>\r\n                <th>Job<" +
"/th>\r\n                <th></th>\r\n            </tr>\r\n        </thead>\r\n        <t" +
"body>\r\n");


            
            #line 51 "..\..\Pages\FailedJobsPage.cshtml"
               var index = 0; 

            
            #line default
            #line hidden

            
            #line 52 "..\..\Pages\FailedJobsPage.cshtml"
             foreach (var job in failedJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr class=\"");


            
            #line 54 "..\..\Pages\FailedJobsPage.cshtml"
                       Write(!job.Value.InFailedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <td rowspan=\"");


            
            #line 55 "..\..\Pages\FailedJobsPage.cshtml"
                             Write(job.Value.InFailedState ? "2" : "1");

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <a href=\"");


            
            #line 56 "..\..\Pages\FailedJobsPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 57 "..\..\Pages\FailedJobsPage.cshtml"
                       Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n");


            
            #line 59 "..\..\Pages\FailedJobsPage.cshtml"
                         if (!job.Value.InFailedState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span title=\"Job\'s state has been changed while fetch" +
"ing data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 62 "..\..\Pages\FailedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td>\r\n");


            
            #line 65 "..\..\Pages\FailedJobsPage.cshtml"
                         if (job.Value.FailedAt.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 67 "..\..\Pages\FailedJobsPage.cshtml"
                                          Write(JobHelper.ToStringTimestamp(job.Value.FailedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 68 "..\..\Pages\FailedJobsPage.cshtml"
                           Write(job.Value.FailedAt);

            
            #line default
            #line hidden
WriteLiteral("        \r\n                            </span>\r\n");


            
            #line 70 "..\..\Pages\FailedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td class=\"");


            
            #line 72 "..\..\Pages\FailedJobsPage.cshtml"
                           Write(job.Value.InFailedState ? "expander" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <div>\r\n                            <span title=\"");


            
            #line 74 "..\..\Pages\FailedJobsPage.cshtml"
                                    Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 75 "..\..\Pages\FailedJobsPage.cshtml"
                           Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </span>\r\n                        </div>\r\n");


            
            #line 78 "..\..\Pages\FailedJobsPage.cshtml"
                         if (!String.IsNullOrEmpty(job.Value.ExceptionMessage))
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <div style=\"color: #888;\">\r\n                         " +
"       ");


            
            #line 81 "..\..\Pages\FailedJobsPage.cshtml"
                           Write(job.Value.Reason);

            
            #line default
            #line hidden
WriteLiteral(" <span class=\"caret\"></span>\r\n                            </div>\r\n");


            
            #line 83 "..\..\Pages\FailedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td>\r\n");


            
            #line 86 "..\..\Pages\FailedJobsPage.cshtml"
                         if (job.Value.InFailedState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <div class=\"pull-right\">\r\n                           " +
"     <button class=\"btn btn-primary btn-sm\" data-ajax=\"");


            
            #line 89 "..\..\Pages\FailedJobsPage.cshtml"
                                                                             Write(Request.LinkTo("/failed/retry/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\" data-loading-text=\"Retrying...\">\r\n                                    <span cla" +
"ss=\"glyphicon glyphicon-repeat\"></span>\r\n                                    Ret" +
"ry\r\n                                </button>\r\n                            </div" +
">\r\n");


            
            #line 94 "..\..\Pages\FailedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 97 "..\..\Pages\FailedJobsPage.cshtml"
                if (job.Value.InFailedState)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr>\r\n                        <td colspan=\"4\" class=\"failed-j" +
"ob-details\">\r\n                            <div class=\"expandable\" style=\"");


            
            #line 101 "..\..\Pages\FailedJobsPage.cshtml"
                                                       Write(index++ == 0 ? "display: block;" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                <h4>");


            
            #line 102 "..\..\Pages\FailedJobsPage.cshtml"
                               Write(job.Value.ExceptionType);

            
            #line default
            #line hidden
WriteLiteral("</h4>\r\n                                <p>\r\n                                    ");


            
            #line 104 "..\..\Pages\FailedJobsPage.cshtml"
                               Write(job.Value.ExceptionMessage);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </p>\r\n                        \r\n");


            
            #line 107 "..\..\Pages\FailedJobsPage.cshtml"
                                 if (!String.IsNullOrEmpty(job.Value.ExceptionDetails))
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <pre class=\"stack-trace\">");


            
            #line 109 "..\..\Pages\FailedJobsPage.cshtml"
                                                        Write(HtmlHelper.MarkupStackTrace(job.Value.ExceptionDetails));

            
            #line default
            #line hidden
WriteLiteral("</pre>\r\n");


            
            #line 110 "..\..\Pages\FailedJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </div>\r\n                        </td>\r\n              " +
"      </tr>\r\n");


            
            #line 114 "..\..\Pages\FailedJobsPage.cshtml"
                }
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 118 "..\..\Pages\FailedJobsPage.cshtml"
    
    
            
            #line default
            #line hidden
            
            #line 119 "..\..\Pages\FailedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 119 "..\..\Pages\FailedJobsPage.cshtml"
                                        
}
            
            #line default
            #line hidden

        }
        public override void Execute()
        {


WriteLiteral("\r\n");











            
            #line 11 "..\..\Pages\JobDetailsPage.cshtml"
  
    JobDetailsDto job;
    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        job = monitor.JobDetails(JobId.ToString());
    }

    string title = null;

    if (job != null)
    {
        title = job.Job != null ? String.Format("{0}.{1}", job.Job.Type.Name, job.Job.Method.Name) : null;
    }

    title = title ?? "Job";

    Layout = new LayoutPage { Title = title };


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 30 "..\..\Pages\JobDetailsPage.cshtml"
 if (job == null)
{

            
            #line default
            #line hidden
WriteLiteral("    ");

WriteLiteral(" The job with id \'");


            
            #line 32 "..\..\Pages\JobDetailsPage.cshtml"
                   Write(JobId);

            
            #line default
            #line hidden
WriteLiteral("\' was expired or was not existed on the server.\r\n");


            
            #line 33 "..\..\Pages\JobDetailsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"job-snippet-header\">\r\n        <span class=\"job-snippet-tab\">\r\n   " +
"         Job ID: <span class=\"job-snippet-id\">");


            
            #line 38 "..\..\Pages\JobDetailsPage.cshtml"
                                            Write(HtmlHelper.JobId(JobId.ToString(), false));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n        </span>\r\n\r\n        <span class=\"job-snippet-buttons pull-right\">" +
"\r\n            <button class=\"btn btn-xs btn-default\" data-ajax=\"");


            
            #line 42 "..\..\Pages\JobDetailsPage.cshtml"
                                                         Write(Request.LinkTo("/actions/requeue/" + JobId));

            
            #line default
            #line hidden
WriteLiteral("\" data-loading-text=\"Enqueueing...\">Requeue</button>\r\n            <button class=\"" +
"btn btn-xs btn-death\" data-ajax=\"");


            
            #line 43 "..\..\Pages\JobDetailsPage.cshtml"
                                                       Write(Request.LinkTo("/actions/delete/" + JobId));

            
            #line default
            #line hidden
WriteLiteral("\" data-loading-text=\"Deleting...\" data-confirm=\"Do you really want to delete this" +
" job?\">Delete</button>\r\n        </span>\r\n\r\n        <div class=\"clearfix\"></div>\r" +
"\n    </div>\r\n");



WriteLiteral("    <div class=\"job-snippet\">\r\n        <div class=\"job-snippet-code\">\r\n");


            
            #line 50 "..\..\Pages\JobDetailsPage.cshtml"
             if (job.CreatedAt.HasValue)
            {

            
            #line default
            #line hidden
WriteLiteral("                <div class=\"pull-right job-creation-date\">\r\n                    C" +
"reated\r\n                    <span data-moment=\"");


            
            #line 54 "..\..\Pages\JobDetailsPage.cshtml"
                                  Write(JobHelper.ToStringTimestamp(job.CreatedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\"></span>\r\n                </div>\r\n");


            
            #line 56 "..\..\Pages\JobDetailsPage.cshtml"
            }

            
            #line default
            #line hidden

            
            #line 57 "..\..\Pages\JobDetailsPage.cshtml"
             if (job != null)
            {

            
            #line default
            #line hidden
WriteLiteral("                <pre><code>");


            
            #line 59 "..\..\Pages\JobDetailsPage.cshtml"
                      Write(JobMethodCallRenderer.Render(job.Job));

            
            #line default
            #line hidden
WriteLiteral("</code></pre>\r\n");


            
            #line 60 "..\..\Pages\JobDetailsPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"clearfix\"></div>\r\n        </div>\r\n\r\n");


            
            #line 64 "..\..\Pages\JobDetailsPage.cshtml"
         if (job.Properties.Count > 0)
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"job-snippet-properties\">\r\n                <dl>\r\n");


            
            #line 68 "..\..\Pages\JobDetailsPage.cshtml"
                     foreach (var property in job.Properties)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <dt>");


            
            #line 70 "..\..\Pages\JobDetailsPage.cshtml"
                       Write(property.Key);

            
            #line default
            #line hidden
WriteLiteral("</dt>\r\n");



WriteLiteral("                        <dd>\r\n                            <pre>");


            
            #line 72 "..\..\Pages\JobDetailsPage.cshtml"
                            Write(property.Value);

            
            #line default
            #line hidden
WriteLiteral("</pre>\r\n                        </dd>\r\n");


            
            #line 74 "..\..\Pages\JobDetailsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </dl>\r\n            </div>\r\n");


            
            #line 77 "..\..\Pages\JobDetailsPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </div>\r\n");


            
            #line 79 "..\..\Pages\JobDetailsPage.cshtml"

    if (job.History.Count > 0)
    {

            
            #line default
            #line hidden
WriteLiteral("        <h3>History</h3>\r\n");


            
            #line 83 "..\..\Pages\JobDetailsPage.cshtml"
        var index = 0;

        DateTime[] entriesCreationTime = job.History.Select(x => x.CreatedAt).ToArray();
        var nextEntry = 1;
        
        foreach (var entry in job.History)
        {
            var background = JobHistoryRenderer.BackgroundStateColors.ContainsKey(entry.StateName)
               ? JobHistoryRenderer.BackgroundStateColors[entry.StateName]
               : null;

            if (index == 0)
            {
                background = JobHistoryRenderer.ForegroundStateColors.ContainsKey(entry.StateName)
                    ? JobHistoryRenderer.ForegroundStateColors[entry.StateName]
                    : null;
            }


            
            #line default
            #line hidden
WriteLiteral("            <div class=\"job-history ");


            
            #line 101 "..\..\Pages\JobDetailsPage.cshtml"
                                Write(index == 0 ? "job-history-current" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                <div class=\"job-history-heading\" style=\"");


            
            #line 102 "..\..\Pages\JobDetailsPage.cshtml"
                                                    Write(background != null ? String.Format("background-color: {0};", background) : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <span class=\"pull-right\" data-moment-title=\"");


            
            #line 103 "..\..\Pages\JobDetailsPage.cshtml"
                                                            Write(JobHelper.ToStringTimestamp(entry.CreatedAt));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        ");


            
            #line 104 "..\..\Pages\JobDetailsPage.cshtml"
                   Write(HtmlHelper.ToHumanDuration(entry.CreatedAt - (nextEntry < entriesCreationTime.Length ? entriesCreationTime[nextEntry] : job.CreatedAt)));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 105 "..\..\Pages\JobDetailsPage.cshtml"
                           nextEntry++; 

            
            #line default
            #line hidden
WriteLiteral("                    </span>\r\n                    <h4 class=\"job-history-title\">\r\n" +
"                        ");


            
            #line 108 "..\..\Pages\JobDetailsPage.cshtml"
                   Write(entry.StateName);

            
            #line default
            #line hidden
WriteLiteral("\r\n\r\n");


            
            #line 110 "..\..\Pages\JobDetailsPage.cshtml"
                         if (!String.IsNullOrWhiteSpace(entry.Reason))
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <small>");


            
            #line 112 "..\..\Pages\JobDetailsPage.cshtml"
                              Write(entry.Reason);

            
            #line default
            #line hidden
WriteLiteral("</small>\r\n");


            
            #line 113 "..\..\Pages\JobDetailsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </h4>\r\n                </div>\r\n\r\n");


            
            #line 117 "..\..\Pages\JobDetailsPage.cshtml"
                 if (JobHistoryRenderer.Exists(entry.StateName))
                {
                    var rendered = JobHistoryRenderer.Render(entry.StateName, entry.Data);
                    if (rendered != null)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <div class=\"job-history-body\">\r\n                         " +
"   ");


            
            #line 123 "..\..\Pages\JobDetailsPage.cshtml"
                       Write(rendered);

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </div>\r\n");


            
            #line 125 "..\..\Pages\JobDetailsPage.cshtml"
                    }
                }
                else
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div class=\"job-history-body\">\r\n                        <dl c" +
"lass=\"dl-horizontal\">\r\n");


            
            #line 131 "..\..\Pages\JobDetailsPage.cshtml"
                             foreach (var item in entry.Data)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <dt>");


            
            #line 133 "..\..\Pages\JobDetailsPage.cshtml"
                               Write(item.Key);

            
            #line default
            #line hidden
WriteLiteral(":</dt>\r\n");



WriteLiteral("                                <dd>");


            
            #line 134 "..\..\Pages\JobDetailsPage.cshtml"
                               Write(item.Value);

            
            #line default
            #line hidden
WriteLiteral("</dd>\r\n");


            
            #line 135 "..\..\Pages\JobDetailsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </dl>\r\n                    </div>\r\n");


            
            #line 138 "..\..\Pages\JobDetailsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </div>\r\n");


            
            #line 140 "..\..\Pages\JobDetailsPage.cshtml"

                index++;
        }
    }
}
            
            #line default
            #line hidden

        }
Ejemplo n.º 11
0
        public override void Execute()
        {


WriteLiteral("\r\n");









            
            #line 9 "..\..\Pages\QueuesPage.cshtml"
  
    Layout = new LayoutPage { Title = "Queues" };

    IList<QueueWithTopEnqueuedJobsDto> queues;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        queues = monitor.Queues();
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 20 "..\..\Pages\QueuesPage.cshtml"
 if (queues.Count == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-warning\">\r\n        No queued jobs found. Try to enque" +
"ue a job.\r\n    </div>\r\n");


            
            #line 25 "..\..\Pages\QueuesPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral(@"    <table class=""table table-striped"">
        <thead>
            <tr>
                <th>Queue</th>
                <th>Length</th>
                <th>Fetched</th>
                <th>Next jobs</th>
            </tr>
        </thead>
        <tbody>
");


            
            #line 38 "..\..\Pages\QueuesPage.cshtml"
             foreach (var queue in queues)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr>\r\n                    <td>\r\n                        <a class=" +
"\"label-queue\" href=\"");


            
            #line 42 "..\..\Pages\QueuesPage.cshtml"
                                                Write(Request.LinkTo("/queues/" + queue.Name));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 43 "..\..\Pages\QueuesPage.cshtml"
                       Write(queue.Name);

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n                    </td>\r\n                    <t" +
"d>");


            
            #line 46 "..\..\Pages\QueuesPage.cshtml"
                   Write(queue.Length);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                    <td>\r\n                        <a href=\"");


            
            #line 48 "..\..\Pages\QueuesPage.cshtml"
                            Write(Request.LinkTo("/queues/fetched/" + queue.Name));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 49 "..\..\Pages\QueuesPage.cshtml"
                       Write(queue.Fetched);

            
            #line default
            #line hidden

            
            #line 49 "..\..\Pages\QueuesPage.cshtml"
                                          WriteLiteral("    \r\n                        </a>\r\n                    </td>\r\n                  " +
"  <td>");

            
            #line default
            #line hidden
            
            #line 52 "..\..\Pages\QueuesPage.cshtml"
                         if (queue.FirstJobs.Count == 0)
                        {

            
            #line default
            #line hidden
WriteLiteral("                        <em>No jobs queued.</em>\r\n");


            
            #line 55 "..\..\Pages\QueuesPage.cshtml"
                        }
                        else
                        {

            
            #line default
            #line hidden
WriteLiteral(@"                        <table class=""table table-condensed table-bordered table-inner"">
                            <thead>
                                <tr>
                                    <th>Id</th>
                                    <th>Job</th>
                                    <th>Enqueued</th>
                                </tr>
                            </thead>
                            <tbody>
");


            
            #line 67 "..\..\Pages\QueuesPage.cshtml"
                                 foreach (var job in queue.FirstJobs)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <tr class=\"");


            
            #line 69 "..\..\Pages\QueuesPage.cshtml"
                                           Write(!job.Value.InEnqueuedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                        <td>\r\n                               " +
"             <a href=\"");


            
            #line 71 "..\..\Pages\QueuesPage.cshtml"
                                                Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 71 "..\..\Pages\QueuesPage.cshtml"
                                                                                    Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("</a>\r\n");


            
            #line 72 "..\..\Pages\QueuesPage.cshtml"
                                             if (!job.Value.InEnqueuedState)
                                            {

            
            #line default
            #line hidden
WriteLiteral("                                                <span title=\"Job\'s state has been" +
" changed while fetching data.\" class=\"glyphicon glyphicon-question-sign\"></span>" +
"\r\n");


            
            #line 75 "..\..\Pages\QueuesPage.cshtml"
                                            }

            
            #line default
            #line hidden
WriteLiteral("                                        </td>\r\n                                  " +
"      <td>\r\n                                            <span title=\"");


            
            #line 78 "..\..\Pages\QueuesPage.cshtml"
                                                    Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                                ");


            
            #line 79 "..\..\Pages\QueuesPage.cshtml"
                                           Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                            </span>\r\n                          " +
"              </td>\r\n                                        <td>\r\n");


            
            #line 83 "..\..\Pages\QueuesPage.cshtml"
                                             if (job.Value.EnqueuedAt.HasValue)
                                            {

            
            #line default
            #line hidden
WriteLiteral("                                                <span data-moment=\"");


            
            #line 85 "..\..\Pages\QueuesPage.cshtml"
                                                              Write(JobHelper.ToStringTimestamp(job.Value.EnqueuedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                                    ");


            
            #line 86 "..\..\Pages\QueuesPage.cshtml"
                                               Write(job.Value.EnqueuedAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                                </span>\r\n");


            
            #line 88 "..\..\Pages\QueuesPage.cshtml"
                                            }

            
            #line default
            #line hidden
WriteLiteral("                                        </td>\r\n                                  " +
"  </tr>\r\n");


            
            #line 91 "..\..\Pages\QueuesPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </tbody>\r\n                        </table>\r\n");


            
            #line 94 "..\..\Pages\QueuesPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 97 "..\..\Pages\QueuesPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 100 "..\..\Pages\QueuesPage.cshtml"
}
            
            #line default
            #line hidden

        }
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\Pages\ScheduledJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Scheduled Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<ScheduledJobDto> scheduledJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.ScheduledCount())
        {
            BasePageUrl = Request.LinkTo("/scheduled")
        };

        scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 29 "..\..\Pages\ScheduledJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        There are no scheduled jobs.\r\n    </d" +
"iv>\r\n");


            
            #line 34 "..\..\Pages\ScheduledJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
"\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n     " +
"               data-url=\"");


            
            #line 40 "..\..\Pages\ScheduledJobsPage.cshtml"
                         Write(Request.LinkTo("/scheduled/enqueue"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Enqueueing..."">
                <span class=""glyphicon glyphicon-play""></span>
                Enqueue now
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");


            
            #line 47 "..\..\Pages\ScheduledJobsPage.cshtml"
                         Write(Request.LinkTo("/scheduled/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");


            
            #line 54 "..\..\Pages\ScheduledJobsPage.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th>Enqueue</th>
                    <th>Job</th>
                    <th class=""align-right"">Scheduled</th>
                </tr>
            </thead>
");


            
            #line 69 "..\..\Pages\ScheduledJobsPage.cshtml"
             foreach (var job in scheduledJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr class=\"js-jobs-list-row ");


            
            #line 71 "..\..\Pages\ScheduledJobsPage.cshtml"
                                        Write(!job.Value.InScheduledState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 71 "..\..\Pages\ScheduledJobsPage.cshtml"
                                                                                                Write(job.Value.InScheduledState ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <td>\r\n");


            
            #line 73 "..\..\Pages\ScheduledJobsPage.cshtml"
                         if (job.Value.InScheduledState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <input type=\"checkbox\" class=\"js-jobs-list-checkbox\" " +
"name=\"jobs[]\" value=\"");


            
            #line 75 "..\..\Pages\ScheduledJobsPage.cshtml"
                                                                                                 Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n");


            
            #line 76 "..\..\Pages\ScheduledJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td class=\"min-width\">\r\n          " +
"              <a href=\"");


            
            #line 79 "..\..\Pages\ScheduledJobsPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 80 "..\..\Pages\ScheduledJobsPage.cshtml"
                       Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n");


            
            #line 82 "..\..\Pages\ScheduledJobsPage.cshtml"
                         if (!job.Value.InScheduledState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span title=\"Job\'s state has been changed while fetch" +
"ing data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 85 "..\..\Pages\ScheduledJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td class=\"min-width\">\r\n          " +
"              <span data-moment=\"");


            
            #line 88 "..\..\Pages\ScheduledJobsPage.cshtml"
                                      Write(JobHelper.ToStringTimestamp(job.Value.EnqueueAt));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 89 "..\..\Pages\ScheduledJobsPage.cshtml"
                       Write(job.Value.EnqueueAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </span>\r\n                    </td>\r\n                   " +
" <td>\r\n                        <a class=\"job-method\" href=\"");


            
            #line 93 "..\..\Pages\ScheduledJobsPage.cshtml"
                                               Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 94 "..\..\Pages\ScheduledJobsPage.cshtml"
                       Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n                    </td>\r\n                    <t" +
"d class=\"align-right\">\r\n");


            
            #line 98 "..\..\Pages\ScheduledJobsPage.cshtml"
                         if (job.Value.ScheduledAt != null)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 100 "..\..\Pages\ScheduledJobsPage.cshtml"
                                          Write(JobHelper.ToStringTimestamp(job.Value.ScheduledAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 101 "..\..\Pages\ScheduledJobsPage.cshtml"
                           Write(job.Value.ScheduledAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </span>\r\n");


            
            #line 103 "..\..\Pages\ScheduledJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 106 "..\..\Pages\ScheduledJobsPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </table>\r\n    </div>\r\n");


            
            #line 109 "..\..\Pages\ScheduledJobsPage.cshtml"

    
            
            #line default
            #line hidden
            
            #line 110 "..\..\Pages\ScheduledJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 110 "..\..\Pages\ScheduledJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
        public override void Execute()
        {


WriteLiteral("\r\n");









            
            #line 9 "..\..\Pages\SucceededJobs.cshtml"
  
    Layout = new LayoutPage { Title = "Succeeded Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<SucceededJobDto> succeededJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.SucceededListCount())
        {
            BasePageUrl = Request.LinkTo("/succeeded")
        };

        succeededJobs = monitor
            .SucceededJobs(pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 32 "..\..\Pages\SucceededJobs.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        No succeeded jobs found.\r\n    </div>\r" +
"\n");


            
            #line 37 "..\..\Pages\SucceededJobs.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
"\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n     " +
"               data-url=\"");


            
            #line 43 "..\..\Pages\SucceededJobs.cshtml"
                         Write(Request.LinkTo("/succeeded/requeue"));

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                    data-loading-text=\"Enqueueing...\">\r\n                <span " +
"class=\"glyphicon glyphicon-repeat\"></span>\r\n                Requeue jobs\r\n      " +
"      </button>\r\n\r\n            ");


            
            #line 49 "..\..\Pages\SucceededJobs.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th>Job</th>
                    <th class=""min-width"">Total Duration</th>
                    <th class=""align-right"">Succeeded</th>
                </tr>
            </thead>
            <tbody>
");


            
            #line 65 "..\..\Pages\SucceededJobs.cshtml"
                 foreach (var job in succeededJobs)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr class=\"js-jobs-list-row ");


            
            #line 67 "..\..\Pages\SucceededJobs.cshtml"
                                            Write(job.Value != null && !job.Value.InSucceededState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 67 "..\..\Pages\SucceededJobs.cshtml"
                                                                                                                         Write(job.Value != null && job.Value.InSucceededState ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <td>\r\n");


            
            #line 69 "..\..\Pages\SucceededJobs.cshtml"
                             if (job.Value != null && job.Value.InSucceededState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <input type=\"checkbox\" class=\"js-jobs-list-checkb" +
"ox\" name=\"jobs[]\" value=\"");


            
            #line 71 "..\..\Pages\SucceededJobs.cshtml"
                                                                                                     Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n");


            
            #line 72 "..\..\Pages\SucceededJobs.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n  " +
"                          <a href=\"");


            
            #line 75 "..\..\Pages\SucceededJobs.cshtml"
                                Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 76 "..\..\Pages\SucceededJobs.cshtml"
                           Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </a>\r\n");


            
            #line 78 "..\..\Pages\SucceededJobs.cshtml"
                             if (job.Value != null && !job.Value.InSucceededState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
"etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 81 "..\..\Pages\SucceededJobs.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n\r\n");


            
            #line 84 "..\..\Pages\SucceededJobs.cshtml"
                         if (job.Value == null)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <td colspan=\"3\">\r\n                                <em" +
">Job was expired.</em>\r\n                            </td>\r\n");


            
            #line 89 "..\..\Pages\SucceededJobs.cshtml"
                        }
                        else
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <td>\r\n                                <a class=\"job-m" +
"ethod\" href=\"");


            
            #line 93 "..\..\Pages\SucceededJobs.cshtml"
                                                       Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 94 "..\..\Pages\SucceededJobs.cshtml"
                               Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </a>\r\n                            </td>\r\n");



WriteLiteral("                            <td class=\"min-width align-right\">\r\n");


            
            #line 98 "..\..\Pages\SucceededJobs.cshtml"
                                 if (job.Value.TotalDuration.HasValue)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    ");

WriteLiteral(" ");


            
            #line 100 "..\..\Pages\SucceededJobs.cshtml"
                                  Write(HtmlHelper.ToHumanDuration(TimeSpan.FromMilliseconds(job.Value.TotalDuration.Value) , false));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 101 "..\..\Pages\SucceededJobs.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n");



WriteLiteral("                            <td class=\"min-width align-right\">\r\n");


            
            #line 104 "..\..\Pages\SucceededJobs.cshtml"
                                 if (job.Value.SucceededAt.HasValue)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span data-moment=\"");


            
            #line 106 "..\..\Pages\SucceededJobs.cshtml"
                                                  Write(JobHelper.ToStringTimestamp(job.Value.SucceededAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                        ");


            
            #line 107 "..\..\Pages\SucceededJobs.cshtml"
                                   Write(job.Value.SucceededAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                    </span>\r\n");


            
            #line 109 "..\..\Pages\SucceededJobs.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n");


            
            #line 111 "..\..\Pages\SucceededJobs.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </tr>\r\n");


            
            #line 113 "..\..\Pages\SucceededJobs.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");


            
            #line 117 "..\..\Pages\SucceededJobs.cshtml"
    
            
            #line default
            #line hidden
            
            #line 117 "..\..\Pages\SucceededJobs.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 117 "..\..\Pages\SucceededJobs.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
Ejemplo n.º 14
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 9 "..\..\Pages\SucceededJobs.cshtml"

            Layout = new LayoutPage {
                Title = "Succeeded Jobs"
            };

            int from, perPage;

            int.TryParse(Request.QueryString["from"], out from);
            int.TryParse(Request.QueryString["count"], out perPage);

            Pager pager;
            JobList <SucceededJobDto> succeededJobs;

            using (var monitor = JobStorage.Current.GetMonitoringApi())
            {
                pager = new Pager(from, perPage, monitor.SucceededListCount())
                {
                    BasePageUrl = Request.LinkTo("/succeeded")
                };

                succeededJobs = monitor
                                .SucceededJobs(pager.FromRecord, pager.RecordsPerPage);
            }



            #line default
            #line hidden
            WriteLiteral("\r\n");



            #line 32 "..\..\Pages\SucceededJobs.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"alert alert-info\">\r\n        No succeeded jobs found.\r\n    </div>\r" +
                             "\n");



            #line 37 "..\..\Pages\SucceededJobs.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
                             "\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n     " +
                             "               data-url=\"");



            #line 43 "..\..\Pages\SucceededJobs.cshtml"
                Write(Request.LinkTo("/succeeded/requeue"));


            #line default
            #line hidden
                WriteLiteral("\"\r\n                    data-loading-text=\"Enqueueing...\">\r\n                <span " +
                             "class=\"glyphicon glyphicon-repeat\"></span>\r\n                Requeue jobs\r\n      " +
                             "      </button>\r\n\r\n            ");



            #line 49 "..\..\Pages\SucceededJobs.cshtml"
                Write(RenderPartial(new PerPageSelector(pager)));


            #line default
            #line hidden
                WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th>Job</th>
                    <th class=""min-width"">Total Duration</th>
                    <th class=""align-right"">Succeeded</th>
                </tr>
            </thead>
            <tbody>
");



            #line 65 "..\..\Pages\SucceededJobs.cshtml"
                foreach (var job in succeededJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <tr class=\"js-jobs-list-row ");



            #line 67 "..\..\Pages\SucceededJobs.cshtml"
                    Write(job.Value != null && !job.Value.InSucceededState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral(" ");



            #line 67 "..\..\Pages\SucceededJobs.cshtml"
                    Write(job.Value != null && job.Value.InSucceededState ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                        <td>\r\n");



            #line 69 "..\..\Pages\SucceededJobs.cshtml"
                    if (job.Value != null && job.Value.InSucceededState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <input type=\"checkbox\" class=\"js-jobs-list-checkb" +
                                     "ox\" name=\"jobs[]\" value=\"");



            #line 71 "..\..\Pages\SucceededJobs.cshtml"
                        Write(job.Key);


            #line default
            #line hidden
                        WriteLiteral("\" />\r\n");



            #line 72 "..\..\Pages\SucceededJobs.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n  " +
                                 "                          <a href=\"");



            #line 75 "..\..\Pages\SucceededJobs.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                ");



            #line 76 "..\..\Pages\SucceededJobs.cshtml"
                    Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n                            </a>\r\n");



            #line 78 "..\..\Pages\SucceededJobs.cshtml"
                    if (job.Value != null && !job.Value.InSucceededState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
                                     "etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");



            #line 81 "..\..\Pages\SucceededJobs.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n\r\n");



            #line 84 "..\..\Pages\SucceededJobs.cshtml"
                    if (job.Value == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <td colspan=\"3\">\r\n                                <em" +
                                     ">Job was expired.</em>\r\n                            </td>\r\n");



            #line 89 "..\..\Pages\SucceededJobs.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <td>\r\n                                <a class=\"job-m" +
                                     "ethod\" href=\"");



            #line 93 "..\..\Pages\SucceededJobs.cshtml"
                        Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                    ");



            #line 94 "..\..\Pages\SucceededJobs.cshtml"
                        Write(HtmlHelper.DisplayMethod(job.Value.Job));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                </a>\r\n                            </td>\r\n");



                        WriteLiteral("                            <td class=\"min-width align-right\">\r\n");



            #line 98 "..\..\Pages\SucceededJobs.cshtml"
                        if (job.Value.TotalDuration.HasValue)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                    ");

                            WriteLiteral(" ");



            #line 100 "..\..\Pages\SucceededJobs.cshtml"
                            Write(HtmlHelper.ToHumanDuration(TimeSpan.FromMilliseconds(job.Value.TotalDuration.Value), false));


            #line default
            #line hidden
                            WriteLiteral("\r\n");



            #line 101 "..\..\Pages\SucceededJobs.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                            </td>\r\n");



                        WriteLiteral("                            <td class=\"min-width align-right\">\r\n");



            #line 104 "..\..\Pages\SucceededJobs.cshtml"
                        if (job.Value.SucceededAt.HasValue)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                    <span data-moment=\"");



            #line 106 "..\..\Pages\SucceededJobs.cshtml"
                            Write(JobHelper.ToStringTimestamp(job.Value.SucceededAt.Value));


            #line default
            #line hidden
                            WriteLiteral("\">\r\n                                        ");



            #line 107 "..\..\Pages\SucceededJobs.cshtml"
                            Write(job.Value.SucceededAt);


            #line default
            #line hidden
                            WriteLiteral("\r\n                                    </span>\r\n");



            #line 109 "..\..\Pages\SucceededJobs.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                            </td>\r\n");



            #line 111 "..\..\Pages\SucceededJobs.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </tr>\r\n");



            #line 113 "..\..\Pages\SucceededJobs.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");



            #line 117 "..\..\Pages\SucceededJobs.cshtml"


            #line default
            #line hidden

            #line 117 "..\..\Pages\SucceededJobs.cshtml"
                Write(RenderPartial(new Paginator(pager)));


            #line default
            #line hidden

            #line 117 "..\..\Pages\SucceededJobs.cshtml"
            }


            #line default
            #line hidden
        }
Ejemplo n.º 15
0
        public override void Execute()
        {


WriteLiteral("\r\n");









            
            #line 9 "..\..\Pages\QueuesPage.cshtml"
  
    Layout = new LayoutPage { Title = "Queues" };

    IList<QueueWithTopEnqueuedJobsDto> queues;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        queues = monitor.Queues();
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 20 "..\..\Pages\QueuesPage.cshtml"
 if (queues.Count == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-warning\">\r\n        No queued jobs found. Try to enque" +
"ue a job.\r\n    </div>\r\n");


            
            #line 25 "..\..\Pages\QueuesPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral(@"    <table class=""table table-striped"">
        <thead>
            <tr>
                <th>Queue</th>
                <th>Length</th>
                <th>Fetched</th>
                <th>Next jobs</th>
            </tr>
        </thead>
        <tbody>
");


            
            #line 38 "..\..\Pages\QueuesPage.cshtml"
             foreach (var queue in queues)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr>\r\n                    <td>\r\n                        <a class=" +
"\"label-queue\" href=\"");


            
            #line 42 "..\..\Pages\QueuesPage.cshtml"
                                                Write(Request.LinkTo("/queues/" + queue.Name));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 43 "..\..\Pages\QueuesPage.cshtml"
                       Write(queue.Name);

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n                    </td>\r\n                    <t" +
"d>");


            
            #line 46 "..\..\Pages\QueuesPage.cshtml"
                   Write(queue.Length);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                    <td>\r\n");


            
            #line 48 "..\..\Pages\QueuesPage.cshtml"
                         if (queue.Fetched.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <a href=\"");


            
            #line 50 "..\..\Pages\QueuesPage.cshtml"
                                Write(Request.LinkTo("/queues/fetched/" + queue.Name));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 51 "..\..\Pages\QueuesPage.cshtml"
                           Write(queue.Fetched);

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </a>\r\n");


            
            #line 53 "..\..\Pages\QueuesPage.cshtml"
                        }
                        else
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <em>N/A</em>\r\n");


            
            #line 57 "..\..\Pages\QueuesPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td>\r\n");


            
            #line 60 "..\..\Pages\QueuesPage.cshtml"
                         if (queue.FirstJobs.Count == 0)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <em>No jobs queued.</em>\r\n");


            
            #line 63 "..\..\Pages\QueuesPage.cshtml"
                        }
                        else
                        {

            
            #line default
            #line hidden
WriteLiteral(@"                            <table class=""table table-condensed table-bordered table-inner"">
                                <thead>
                                    <tr>
                                        <th class=""min-width"">Id</th>
                                        <th class=""min-width"">State</th>
                                        <th>Job</th>
                                        <th class=""align-right min-width"">Enqueued</th>
                                    </tr>
                                </thead>
                                <tbody>
");


            
            #line 76 "..\..\Pages\QueuesPage.cshtml"
                                     foreach (var job in queue.FirstJobs)
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <tr class=\"");


            
            #line 78 "..\..\Pages\QueuesPage.cshtml"
                                               Write(!job.Value.InEnqueuedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                            <td class=\"min-width\">\r\n         " +
"                                       <a href=\"");


            
            #line 80 "..\..\Pages\QueuesPage.cshtml"
                                                    Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 80 "..\..\Pages\QueuesPage.cshtml"
                                                                                        Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("</a>\r\n");


            
            #line 81 "..\..\Pages\QueuesPage.cshtml"
                                                 if (!job.Value.InEnqueuedState)
                                                {

            
            #line default
            #line hidden
WriteLiteral("                                                    <span title=\"Job\'s state has " +
"been changed while fetching data.\" class=\"glyphicon glyphicon-question-sign\"></s" +
"pan>\r\n");


            
            #line 84 "..\..\Pages\QueuesPage.cshtml"
                                                }

            
            #line default
            #line hidden
WriteLiteral("                                            </td>\r\n                              " +
"              <td class=\"min-width\">\r\n                                          " +
"      <span class=\"label label-default\" style=\"");


            
            #line 87 "..\..\Pages\QueuesPage.cshtml"
                                                                                     Write(JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.Value.State) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.Value.State]) : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                                    ");


            
            #line 88 "..\..\Pages\QueuesPage.cshtml"
                                               Write(job.Value.State);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                                </span>\r\n                      " +
"                      </td>\r\n                                            <td>\r\n " +
"                                               <a class=\"job-method\" href=\"");


            
            #line 92 "..\..\Pages\QueuesPage.cshtml"
                                                                       Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                                    ");


            
            #line 93 "..\..\Pages\QueuesPage.cshtml"
                                               Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                                </a>\r\n                         " +
"                   </td>\r\n                                            <td class=" +
"\"align-right min-width\">\r\n");


            
            #line 97 "..\..\Pages\QueuesPage.cshtml"
                                                 if (job.Value.EnqueuedAt.HasValue)
                                                {

            
            #line default
            #line hidden
WriteLiteral("                                                    <span data-moment=\"");


            
            #line 99 "..\..\Pages\QueuesPage.cshtml"
                                                                  Write(JobHelper.ToStringTimestamp(job.Value.EnqueuedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                                        ");


            
            #line 100 "..\..\Pages\QueuesPage.cshtml"
                                                   Write(job.Value.EnqueuedAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                                    </span>\r\n");


            
            #line 102 "..\..\Pages\QueuesPage.cshtml"
                                                }
                                                else
                                                {

            
            #line default
            #line hidden
WriteLiteral("                                                    <em>n/a</em>\r\n");


            
            #line 106 "..\..\Pages\QueuesPage.cshtml"
                                                }

            
            #line default
            #line hidden
WriteLiteral("                                            </td>\r\n                              " +
"          </tr>\r\n");


            
            #line 109 "..\..\Pages\QueuesPage.cshtml"
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                </tbody>\r\n                            </table>\r\n");


            
            #line 112 "..\..\Pages\QueuesPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                </td>\r\n            </tr>\r\n");


            
            #line 115 "..\..\Pages\QueuesPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 118 "..\..\Pages\QueuesPage.cshtml"
}
            
            #line default
            #line hidden

        }
Ejemplo n.º 16
0
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\Pages\ProcessingJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Processing Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<ProcessingJobDto> processingJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.ProcessingCount())
        {
            BasePageUrl = Request.LinkTo("/processing")
        };

        processingJobs = monitor
            .ProcessingJobs(pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 30 "..\..\Pages\ProcessingJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        No jobs are being processed right now" +
".\r\n    </div>\r\n");


            
            #line 35 "..\..\Pages\ProcessingJobsPage.cshtml"
}
else
{
    
            
            #line default
            #line hidden
            
            #line 38 "..\..\Pages\ProcessingJobsPage.cshtml"
Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
            
            #line 38 "..\..\Pages\ProcessingJobsPage.cshtml"
                                              
    

            
            #line default
            #line hidden
WriteLiteral("    <table class=\"table\">\r\n        <thead>\r\n            <tr>\r\n                <th" +
">Id</th>\r\n                <th>Job</th>\r\n                <th>Server</th>\r\n       " +
"         <th>Started</th>\r\n            </tr>\r\n        </thead>\r\n        <tbody>\r" +
"\n");


            
            #line 50 "..\..\Pages\ProcessingJobsPage.cshtml"
             foreach (var job in processingJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr class=\"");


            
            #line 52 "..\..\Pages\ProcessingJobsPage.cshtml"
                       Write(!job.Value.InProcessingState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <td>\r\n                        <a href=\"");


            
            #line 54 "..\..\Pages\ProcessingJobsPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 55 "..\..\Pages\ProcessingJobsPage.cshtml"
                       Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n");


            
            #line 57 "..\..\Pages\ProcessingJobsPage.cshtml"
                         if (!job.Value.InProcessingState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span title=\"Job\'s state has been changed while fetch" +
"ing data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 60 "..\..\Pages\ProcessingJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td>\r\n                        <spa" +
"n title=\"");


            
            #line 63 "..\..\Pages\ProcessingJobsPage.cshtml"
                                Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 64 "..\..\Pages\ProcessingJobsPage.cshtml"
                       Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </span>\r\n                    </td>\r\n                   " +
" <td>\r\n                        ");


            
            #line 68 "..\..\Pages\ProcessingJobsPage.cshtml"
                   Write(job.Value.ServerName);

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </td>\r\n                    <td>\r\n");


            
            #line 71 "..\..\Pages\ProcessingJobsPage.cshtml"
                         if (job.Value.StartedAt.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 73 "..\..\Pages\ProcessingJobsPage.cshtml"
                                          Write(JobHelper.ToStringTimestamp(job.Value.StartedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 74 "..\..\Pages\ProcessingJobsPage.cshtml"
                           Write(job.Value.StartedAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </span>\r\n");


            
            #line 76 "..\..\Pages\ProcessingJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 79 "..\..\Pages\ProcessingJobsPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 82 "..\..\Pages\ProcessingJobsPage.cshtml"
    
    
            
            #line default
            #line hidden
            
            #line 83 "..\..\Pages\ProcessingJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 83 "..\..\Pages\ProcessingJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
Ejemplo n.º 17
0
        public override void Execute()
        {
            WriteLiteral("\n");



            #line 9 "..\..\Pages\ServersPage.cshtml"

            Layout = new LayoutPage {
                Title = "Servers"
            };

            var monitor = JobStorage.Current.GetMonitoringApi();
            IList <ServerDto> servers = monitor.Servers();



            #line default
            #line hidden
            WriteLiteral("\n");



            #line 16 "..\..\Pages\ServersPage.cshtml"
            if (servers.Count == 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"alert alert-warning\">\n        There are no active servers. Backgr" +
                             "ound tasks will not be processed.\n    </div>\n");



            #line 21 "..\..\Pages\ServersPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral(@"    <table class=""table"">
        <thead>
            <tr>
                <th>Name</th>
                <th>Workers</th>
                <th>Queues</th>
                <th>Started</th>
                <th>Heartbeat</th>
            </tr>
        </thead>
        <tbody>
");



            #line 35 "..\..\Pages\ServersPage.cshtml"
                foreach (var server in servers)
                {
            #line default
            #line hidden
                    WriteLiteral("                <tr>\n                    <td>");



            #line 38 "..\..\Pages\ServersPage.cshtml"
                    Write(server.Name.ToUpperInvariant());


            #line default
            #line hidden
                    WriteLiteral("</td>\n                    <td>");



            #line 39 "..\..\Pages\ServersPage.cshtml"
                    Write(server.WorkersCount);


            #line default
            #line hidden
                    WriteLiteral("</td>\n                    <td>");



            #line 40 "..\..\Pages\ServersPage.cshtml"
                    Write(HtmlHelper.Raw(String.Join(" ", server.Queues.Select(HtmlHelper.QueueLabel))));


            #line default
            #line hidden
                    WriteLiteral("</td>\n                    <td data-moment=\"");



            #line 41 "..\..\Pages\ServersPage.cshtml"
                    Write(JobHelper.ToStringTimestamp(server.StartedAt));


            #line default
            #line hidden
                    WriteLiteral("\">");



            #line 41 "..\..\Pages\ServersPage.cshtml"
                    Write(server.StartedAt);


            #line default
            #line hidden
                    WriteLiteral("</td>\n                    <td>\n");



            #line 43 "..\..\Pages\ServersPage.cshtml"
                    if (server.Heartbeat.HasValue)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <span data-moment=\"");



            #line 45 "..\..\Pages\ServersPage.cshtml"
                        Write(JobHelper.ToStringTimestamp(server.Heartbeat.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\n                                ");



            #line 46 "..\..\Pages\ServersPage.cshtml"
                        Write(server.Heartbeat);


            #line default
            #line hidden
                        WriteLiteral("\n                            </span>\n");



            #line 48 "..\..\Pages\ServersPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </td>\n                </tr>\n");



            #line 51 "..\..\Pages\ServersPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("        </tbody>\n    </table>\n");



            #line 54 "..\..\Pages\ServersPage.cshtml"
            }

            #line default
            #line hidden
        }
Ejemplo n.º 18
0
        public override void Execute()
        {
            WriteLiteral("\n");



            #line 9 "..\..\Pages\QueuesPage.cshtml"

            Layout = new LayoutPage {
                Title = "Queues"
            };

            var monitor = JobStorage.Current.GetMonitoringApi();
            IList <QueueWithTopEnqueuedJobsDto> queues = monitor.Queues();



            #line default
            #line hidden
            WriteLiteral("\n");



            #line 16 "..\..\Pages\QueuesPage.cshtml"
            if (queues.Count == 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"alert alert-warning\">\n        No queued jobs found. Try to enqueu" +
                             "e a job.\n    </div>\n");



            #line 21 "..\..\Pages\QueuesPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("    <table class=\"table table-striped\">\n        <thead>\n            <tr>\n        " +
                             "        <th>Queue</th>\n                <th>Length</th>\n                <th>Fetch" +
                             "ed</th>\n                <th>Next jobs</th>\n            </tr>\n        </thead>\n  " +
                             "      <tbody>\n");



            #line 34 "..\..\Pages\QueuesPage.cshtml"
                foreach (var queue in queues)
                {
            #line default
            #line hidden
                    WriteLiteral("                <tr>\n                    <td>\n                        <a class=\"l" +
                                 "abel-queue\" href=\"");



            #line 38 "..\..\Pages\QueuesPage.cshtml"
                    Write(Request.LinkTo("/queues/" + queue.Name));


            #line default
            #line hidden
                    WriteLiteral("\">\n                            ");



            #line 39 "..\..\Pages\QueuesPage.cshtml"
                    Write(queue.Name);


            #line default
            #line hidden
                    WriteLiteral("\n                        </a>\n                    </td>\n                    <td>");



            #line 42 "..\..\Pages\QueuesPage.cshtml"
                    Write(queue.Length);


            #line default
            #line hidden
                    WriteLiteral("</td>\n                    <td>\n");



            #line 44 "..\..\Pages\QueuesPage.cshtml"
                    if (queue.Fetched.HasValue)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <a href=\"");



            #line 46 "..\..\Pages\QueuesPage.cshtml"
                        Write(Request.LinkTo("/queues/fetched/" + queue.Name));


            #line default
            #line hidden
                        WriteLiteral("\">\n                                ");



            #line 47 "..\..\Pages\QueuesPage.cshtml"
                        Write(queue.Fetched);


            #line default
            #line hidden
                        WriteLiteral("\n                            </a>\n");



            #line 49 "..\..\Pages\QueuesPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <em>N/A</em>\n");



            #line 53 "..\..\Pages\QueuesPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </td>\n                    <td>\n");



            #line 56 "..\..\Pages\QueuesPage.cshtml"
                    if (queue.FirstJobs.Count == 0)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <em>No jobs queued.</em>\n");



            #line 59 "..\..\Pages\QueuesPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral(@"                            <table class=""table table-condensed table-bordered table-inner"">
                                <thead>
                                    <tr>
                                        <th class=""min-width"">Id</th>
                                        <th class=""min-width"">State</th>
                                        <th>Job</th>
                                        <th class=""align-right min-width"">Enqueued</th>
                                    </tr>
                                </thead>
                                <tbody>
");



            #line 72 "..\..\Pages\QueuesPage.cshtml"
                        foreach (var job in queue.FirstJobs)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                        <tr class=\"");



            #line 74 "..\..\Pages\QueuesPage.cshtml"
                            Write(!job.Value.InEnqueuedState ? "obsolete-data" : null);


            #line default
            #line hidden
                            WriteLiteral("\">\n                                            <td class=\"min-width\">\n           " +
                                         "                                     <a href=\"");



            #line 76 "..\..\Pages\QueuesPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                            WriteLiteral("\">");



            #line 76 "..\..\Pages\QueuesPage.cshtml"
                            Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                            WriteLiteral("</a>\n");



            #line 77 "..\..\Pages\QueuesPage.cshtml"
                            if (!job.Value.InEnqueuedState)
                            {
            #line default
            #line hidden
                                WriteLiteral("                                                    <span title=\"Job\'s state has " +
                                             "been changed while fetching data.\" class=\"glyphicon glyphicon-question-sign\"></s" +
                                             "pan>\n");



            #line 80 "..\..\Pages\QueuesPage.cshtml"
                            }


            #line default
            #line hidden
                            WriteLiteral("                                            </td>\n                               " +
                                         "             <td class=\"min-width\">\n                                            " +
                                         "    <span class=\"label label-default\" style=\"");



            #line 83 "..\..\Pages\QueuesPage.cshtml"
                            Write(JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.Value.State) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.Value.State]) : null);


            #line default
            #line hidden
                            WriteLiteral("\">\n                                                    ");



            #line 84 "..\..\Pages\QueuesPage.cshtml"
                            Write(job.Value.State);


            #line default
            #line hidden
                            WriteLiteral("\n                                                </span>\n                        " +
                                         "                    </td>\n                                            <td>\n     " +
                                         "                                           <a class=\"job-method\" href=\"");



            #line 88 "..\..\Pages\QueuesPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                            WriteLiteral("\">\n                                                    ");



            #line 89 "..\..\Pages\QueuesPage.cshtml"
                            Write(HtmlHelper.DisplayMethod(job.Value.Job));


            #line default
            #line hidden
                            WriteLiteral("\n                                                </a>\n                           " +
                                         "                 </td>\n                                            <td class=\"al" +
                                         "ign-right min-width\">\n");



            #line 93 "..\..\Pages\QueuesPage.cshtml"
                            if (job.Value.EnqueuedAt.HasValue)
                            {
            #line default
            #line hidden
                                WriteLiteral("                                                    <span data-moment=\"");



            #line 95 "..\..\Pages\QueuesPage.cshtml"
                                Write(JobHelper.ToTimestamp(job.Value.EnqueuedAt.Value));


            #line default
            #line hidden
                                WriteLiteral("\">\n                                                        ");



            #line 96 "..\..\Pages\QueuesPage.cshtml"
                                Write(job.Value.EnqueuedAt);


            #line default
            #line hidden
                                WriteLiteral("\n                                                    </span>\n");



            #line 98 "..\..\Pages\QueuesPage.cshtml"
                            }
                            else
                            {
            #line default
            #line hidden
                                WriteLiteral("                                                    <em>n/a</em>\n");



            #line 102 "..\..\Pages\QueuesPage.cshtml"
                            }


            #line default
            #line hidden
                            WriteLiteral("                                            </td>\n                               " +
                                         "         </tr>\n");



            #line 105 "..\..\Pages\QueuesPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                </tbody>\n                            </table>\n");



            #line 108 "..\..\Pages\QueuesPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                </td>\n            </tr>\n");



            #line 111 "..\..\Pages\QueuesPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("        </tbody>\n    </table>\n");



            #line 114 "..\..\Pages\QueuesPage.cshtml"
            }

            #line default
            #line hidden
        }
        public override void Execute()
        {
            WriteLiteral("\n");



            #line 11 "..\..\Pages\JobDetailsPage.cshtml"

            var           monitor = JobStorage.Current.GetMonitoringApi();
            JobDetailsDto job     = monitor.JobDetails(JobId.ToString());

            string title = null;

            if (job != null)
            {
                title = job.Job != null?String.Format("{0}.{1}", job.Job.Type.Name, job.Job.Method.Name) : null;
            }

            title = title ?? "Job";

            Layout = new LayoutPage {
                Title = title
            };



            #line default
            #line hidden
            WriteLiteral("\n");



            #line 27 "..\..\Pages\JobDetailsPage.cshtml"
            if (job == null)
            {
            #line default
            #line hidden
                WriteLiteral("    ");

                WriteLiteral(" The job with id \'");



            #line 29 "..\..\Pages\JobDetailsPage.cshtml"
                Write(JobId);


            #line default
            #line hidden
                WriteLiteral("\' was expired or was not existed on the server.\n");



            #line 30 "..\..\Pages\JobDetailsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"job-snippet-header\">\n        <span class=\"job-snippet-tab\">\n     " +
                             "       Job ID: <span class=\"job-snippet-id\">");



            #line 35 "..\..\Pages\JobDetailsPage.cshtml"
                Write(HtmlHelper.JobId(JobId.ToString(), false));


            #line default
            #line hidden
                WriteLiteral("</span>\n        </span>\n\n        <span class=\"job-snippet-buttons pull-right\">\n  " +
                             "          <button class=\"btn btn-xs btn-default\" data-ajax=\"");



            #line 39 "..\..\Pages\JobDetailsPage.cshtml"
                Write(Request.LinkTo("/actions/requeue/" + JobId));


            #line default
            #line hidden
                WriteLiteral("\" data-loading-text=\"Enqueueing...\">Requeue</button>\n            <button class=\"b" +
                             "tn btn-xs btn-death\" data-ajax=\"");



            #line 40 "..\..\Pages\JobDetailsPage.cshtml"
                Write(Request.LinkTo("/actions/delete/" + JobId));


            #line default
            #line hidden
                WriteLiteral("\" data-loading-text=\"Deleting...\" data-confirm=\"Do you really want to delete this" +
                             " job?\">Delete</button>\n        </span>\n\n        <div class=\"clearfix\"></div>\n   " +
                             " </div>\n");



                WriteLiteral("    <div class=\"job-snippet\">\n        <div class=\"job-snippet-code\">\n");



            #line 47 "..\..\Pages\JobDetailsPage.cshtml"
                if (job.CreatedAt.HasValue)
                {
            #line default
            #line hidden
                    WriteLiteral("                <div class=\"pull-right job-creation-date\">\n                    Cr" +
                                 "eated\n                    <span data-moment=\"");



            #line 51 "..\..\Pages\JobDetailsPage.cshtml"
                    Write(JobHelper.ToStringTimestamp(job.CreatedAt.Value));


            #line default
            #line hidden
                    WriteLiteral("\"></span>\n                </div>\n");



            #line 53 "..\..\Pages\JobDetailsPage.cshtml"
                }


            #line default
            #line hidden


            #line 54 "..\..\Pages\JobDetailsPage.cshtml"
                if (job != null)
                {
            #line default
            #line hidden
                    WriteLiteral("                <pre><code>");



            #line 56 "..\..\Pages\JobDetailsPage.cshtml"
                    Write(JobMethodCallRenderer.Render(job.Job));


            #line default
            #line hidden
                    WriteLiteral("</code></pre>\n");



            #line 57 "..\..\Pages\JobDetailsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            <div class=\"clearfix\"></div>\n        </div>\n\n");



            #line 61 "..\..\Pages\JobDetailsPage.cshtml"
                if (job.Properties.Count > 0)
                {
            #line default
            #line hidden
                    WriteLiteral("            <div class=\"job-snippet-properties\">\n                <dl>\n");



            #line 65 "..\..\Pages\JobDetailsPage.cshtml"
                    foreach (var property in job.Properties)
                    {
            #line default
            #line hidden
                        WriteLiteral("                        <dt>");



            #line 67 "..\..\Pages\JobDetailsPage.cshtml"
                        Write(property.Key);


            #line default
            #line hidden
                        WriteLiteral("</dt>\n");



                        WriteLiteral("                        <dd>\n                            <pre>");



            #line 69 "..\..\Pages\JobDetailsPage.cshtml"
                        Write(property.Value);


            #line default
            #line hidden
                        WriteLiteral("</pre>\n                        </dd>\n");



            #line 71 "..\..\Pages\JobDetailsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                </dl>\n            </div>\n");



            #line 74 "..\..\Pages\JobDetailsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("    </div>\n");



            #line 76 "..\..\Pages\JobDetailsPage.cshtml"

                if (job.History.Count > 0)
                {
            #line default
            #line hidden
                    WriteLiteral("        <h3>History</h3>\n");



            #line 80 "..\..\Pages\JobDetailsPage.cshtml"
                    var index = 0;

                    DateTime[] entriesCreationTime = job.History.Select(x => x.CreatedAt).ToArray();
                    var        nextEntry           = 1;

                    foreach (var entry in job.History)
                    {
                        var background = JobHistoryRenderer.BackgroundStateColors.ContainsKey(entry.StateName)
               ? JobHistoryRenderer.BackgroundStateColors[entry.StateName]
               : null;

                        if (index == 0)
                        {
                            background = JobHistoryRenderer.ForegroundStateColors.ContainsKey(entry.StateName)
                    ? JobHistoryRenderer.ForegroundStateColors[entry.StateName]
                    : null;
                        }



            #line default
            #line hidden
                        WriteLiteral("            <div class=\"job-history ");



            #line 98 "..\..\Pages\JobDetailsPage.cshtml"
                        Write(index == 0 ? "job-history-current" : null);


            #line default
            #line hidden
                        WriteLiteral("\">\n                <div class=\"job-history-heading\" style=\"");



            #line 99 "..\..\Pages\JobDetailsPage.cshtml"
                        Write(background != null ? String.Format("background-color: {0};", background) : null);


            #line default
            #line hidden
                        WriteLiteral("\">\n                    <span class=\"pull-right\" data-moment-title=\"");



            #line 100 "..\..\Pages\JobDetailsPage.cshtml"
                        Write(JobHelper.ToStringTimestamp(entry.CreatedAt));


            #line default
            #line hidden
                        WriteLiteral("\">\n                        ");



            #line 101 "..\..\Pages\JobDetailsPage.cshtml"
                        Write(HtmlHelper.ToHumanDuration(entry.CreatedAt - (nextEntry < entriesCreationTime.Length ? entriesCreationTime[nextEntry] : job.CreatedAt)));


            #line default
            #line hidden
                        WriteLiteral("\n");



            #line 102 "..\..\Pages\JobDetailsPage.cshtml"
                        nextEntry++;


            #line default
            #line hidden
                        WriteLiteral("                    </span>\n                    <h4 class=\"job-history-title\">\n  " +
                                     "                      ");



            #line 105 "..\..\Pages\JobDetailsPage.cshtml"
                        Write(entry.StateName);


            #line default
            #line hidden
                        WriteLiteral("\n\n");



            #line 107 "..\..\Pages\JobDetailsPage.cshtml"
                        if (!String.IsNullOrWhiteSpace(entry.Reason))
                        {
            #line default
            #line hidden
                            WriteLiteral("                            <small>");



            #line 109 "..\..\Pages\JobDetailsPage.cshtml"
                            Write(entry.Reason);


            #line default
            #line hidden
                            WriteLiteral("</small>\n");



            #line 110 "..\..\Pages\JobDetailsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                    </h4>\n                </div>\n\n");



            #line 114 "..\..\Pages\JobDetailsPage.cshtml"
                        if (JobHistoryRenderer.Exists(entry.StateName))
                        {
                            var rendered = JobHistoryRenderer.Render(entry.StateName, entry.Data);
                            if (rendered != null)
                            {
            #line default
            #line hidden
                                WriteLiteral("                        <div class=\"job-history-body\">\n                          " +
                                             "  ");



            #line 120 "..\..\Pages\JobDetailsPage.cshtml"
                                Write(rendered);


            #line default
            #line hidden
                                WriteLiteral("\n                        </div>\n");



            #line 122 "..\..\Pages\JobDetailsPage.cshtml"
                            }
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                    <div class=\"job-history-body\">\n                        <dl cl" +
                                         "ass=\"dl-horizontal\">\n");



            #line 128 "..\..\Pages\JobDetailsPage.cshtml"
                            foreach (var item in entry.Data)
                            {
            #line default
            #line hidden
                                WriteLiteral("                                <dt>");



            #line 130 "..\..\Pages\JobDetailsPage.cshtml"
                                Write(item.Key);


            #line default
            #line hidden
                                WriteLiteral(":</dt>\n");



                                WriteLiteral("                                <dd>");



            #line 131 "..\..\Pages\JobDetailsPage.cshtml"
                                Write(item.Value);


            #line default
            #line hidden
                                WriteLiteral("</dd>\n");



            #line 132 "..\..\Pages\JobDetailsPage.cshtml"
                            }


            #line default
            #line hidden
                            WriteLiteral("                        </dl>\n                    </div>\n");



            #line 135 "..\..\Pages\JobDetailsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("            </div>\n");



            #line 137 "..\..\Pages\JobDetailsPage.cshtml"

                        index++;
                    }
                }
            }

            #line default
            #line hidden
        }
Ejemplo n.º 20
0
        public override void Execute()
        {


WriteLiteral("\r\n");










            
            #line 10 "..\..\Pages\EnqueuedJobsPage.cshtml"
  
    Layout = new LayoutPage
        {
            Title = Queue.ToUpperInvariant(), 
            Subtitle = "Enqueued jobs",
            Breadcrumbs = new Dictionary<string, string>
                {
                    { "Queues", Request.LinkTo("/queues") }
                }
        };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<EnqueuedJobDto> enqueuedJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue))
        {
            BasePageUrl = Request.LinkTo("/queues/" + Queue)
        };

        enqueuedJobs = monitor
            .EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 41 "..\..\Pages\EnqueuedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        The queue is empty.\r\n    </div>\r\n");


            
            #line 46 "..\..\Pages\EnqueuedJobsPage.cshtml"
}
else
{
    
            
            #line default
            #line hidden
            
            #line 49 "..\..\Pages\EnqueuedJobsPage.cshtml"
Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
            
            #line 49 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                              
    

            
            #line default
            #line hidden
WriteLiteral("    <table class=\"table\">\r\n        <thead>\r\n            <tr>\r\n                <th" +
">Id</th>\r\n                <th>Job</th>\r\n                <th>Enqueued</th>\r\n     " +
"       </tr>\r\n        </thead>\r\n        <tbody>\r\n");


            
            #line 60 "..\..\Pages\EnqueuedJobsPage.cshtml"
             foreach (var job in enqueuedJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr class=\"");


            
            #line 62 "..\..\Pages\EnqueuedJobsPage.cshtml"
                       Write(!job.Value.InEnqueuedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <td>\r\n                        <a href=\"");


            
            #line 64 "..\..\Pages\EnqueuedJobsPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 64 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                                                Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("</a>\r\n");


            
            #line 65 "..\..\Pages\EnqueuedJobsPage.cshtml"
                         if (!job.Value.InEnqueuedState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span title=\"Job\'s state has been changed while fetch" +
"ing data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 68 "..\..\Pages\EnqueuedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td> \r\n                    <td>\r\n                        <sp" +
"an title=\"");


            
            #line 71 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 72 "..\..\Pages\EnqueuedJobsPage.cshtml"
                       Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </span>\r\n                    </td>\r\n                   " +
" <td>\r\n");


            
            #line 76 "..\..\Pages\EnqueuedJobsPage.cshtml"
                         if (job.Value.EnqueuedAt.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 78 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                          Write(JobHelper.ToStringTimestamp(job.Value.EnqueuedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 79 "..\..\Pages\EnqueuedJobsPage.cshtml"
                           Write(job.Value.EnqueuedAt);

            
            #line default
            #line hidden
WriteLiteral("        \r\n                            </span>\r\n");


            
            #line 81 "..\..\Pages\EnqueuedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 84 "..\..\Pages\EnqueuedJobsPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 87 "..\..\Pages\EnqueuedJobsPage.cshtml"
    
    
            
            #line default
            #line hidden
            
            #line 88 "..\..\Pages\EnqueuedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 88 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                        
}
            
            #line default
            #line hidden

        }
Ejemplo n.º 21
0
        public override void Execute()
        {


WriteLiteral("\r\n");











            
            #line 11 "..\..\Pages\JobDetailsPage.cshtml"
  
    JobDetailsDto job;
    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        job = monitor.JobDetails(JobId.ToString());
    }

    string title = null;

    if (job != null && job.MethodData != null)
    {
        title = HtmlHelper.DisplayMethod(job.MethodData);
    }

    title = title ?? "Job";

    Layout = new LayoutPage { Title = title };


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 30 "..\..\Pages\JobDetailsPage.cshtml"
 if (job == null)
{

            
            #line default
            #line hidden
WriteLiteral("    ");

WriteLiteral(" The job with id \'");


            
            #line 32 "..\..\Pages\JobDetailsPage.cshtml"
                   Write(JobId);

            
            #line default
            #line hidden
WriteLiteral("\' was expired or was not existed on the server.\r\n");


            
            #line 33 "..\..\Pages\JobDetailsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"job-snippet-header\">\r\n        Job ID: <span class=\"job-snippet-id" +
"\">");


            
            #line 37 "..\..\Pages\JobDetailsPage.cshtml"
                                        Write(HtmlHelper.JobId(JobId.ToString(), false));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n    </div>\r\n");



WriteLiteral("    <div class=\"job-snippet\">\r\n        <div class=\"job-snippet-code\">\r\n");


            
            #line 41 "..\..\Pages\JobDetailsPage.cshtml"
             if (job.CreatedAt.HasValue)
            {

            
            #line default
            #line hidden
WriteLiteral("                <div class=\"pull-right job-creation-date\">\r\n                    C" +
"reated\r\n                    <span data-moment=\"");


            
            #line 45 "..\..\Pages\JobDetailsPage.cshtml"
                                  Write(JobHelper.ToStringTimestamp(job.CreatedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\"></span>\r\n                </div>\r\n");


            
            #line 47 "..\..\Pages\JobDetailsPage.cshtml"
            }

            
            #line default
            #line hidden

            
            #line 48 "..\..\Pages\JobDetailsPage.cshtml"
             if (job.MethodData != null)
            {

            
            #line default
            #line hidden
WriteLiteral("                <pre><code>");


            
            #line 50 "..\..\Pages\JobDetailsPage.cshtml"
                      Write(JobMethodCallRenderer.Render(job.MethodData, job.Arguments, job.OldFormatArguments));

            
            #line default
            #line hidden
WriteLiteral("</code></pre>\r\n");


            
            #line 51 "..\..\Pages\JobDetailsPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"clearfix\"></div>\r\n        </div>\r\n\r\n");


            
            #line 55 "..\..\Pages\JobDetailsPage.cshtml"
         if (job.Properties.Count > 0)
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"job-snippet-properties\">\r\n                <dl>\r\n");


            
            #line 59 "..\..\Pages\JobDetailsPage.cshtml"
                     foreach (var property in job.Properties)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <dt>");


            
            #line 61 "..\..\Pages\JobDetailsPage.cshtml"
                       Write(property.Key);

            
            #line default
            #line hidden
WriteLiteral("</dt>\r\n");



WriteLiteral("                        <dd>\r\n                            <pre>");


            
            #line 63 "..\..\Pages\JobDetailsPage.cshtml"
                            Write(property.Value);

            
            #line default
            #line hidden
WriteLiteral("</pre>\r\n                        </dd>\r\n");


            
            #line 65 "..\..\Pages\JobDetailsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </dl>\r\n            </div>\r\n");


            
            #line 68 "..\..\Pages\JobDetailsPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </div>\r\n");


            
            #line 70 "..\..\Pages\JobDetailsPage.cshtml"

        if (job.History.Count > 0)
        {

            
            #line default
            #line hidden
WriteLiteral("    <h3>History</h3>\r\n");


            
            #line 74 "..\..\Pages\JobDetailsPage.cshtml"
            var index = 0;
            foreach (var entry in job.History)
            {
                var background = JobHistoryRenderer.BackgroundStateColors.ContainsKey(entry.StateName)
                   ? JobHistoryRenderer.BackgroundStateColors[entry.StateName]
                   : null;

                if (index == 0)
                {
                    background = JobHistoryRenderer.ForegroundStateColors.ContainsKey(entry.StateName)
                        ? JobHistoryRenderer.ForegroundStateColors[entry.StateName]
                        : null;
                }


            
            #line default
            #line hidden
WriteLiteral("    <div class=\"job-history ");


            
            #line 88 "..\..\Pages\JobDetailsPage.cshtml"
                        Write(index == 0 ? "job-history-current" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n        <div class=\"job-history-heading\" style=\"");


            
            #line 89 "..\..\Pages\JobDetailsPage.cshtml"
                                            Write(background != null ? String.Format("background-color: {0};", background) : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n            <span class=\"pull-right\" data-moment=\"");


            
            #line 90 "..\..\Pages\JobDetailsPage.cshtml"
                                             Write(JobHelper.ToStringTimestamp(entry.CreatedAt));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 90 "..\..\Pages\JobDetailsPage.cshtml"
                                                                                            Write(entry.CreatedAt);

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n            <h4 class=\"job-history-title\">\r\n                ");


            
            #line 92 "..\..\Pages\JobDetailsPage.cshtml"
           Write(entry.StateName);

            
            #line default
            #line hidden
WriteLiteral("\r\n\r\n");


            
            #line 94 "..\..\Pages\JobDetailsPage.cshtml"
                 if (!String.IsNullOrWhiteSpace(entry.Reason))
                {

            
            #line default
            #line hidden
WriteLiteral("                    <small>");


            
            #line 96 "..\..\Pages\JobDetailsPage.cshtml"
                      Write(entry.Reason);

            
            #line default
            #line hidden
WriteLiteral("</small>\r\n");


            
            #line 97 "..\..\Pages\JobDetailsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </h4>\r\n        </div>\r\n\r\n");


            
            #line 101 "..\..\Pages\JobDetailsPage.cshtml"
         if (JobHistoryRenderer.Exists(entry.StateName))
        {
            var rendered = JobHistoryRenderer.Render(entry.StateName, entry.Data);
            if (rendered != null)
            {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"job-history-body\">\r\n                ");


            
            #line 107 "..\..\Pages\JobDetailsPage.cshtml"
           Write(rendered);

            
            #line default
            #line hidden
WriteLiteral("\r\n            </div>\r\n");


            
            #line 109 "..\..\Pages\JobDetailsPage.cshtml"
            }
        }
        else
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"job-history-body\">\r\n                <dl class=\"dl-horizon" +
"tal\">\r\n");


            
            #line 115 "..\..\Pages\JobDetailsPage.cshtml"
                     foreach (var item in entry.Data)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <dt>");


            
            #line 117 "..\..\Pages\JobDetailsPage.cshtml"
                       Write(item.Key);

            
            #line default
            #line hidden
WriteLiteral(":</dt>\r\n");



WriteLiteral("                        <dd>");


            
            #line 118 "..\..\Pages\JobDetailsPage.cshtml"
                       Write(item.Value);

            
            #line default
            #line hidden
WriteLiteral("</dd>\r\n");


            
            #line 119 "..\..\Pages\JobDetailsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </dl>\r\n            </div>\r\n");


            
            #line 122 "..\..\Pages\JobDetailsPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </div>\r\n");


            
            #line 124 "..\..\Pages\JobDetailsPage.cshtml"

        index++;
            }
        }
}
            
            #line default
            #line hidden

        }
Ejemplo n.º 22
0
        public override void Execute()
        {


WriteLiteral("\n");









            
            #line 9 "..\..\Pages\ServersPage.cshtml"
  
    Layout = new LayoutPage { Title = "Servers" };
    
    var monitor = JobStorage.Current.GetMonitoringApi();
    IList<ServerDto> servers = monitor.Servers();    


            
            #line default
            #line hidden
WriteLiteral("\n");


            
            #line 16 "..\..\Pages\ServersPage.cshtml"
 if (servers.Count == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-warning\">\n        There are no active servers. Backgr" +
"ound tasks will not be processed.\n    </div>\n");


            
            #line 21 "..\..\Pages\ServersPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral(@"    <table class=""table"">
        <thead>
            <tr>
                <th>Name</th>
                <th>Workers</th>
                <th>Queues</th>
                <th>Started</th>
                <th>Heartbeat</th>
            </tr>
        </thead>
        <tbody>
");


            
            #line 35 "..\..\Pages\ServersPage.cshtml"
             foreach (var server in servers)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr>\n                    <td>");


            
            #line 38 "..\..\Pages\ServersPage.cshtml"
                   Write(server.Name.ToUpperInvariant());

            
            #line default
            #line hidden
WriteLiteral("</td>\n                    <td>");


            
            #line 39 "..\..\Pages\ServersPage.cshtml"
                   Write(server.WorkersCount);

            
            #line default
            #line hidden
WriteLiteral("</td>\n                    <td>");


            
            #line 40 "..\..\Pages\ServersPage.cshtml"
                   Write(HtmlHelper.Raw(String.Join(" ", server.Queues.Select(HtmlHelper.QueueLabel))));

            
            #line default
            #line hidden
WriteLiteral("</td>\n                    <td data-moment=\"");


            
            #line 41 "..\..\Pages\ServersPage.cshtml"
                                Write(JobHelper.ToTimestamp(server.StartedAt));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 41 "..\..\Pages\ServersPage.cshtml"
                                                                          Write(server.StartedAt);

            
            #line default
            #line hidden
WriteLiteral("</td>\n                    <td>\n");


            
            #line 43 "..\..\Pages\ServersPage.cshtml"
                         if (server.Heartbeat.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 45 "..\..\Pages\ServersPage.cshtml"
                                          Write(JobHelper.ToTimestamp(server.Heartbeat.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                ");


            
            #line 46 "..\..\Pages\ServersPage.cshtml"
                           Write(server.Heartbeat);

            
            #line default
            #line hidden
WriteLiteral("\n                            </span>\n");


            
            #line 48 "..\..\Pages\ServersPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\n                </tr>\n");


            
            #line 51 "..\..\Pages\ServersPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\n    </table>\n");


            
            #line 54 "..\..\Pages\ServersPage.cshtml"
}
            
            #line default
            #line hidden

        }
Ejemplo n.º 23
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 7 "..\..\Pages\ProcessingJobsPage.cshtml"

            Layout = new LayoutPage {
                Title = "Processing Jobs"
            };

            int from, perPage;

            int.TryParse(Request.QueryString["from"], out from);
            int.TryParse(Request.QueryString["count"], out perPage);

            Pager pager;
            JobList <ProcessingJobDto> processingJobs;

            using (var monitor = JobStorage.Current.GetMonitoringApi())
            {
                pager = new Pager(from, perPage, monitor.ProcessingCount())
                {
                    BasePageUrl = Request.LinkTo("/processing")
                };

                processingJobs = monitor
                                 .ProcessingJobs(pager.FromRecord, pager.RecordsPerPage);
            }



            #line default
            #line hidden
            WriteLiteral("\r\n");



            #line 30 "..\..\Pages\ProcessingJobsPage.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"alert alert-info\">\r\n        No jobs are being processed right now" +
                             ".\r\n    </div>\r\n");



            #line 35 "..\..\Pages\ProcessingJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
                             "\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n     " +
                             "               data-url=\"");



            #line 41 "..\..\Pages\ProcessingJobsPage.cshtml"
                Write(Request.LinkTo("/processing/requeue"));


            #line default
            #line hidden
                WriteLiteral(@"""
                    data-loading-text=""Enqueueing..."">
                <span class=""glyphicon glyphicon-repeat""></span>
                Requeue jobs
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");



            #line 48 "..\..\Pages\ProcessingJobsPage.cshtml"
                Write(Request.LinkTo("/processing/delete"));


            #line default
            #line hidden
                WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");



            #line 55 "..\..\Pages\ProcessingJobsPage.cshtml"
                Write(RenderPartial(new PerPageSelector(pager)));


            #line default
            #line hidden
                WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th class=""min-width"">Server</th>
                    <th>Job</th>
                    <th class=""align-right"">Started</th>
                </tr>
            </thead>
            <tbody>
");



            #line 71 "..\..\Pages\ProcessingJobsPage.cshtml"
                foreach (var job in processingJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <tr class=\"js-jobs-list-row ");



            #line 73 "..\..\Pages\ProcessingJobsPage.cshtml"
                    Write(!job.Value.InProcessingState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral(" ");



            #line 73 "..\..\Pages\ProcessingJobsPage.cshtml"
                    Write(job.Value.InProcessingState ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                        <td>\r\n");



            #line 75 "..\..\Pages\ProcessingJobsPage.cshtml"
                    if (job.Value.InProcessingState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <input type=\"checkbox\" class=\"js-jobs-list-checkb" +
                                     "ox\" name=\"jobs[]\" value=\"");



            #line 77 "..\..\Pages\ProcessingJobsPage.cshtml"
                        Write(job.Key);


            #line default
            #line hidden
                        WriteLiteral("\" />\r\n");



            #line 78 "..\..\Pages\ProcessingJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n  " +
                                 "                          <a href=\"");



            #line 81 "..\..\Pages\ProcessingJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                ");



            #line 82 "..\..\Pages\ProcessingJobsPage.cshtml"
                    Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n                            </a>\r\n");



            #line 84 "..\..\Pages\ProcessingJobsPage.cshtml"
                    if (!job.Value.InProcessingState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
                                     "etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");



            #line 87 "..\..\Pages\ProcessingJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n  " +
                                 "                          ");



            #line 90 "..\..\Pages\ProcessingJobsPage.cshtml"
                    Write(job.Value.ServerId.ToUpperInvariant());


            #line default
            #line hidden
                    WriteLiteral("\r\n                        </td>\r\n                        <td>\r\n                  " +
                                 "          <a class=\"job-method\" href=\"");



            #line 93 "..\..\Pages\ProcessingJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                ");



            #line 94 "..\..\Pages\ProcessingJobsPage.cshtml"
                    Write(HtmlHelper.DisplayMethod(job.Value.Job));


            #line default
            #line hidden
                    WriteLiteral("\r\n                            </a>\r\n                        </td>\r\n              " +
                                 "          <td class=\"align-right\">\r\n");



            #line 98 "..\..\Pages\ProcessingJobsPage.cshtml"
                    if (job.Value.StartedAt.HasValue)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span data-moment=\"");



            #line 100 "..\..\Pages\ProcessingJobsPage.cshtml"
                        Write(JobHelper.ToStringTimestamp(job.Value.StartedAt.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                    ");



            #line 101 "..\..\Pages\ProcessingJobsPage.cshtml"
                        Write(job.Value.StartedAt);


            #line default
            #line hidden
                        WriteLiteral("\r\n                                </span>\r\n");



            #line 103 "..\..\Pages\ProcessingJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                    </tr>\r\n");



            #line 106 "..\..\Pages\ProcessingJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");



            #line 110 "..\..\Pages\ProcessingJobsPage.cshtml"


            #line default
            #line hidden

            #line 110 "..\..\Pages\ProcessingJobsPage.cshtml"
                Write(RenderPartial(new Paginator(pager)));


            #line default
            #line hidden

            #line 110 "..\..\Pages\ProcessingJobsPage.cshtml"
            }


            #line default
            #line hidden
        }
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 12 "..\..\Pages\RecurringJobsPage.cshtml"

            Layout = new LayoutPage {
                Title = "Recurring jobs"
            };



            #line default
            #line hidden
            WriteLiteral("\r\n");



            #line 16 "..\..\Pages\RecurringJobsPage.cshtml"
            if (RecurringJobs.Count == 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"alert alert-info\">\r\n        No recurring jobs found.\r\n    </div>\r" +
                             "\n");



            #line 21 "..\..\Pages\RecurringJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
                             "\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n     " +
                             "               data-url=\"");



            #line 27 "..\..\Pages\RecurringJobsPage.cshtml"
                Write(Request.LinkTo("/recurring/trigger"));


            #line default
            #line hidden
                WriteLiteral(@"""
                    data-loading-text=""Triggering..."">
                <span class=""glyphicon glyphicon-play-circle""></span>
                Trigger now
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");



            #line 34 "..\..\Pages\RecurringJobsPage.cshtml"
                Write(Request.LinkTo("/recurring/remove"));


            #line default
            #line hidden
                WriteLiteral(@"""
                    data-loading-text=""Removing...""
                    data-confirm=""Do you really want to REMOVE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Remove
            </button>
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th class=""min-width"">Cron</th>
                    <th>Job</th>
                    <th class=""align-right min-width"">Next execution</th>
                    <th class=""align-right min-width"">Last execution</th>
                </tr>
            </thead>
            <tbody>
");



            #line 56 "..\..\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 type=\"checkbox\" class=\"js-jobs-list-che" +
                                 "ckbox\" name=\"jobs[]\" value=\"");



            #line 60 "..\..\Pages\RecurringJobsPage.cshtml"
                    Write(job.Id);


            #line default
            #line hidden
                    WriteLiteral("\" />\r\n                        </td>\r\n                        <td class=\"min-width" +
                                 "\">");



            #line 62 "..\..\Pages\RecurringJobsPage.cshtml"
                    Write(job.Id);


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                        <td class=\"min-width\">");



            #line 63 "..\..\Pages\RecurringJobsPage.cshtml"
                    Write(CronExpressionDescriptor.ExpressionDescriptor.GetDescription(job.Cron));


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                        <td>\r\n");



            #line 65 "..\..\Pages\RecurringJobsPage.cshtml"
                    if (job.Job != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                ");

                        WriteLiteral(" ");



            #line 67 "..\..\Pages\RecurringJobsPage.cshtml"
                        Write(HtmlHelper.DisplayMethod(job.Job));


            #line default
            #line hidden
                        WriteLiteral("\r\n");



            #line 68 "..\..\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <em>");



            #line 71 "..\..\Pages\RecurringJobsPage.cshtml"
                        Write(job.LoadException.InnerException.Message);


            #line default
            #line hidden
                        WriteLiteral("</em>\r\n");



            #line 72 "..\..\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"align-right min" +
                                 "-width\">\r\n");



            #line 75 "..\..\Pages\RecurringJobsPage.cshtml"
                    if (job.NextExecution != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span data-moment=\"");



            #line 77 "..\..\Pages\RecurringJobsPage.cshtml"
                        Write(JobHelper.ToStringTimestamp(job.NextExecution.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                    ");



            #line 78 "..\..\Pages\RecurringJobsPage.cshtml"
                        Write(job.NextExecution.Value);


            #line default
            #line hidden
                        WriteLiteral("\r\n                                </span>\r\n");



            #line 80 "..\..\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <em>N/A</em>\r\n");



            #line 84 "..\..\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"align-right min" +
                                 "-width\">\r\n");



            #line 87 "..\..\Pages\RecurringJobsPage.cshtml"
                    if (job.LastExecution != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <a href=\"");



            #line 89 "..\..\Pages\RecurringJobsPage.cshtml"
                        Write(Request.LinkTo("/job/" + job.LastJobId));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                    <span class=\"label label-default label-ho" +
                                     "ver\" data-moment=\"");



            #line 90 "..\..\Pages\RecurringJobsPage.cshtml"
                        Write(JobHelper.ToStringTimestamp(job.LastExecution.Value));


            #line default
            #line hidden
                        WriteLiteral("\" style=\"");



            #line 90 "..\..\Pages\RecurringJobsPage.cshtml"
                        Write(JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.LastJobState) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.LastJobState]) : null);


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                        ");



            #line 91 "..\..\Pages\RecurringJobsPage.cshtml"
                        Write(job.LastExecution.Value);


            #line default
            #line hidden
                        WriteLiteral("\r\n                                    </span>\r\n                                </" +
                                     "a>\r\n");



            #line 94 "..\..\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <em>N/A</em>\r\n");



            #line 98 "..\..\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                    </tr>\r\n");



            #line 101 "..\..\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");



            #line 105 "..\..\Pages\RecurringJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    ");
        }
        public override void Execute()
        {


WriteLiteral("\r\n");








            
            #line 8 "..\..\Pages\FailedJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Failed Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<FailedJobDto> failedJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.FailedCount())
        {
            BasePageUrl = Request.LinkTo("/failed")
        };

        failedJobs = monitor
            .FailedJobs(pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 31 "..\..\Pages\FailedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-success\">\r\n        You have no failed jobs at the mom" +
"ent.\r\n    </div>\r\n");


            
            #line 36 "..\..\Pages\FailedJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
"\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n     " +
"               data-url=\"");


            
            #line 42 "..\..\Pages\FailedJobsPage.cshtml"
                         Write(Request.LinkTo("/failed/requeue"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Enqueueing..."">
                <span class=""glyphicon glyphicon-repeat""></span>
                Requeue jobs
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");


            
            #line 49 "..\..\Pages\FailedJobsPage.cshtml"
                         Write(Request.LinkTo("/failed/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");


            
            #line 56 "..\..\Pages\FailedJobsPage.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>

        <table class=""table failed-table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th>Failed</th>
                    <th>Job</th>
                </tr>
            </thead>
            <tbody>
");


            
            #line 71 "..\..\Pages\FailedJobsPage.cshtml"
                   var index = 0; 

            
            #line default
            #line hidden

            
            #line 72 "..\..\Pages\FailedJobsPage.cshtml"
                 foreach (var job in failedJobs)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr class=\"js-jobs-list-row ");


            
            #line 74 "..\..\Pages\FailedJobsPage.cshtml"
                                            Write(!job.Value.InFailedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 74 "..\..\Pages\FailedJobsPage.cshtml"
                                                                                                 Write(job.Value.InFailedState ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <td rowspan=\"");


            
            #line 75 "..\..\Pages\FailedJobsPage.cshtml"
                                 Write(job.Value.InFailedState ? "2" : "1");

            
            #line default
            #line hidden
WriteLiteral("\">\r\n");


            
            #line 76 "..\..\Pages\FailedJobsPage.cshtml"
                             if (job.Value.InFailedState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <input type=\"checkbox\" class=\"js-jobs-list-checkb" +
"ox\" name=\"jobs[]\" value=\"");


            
            #line 78 "..\..\Pages\FailedJobsPage.cshtml"
                                                                                                     Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n");


            
            #line 79 "..\..\Pages\FailedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td class=\"min-width\" rows" +
"pan=\"");


            
            #line 81 "..\..\Pages\FailedJobsPage.cshtml"
                                                   Write(job.Value.InFailedState ? "2" : "1");

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            <a href=\"");


            
            #line 82 "..\..\Pages\FailedJobsPage.cshtml"
                                Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 83 "..\..\Pages\FailedJobsPage.cshtml"
                           Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </a>\r\n");


            
            #line 85 "..\..\Pages\FailedJobsPage.cshtml"
                             if (!job.Value.InFailedState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
"etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 88 "..\..\Pages\FailedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n");


            
            #line 91 "..\..\Pages\FailedJobsPage.cshtml"
                             if (job.Value.FailedAt.HasValue)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span data-moment=\"");


            
            #line 93 "..\..\Pages\FailedJobsPage.cshtml"
                                              Write(JobHelper.ToStringTimestamp(job.Value.FailedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 94 "..\..\Pages\FailedJobsPage.cshtml"
                               Write(job.Value.FailedAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </span>\r\n");


            
            #line 96 "..\..\Pages\FailedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td>\r\n                    " +
"        <div>\r\n                                <a class=\"job-method\" href=\"");


            
            #line 100 "..\..\Pages\FailedJobsPage.cshtml"
                                                       Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 101 "..\..\Pages\FailedJobsPage.cshtml"
                               Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </a>\r\n                            </div>\r\n");


            
            #line 104 "..\..\Pages\FailedJobsPage.cshtml"
                             if (!String.IsNullOrEmpty(job.Value.ExceptionMessage))
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <div style=\"color: #888;\">\r\n                     " +
"               ");


            
            #line 107 "..\..\Pages\FailedJobsPage.cshtml"
                               Write(job.Value.Reason);

            
            #line default
            #line hidden
WriteLiteral(" <a class=\"expander\" href=\"#\">More&nbsp;details...</a>\r\n                         " +
"       </div>\r\n");


            
            #line 109 "..\..\Pages\FailedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                    </tr>\r\n");


            
            #line 112 "..\..\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\" st" +
"yle=\"");


            
            #line 116 "..\..\Pages\FailedJobsPage.cshtml"
                                                           Write(index++ == 0 ? "display: block;" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    <h4>");


            
            #line 117 "..\..\Pages\FailedJobsPage.cshtml"
                                   Write(job.Value.ExceptionType);

            
            #line default
            #line hidden
WriteLiteral("</h4>\r\n                                    <p>\r\n                                 " +
"       ");


            
            #line 119 "..\..\Pages\FailedJobsPage.cshtml"
                                   Write(job.Value.ExceptionMessage);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                    </p>\r\n\r\n");


            
            #line 122 "..\..\Pages\FailedJobsPage.cshtml"
                                     if (!String.IsNullOrEmpty(job.Value.ExceptionDetails))
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <pre class=\"stack-trace\">");


            
            #line 124 "..\..\Pages\FailedJobsPage.cshtml"
                                                            Write(HtmlHelper.MarkupStackTrace(job.Value.ExceptionDetails));

            
            #line default
            #line hidden
WriteLiteral("</pre>\r\n");


            
            #line 125 "..\..\Pages\FailedJobsPage.cshtml"
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                </div>\r\n                            </td>\r\n      " +
"                  </tr>\r\n");


            
            #line 129 "..\..\Pages\FailedJobsPage.cshtml"
                    }
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");


            
            #line 134 "..\..\Pages\FailedJobsPage.cshtml"

    
            
            #line default
            #line hidden
            
            #line 135 "..\..\Pages\FailedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 135 "..\..\Pages\FailedJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
        public override void Execute()
        {


WriteLiteral("\n");










            
            #line 10 "..\..\Pages\EnqueuedJobsPage.cshtml"
  
    Layout = new LayoutPage
        {
            Title = Queue.ToUpperInvariant(),
            Subtitle = "Enqueued jobs",
            Breadcrumbs = new Dictionary<string, string>
                {
                    { "Queues", Request.LinkTo("/queues") }
                }
        };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    var monitor = JobStorage.Current.GetMonitoringApi();
    Pager pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue))
    {
        BasePageUrl = Request.LinkTo("/queues/" + Queue)
    };

    JobList<EnqueuedJobDto> enqueuedJobs = monitor
        .EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\n");


            
            #line 36 "..\..\Pages\EnqueuedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\n        The queue is empty.\n    </div>\n");


            
            #line 41 "..\..\Pages\EnqueuedJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\n        <div class=\"btn-toolbar btn-toolbar-top\">\n" +
"            <button class=\"js-jobs-list-command btn btn-sm btn-default\"\n        " +
"            data-url=\"");


            
            #line 47 "..\..\Pages\EnqueuedJobsPage.cshtml"
                         Write(Request.LinkTo("/enqueued/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");


            
            #line 54 "..\..\Pages\EnqueuedJobsPage.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th class=""min-width"">State</th>
                    <th>Job</th>
                    <th class=""align-right"">Enqueued</th>
                </tr>
            </thead>
            <tbody>
");


            
            #line 70 "..\..\Pages\EnqueuedJobsPage.cshtml"
                 foreach (var job in enqueuedJobs)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr class=\"js-jobs-list-row hover ");


            
            #line 72 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                                  Write(!job.Value.InEnqueuedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\n                        <td>\n                            <input type=\"checkbox" +
"\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\"");


            
            #line 74 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                                                                                 Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\n                        </td>\n                        <td class=\"min-width\">" +
"\n                            <a href=\"");


            
            #line 77 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                ");


            
            #line 78 "..\..\Pages\EnqueuedJobsPage.cshtml"
                           Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\n                            </a>\n");


            
            #line 80 "..\..\Pages\EnqueuedJobsPage.cshtml"
                             if (!job.Value.InEnqueuedState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
"etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\n");


            
            #line 83 "..\..\Pages\EnqueuedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\n                        <td class=\"min-width\">\n    " +
"                        <span class=\"label label-default\" style=\"");


            
            #line 86 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                                                 Write(JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.Value.State) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.Value.State]) : null);

            
            #line default
            #line hidden
WriteLiteral("\">\n                                ");


            
            #line 87 "..\..\Pages\EnqueuedJobsPage.cshtml"
                           Write(job.Value.State);

            
            #line default
            #line hidden
WriteLiteral("\n                            </span>\n                        </td>\n              " +
"          <td>\n                            <a class=\"job-method\" href=\"");


            
            #line 91 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                                   Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                ");


            
            #line 92 "..\..\Pages\EnqueuedJobsPage.cshtml"
                           Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\n                            </a>\n                        </td>\n                 " +
"       <td class=\"align-right\">\n");


            
            #line 96 "..\..\Pages\EnqueuedJobsPage.cshtml"
                             if (job.Value.EnqueuedAt.HasValue)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span data-moment=\"");


            
            #line 98 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                              Write(JobHelper.ToTimestamp(job.Value.EnqueuedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                    ");


            
            #line 99 "..\..\Pages\EnqueuedJobsPage.cshtml"
                               Write(job.Value.EnqueuedAt);

            
            #line default
            #line hidden
WriteLiteral("\n                                </span>\n");


            
            #line 101 "..\..\Pages\EnqueuedJobsPage.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <em>n/a</em>\n");


            
            #line 105 "..\..\Pages\EnqueuedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\n                    </tr>\n");


            
            #line 108 "..\..\Pages\EnqueuedJobsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\n        </table>\n    </div>\n");


            
            #line 112 "..\..\Pages\EnqueuedJobsPage.cshtml"
    
            
            #line default
            #line hidden
            
            #line 112 "..\..\Pages\EnqueuedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 112 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
Ejemplo n.º 27
0
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\Pages\ScheduledJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Scheduled Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<ScheduleDto> scheduledJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.ScheduledCount())
        {
            BasePageUrl = Request.LinkTo("/scheduled")
        };

        scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 29 "..\..\Pages\ScheduledJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        There are no scheduled jobs.\r\n    </d" +
"iv>\r\n");


            
            #line 34 "..\..\Pages\ScheduledJobsPage.cshtml"
}
else
{
    
            
            #line default
            #line hidden
            
            #line 37 "..\..\Pages\ScheduledJobsPage.cshtml"
Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
            
            #line 37 "..\..\Pages\ScheduledJobsPage.cshtml"
                                              
    

            
            #line default
            #line hidden
WriteLiteral("    <table class=\"table\">\r\n        <thead>\r\n            <tr>\r\n                <th" +
">Id</th>\r\n                <th>Enqueue</th>\r\n                <th>Job</th>\r\n      " +
"          <th></th>\r\n            </tr>\r\n        </thead>\r\n");


            
            #line 48 "..\..\Pages\ScheduledJobsPage.cshtml"
         foreach (var job in scheduledJobs)
        {

            
            #line default
            #line hidden
WriteLiteral("            <tr class=\"");


            
            #line 50 "..\..\Pages\ScheduledJobsPage.cshtml"
                   Write(!job.Value.InScheduledState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                <td>\r\n                    <a href=\"");


            
            #line 52 "..\..\Pages\ScheduledJobsPage.cshtml"
                        Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        ");


            
            #line 53 "..\..\Pages\ScheduledJobsPage.cshtml"
                   Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </a>\r\n");


            
            #line 55 "..\..\Pages\ScheduledJobsPage.cshtml"
                     if (!job.Value.InScheduledState)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <span title=\"Job\'s state has been changed while fetching " +
"data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 58 "..\..\Pages\ScheduledJobsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </td>\r\n                <td data-moment=\"");


            
            #line 60 "..\..\Pages\ScheduledJobsPage.cshtml"
                            Write(JobHelper.ToStringTimestamp(job.Value.EnqueueAt));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 60 "..\..\Pages\ScheduledJobsPage.cshtml"
                                                                                 Write(job.Value.EnqueueAt);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                <td>\r\n                    <span title=\"");


            
            #line 62 "..\..\Pages\ScheduledJobsPage.cshtml"
                            Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        ");


            
            #line 63 "..\..\Pages\ScheduledJobsPage.cshtml"
                   Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </span>\r\n                </td>\r\n                <td>\r\n");


            
            #line 67 "..\..\Pages\ScheduledJobsPage.cshtml"
                     if (job.Value.InScheduledState)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <button class=\"btn btn-default btn-sm\" data-ajax=\"");


            
            #line 69 "..\..\Pages\ScheduledJobsPage.cshtml"
                                                                     Write(Request.LinkTo("/schedule/enqueue/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\" data-loading-text=\"Enqueueing...\">\r\n                            <span class=\"gl" +
"yphicon glyphicon-play\"></span>\r\n                            Enqueue now\r\n      " +
"                  </button>\r\n");


            
            #line 73 "..\..\Pages\ScheduledJobsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </td>\r\n            </tr>\r\n");


            
            #line 76 "..\..\Pages\ScheduledJobsPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </table>\r\n");


            
            #line 78 "..\..\Pages\ScheduledJobsPage.cshtml"
    
    
            
            #line default
            #line hidden
            
            #line 79 "..\..\Pages\ScheduledJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 79 "..\..\Pages\ScheduledJobsPage.cshtml"
                                        
}
            
            #line default
            #line hidden

        }
Ejemplo n.º 28
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 8 "..\..\Pages\DashboardPage.cshtml"

            Layout = new LayoutPage {
                Title = "Dashboard"
            };
            IDictionary <DateTime, long> succeeded = null;
            IDictionary <DateTime, long> failed    = null;

            var period = Request.QueryString["period"] ?? "day";

            using (var monitor = JobStorage.Current.GetMonitoringApi())
            {
                if ("week".Equals(period, StringComparison.OrdinalIgnoreCase))
                {
                    succeeded = monitor.SucceededByDatesCount();
                    failed    = monitor.FailedByDatesCount();
                }
                else if ("day".Equals(period, StringComparison.OrdinalIgnoreCase))
                {
                    succeeded = monitor.HourlySucceededJobs();
                    failed    = monitor.HourlyFailedJobs();
                }
            }



            #line default
            #line hidden
            WriteLiteral("\r\n<h3>Realtime graph</h3>\r\n<div id=\"realtimeGraph\"></div>\r\n\r\n<h3>\r\n    <div class" +
                         "=\"btn-group pull-right\" style=\"margin-top: 2px;\">\r\n        <a href=\"?period=day\"" +
                         " class=\"btn btn-sm btn-default ");



            #line 35 "..\..\Pages\DashboardPage.cshtml"
            Write("day".Equals(period, StringComparison.OrdinalIgnoreCase) ? "active" : null);


            #line default
            #line hidden
            WriteLiteral("\">\r\n            Day\r\n        </a>\r\n        <a href=\"?period=week\" class=\"btn btn-" +
                         "sm btn-default ");



            #line 38 "..\..\Pages\DashboardPage.cshtml"
            Write("week".Equals(period, StringComparison.OrdinalIgnoreCase) ? "active" : null);


            #line default
            #line hidden
            WriteLiteral("\">Week</a>\r\n    </div>\r\n    History graph\r\n</h3>\r\n\r\n");



            #line 43 "..\..\Pages\DashboardPage.cshtml"
            if (succeeded != null && failed != null)
            {
            #line default
            #line hidden
                WriteLiteral("    <div id=\"historyGraph\" \r\n          data-succeeded=\"");



            #line 46 "..\..\Pages\DashboardPage.cshtml"
                Write(JsonConvert.SerializeObject(succeeded));


            #line default
            #line hidden
                WriteLiteral("\" \r\n          data-failed=\"");



            #line 47 "..\..\Pages\DashboardPage.cshtml"
                Write(JsonConvert.SerializeObject(failed));


            #line default
            #line hidden
                WriteLiteral("\">\r\n    </div>\r\n");



            #line 49 "..\..\Pages\DashboardPage.cshtml"
            }

            #line default
            #line hidden
        }
        public override void Execute()
        {
            WriteLiteral("\n");



            #line 8 "..\..\Pages\FailedJobsPage.cshtml"

            Layout = new LayoutPage {
                Title = "Failed Jobs"
            };

            int from, perPage;

            int.TryParse(Request.QueryString["from"], out from);
            int.TryParse(Request.QueryString["count"], out perPage);

            var   monitor = JobStorage.Current.GetMonitoringApi();
            Pager pager   = new Pager(from, perPage, monitor.FailedCount())
            {
                BasePageUrl = Request.LinkTo("/failed")
            };

            JobList <FailedJobDto> failedJobs = monitor
                                                .FailedJobs(pager.FromRecord, pager.RecordsPerPage);



            #line default
            #line hidden
            WriteLiteral("\n");



            #line 26 "..\..\Pages\FailedJobsPage.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"alert alert-success\">\n        You have no failed jobs at the mome" +
                             "nt.\n    </div>\n");



            #line 31 "..\..\Pages\FailedJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"js-jobs-list\">\n        <div class=\"btn-toolbar btn-toolbar-top\">\n" +
                             "            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\n        " +
                             "            data-url=\"");



            #line 37 "..\..\Pages\FailedJobsPage.cshtml"
                Write(Request.LinkTo("/failed/requeue"));


            #line default
            #line hidden
                WriteLiteral(@"""
                    data-loading-text=""Enqueueing..."">
                <span class=""glyphicon glyphicon-repeat""></span>
                Requeue jobs
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");



            #line 44 "..\..\Pages\FailedJobsPage.cshtml"
                Write(Request.LinkTo("/failed/delete"));


            #line default
            #line hidden
                WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");



            #line 51 "..\..\Pages\FailedJobsPage.cshtml"
                Write(RenderPartial(new PerPageSelector(pager)));


            #line default
            #line hidden
                WriteLiteral(@"
        </div>

        <table class=""table failed-table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th>Failed</th>
                    <th>Job</th>
                </tr>
            </thead>
            <tbody>
");



            #line 66 "..\..\Pages\FailedJobsPage.cshtml"
                var index = 0;


            #line default
            #line hidden


            #line 67 "..\..\Pages\FailedJobsPage.cshtml"
                foreach (var job in failedJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <tr class=\"js-jobs-list-row ");



            #line 69 "..\..\Pages\FailedJobsPage.cshtml"
                    Write(!job.Value.InFailedState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral(" ");



            #line 69 "..\..\Pages\FailedJobsPage.cshtml"
                    Write(job.Value.InFailedState ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\n                        <td rowspan=\"");



            #line 70 "..\..\Pages\FailedJobsPage.cshtml"
                    Write(job.Value.InFailedState ? "2" : "1");


            #line default
            #line hidden
                    WriteLiteral("\">\n");



            #line 71 "..\..\Pages\FailedJobsPage.cshtml"
                    if (job.Value.InFailedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <input type=\"checkbox\" class=\"js-jobs-list-checkb" +
                                     "ox\" name=\"jobs[]\" value=\"");



            #line 73 "..\..\Pages\FailedJobsPage.cshtml"
                        Write(job.Key);


            #line default
            #line hidden
                        WriteLiteral("\" />\n");



            #line 74 "..\..\Pages\FailedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\n                        <td class=\"min-width\" rowsp" +
                                 "an=\"");



            #line 76 "..\..\Pages\FailedJobsPage.cshtml"
                    Write(job.Value.InFailedState ? "2" : "1");


            #line default
            #line hidden
                    WriteLiteral("\">\n                            <a href=\"");



            #line 77 "..\..\Pages\FailedJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\n                                ");



            #line 78 "..\..\Pages\FailedJobsPage.cshtml"
                    Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\n                            </a>\n");



            #line 80 "..\..\Pages\FailedJobsPage.cshtml"
                    if (!job.Value.InFailedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
                                     "etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\n");



            #line 83 "..\..\Pages\FailedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\n                        <td class=\"min-width\">\n");



            #line 86 "..\..\Pages\FailedJobsPage.cshtml"
                    if (job.Value.FailedAt.HasValue)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span data-moment=\"");



            #line 88 "..\..\Pages\FailedJobsPage.cshtml"
                        Write(JobHelper.ToStringTimestamp(job.Value.FailedAt.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\n                                    ");



            #line 89 "..\..\Pages\FailedJobsPage.cshtml"
                        Write(job.Value.FailedAt);


            #line default
            #line hidden
                        WriteLiteral("\n                                </span>\n");



            #line 91 "..\..\Pages\FailedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\n                        <td>\n                      " +
                                 "      <div>\n                                <a class=\"job-method\" href=\"");



            #line 95 "..\..\Pages\FailedJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\n                                    ");



            #line 96 "..\..\Pages\FailedJobsPage.cshtml"
                    Write(HtmlHelper.DisplayMethod(job.Value.Job));


            #line default
            #line hidden
                    WriteLiteral("\n                                </a>\n                            </div>\n");



            #line 99 "..\..\Pages\FailedJobsPage.cshtml"
                    if (!String.IsNullOrEmpty(job.Value.ExceptionMessage))
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <div style=\"color: #888;\">\n                      " +
                                     "              ");



            #line 102 "..\..\Pages\FailedJobsPage.cshtml"
                        Write(job.Value.Reason);


            #line default
            #line hidden
                        WriteLiteral(" <a class=\"expander\" href=\"#\">More&nbsp;details...</a>\n                          " +
                                     "      </div>\n");



            #line 104 "..\..\Pages\FailedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\n                    </tr>\n");



            #line 107 "..\..\Pages\FailedJobsPage.cshtml"
                    if (job.Value.InFailedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                        <tr>\n                            <td colspan=\"2\" class=\"f" +
                                     "ailed-job-details\">\n                                <div class=\"expandable\" styl" +
                                     "e=\"");



            #line 111 "..\..\Pages\FailedJobsPage.cshtml"
                        Write(index++ == 0 ? "display: block;" : null);


            #line default
            #line hidden
                        WriteLiteral("\">\n                                    <h4>");



            #line 112 "..\..\Pages\FailedJobsPage.cshtml"
                        Write(job.Value.ExceptionType);


            #line default
            #line hidden
                        WriteLiteral("</h4>\n                                    <p>\n                                   " +
                                     "     ");



            #line 114 "..\..\Pages\FailedJobsPage.cshtml"
                        Write(job.Value.ExceptionMessage);


            #line default
            #line hidden
                        WriteLiteral("\n                                    </p>\n\n");



            #line 117 "..\..\Pages\FailedJobsPage.cshtml"
                        if (!String.IsNullOrEmpty(job.Value.ExceptionDetails))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                        <pre class=\"stack-trace\">");



            #line 119 "..\..\Pages\FailedJobsPage.cshtml"
                            Write(HtmlHelper.MarkupStackTrace(job.Value.ExceptionDetails));


            #line default
            #line hidden
                            WriteLiteral("</pre>\n");



            #line 120 "..\..\Pages\FailedJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                </div>\n                            </td>\n        " +
                                     "                </tr>\n");



            #line 124 "..\..\Pages\FailedJobsPage.cshtml"
                    }
                }


            #line default
            #line hidden
                WriteLiteral("            </tbody>\n        </table>\n    </div>\n");



            #line 129 "..\..\Pages\FailedJobsPage.cshtml"



            #line default
            #line hidden

            #line 130 "..\..\Pages\FailedJobsPage.cshtml"
                Write(RenderPartial(new Paginator(pager)));


            #line default
            #line hidden

            #line 130 "..\..\Pages\FailedJobsPage.cshtml"
            }


            #line default
            #line hidden
        }
Ejemplo n.º 30
0
        public override void Execute()
        {


WriteLiteral("\r\n");









            
            #line 9 "..\..\Pages\SucceededJobs.cshtml"
  
    Layout = new LayoutPage { Title = "Succeeded Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<SucceededJobDto> succeededJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.SucceededListCount())
        {
            BasePageUrl = Request.LinkTo("/succeeded")
        };

        succeededJobs = monitor
            .SucceededJobs(pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 32 "..\..\Pages\SucceededJobs.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        No succeeded jobs found.\r\n    </div>\r" +
"\n");


            
            #line 37 "..\..\Pages\SucceededJobs.cshtml"
}
else
{
    
            
            #line default
            #line hidden
            
            #line 40 "..\..\Pages\SucceededJobs.cshtml"
Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
            
            #line 40 "..\..\Pages\SucceededJobs.cshtml"
                                              
    

            
            #line default
            #line hidden
WriteLiteral("    <table class=\"table\">\r\n        <thead>\r\n            <tr>\r\n                <th" +
">Id</th>\r\n                <th>Job</th>\r\n                <th>Succeeded</th>\r\n    " +
"        </tr>\r\n        </thead>\r\n        <tbody>\r\n");


            
            #line 51 "..\..\Pages\SucceededJobs.cshtml"
             foreach (var job in succeededJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr class=\"");


            
            #line 53 "..\..\Pages\SucceededJobs.cshtml"
                       Write(job.Value != null && !job.Value.InSucceededState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <td>\r\n                        <a href=\"");


            
            #line 55 "..\..\Pages\SucceededJobs.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 56 "..\..\Pages\SucceededJobs.cshtml"
                       Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n");


            
            #line 58 "..\..\Pages\SucceededJobs.cshtml"
                         if (job.Value != null && !job.Value.InSucceededState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span title=\"Job\'s state has been changed while fetch" +
"ing data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 61 "..\..\Pages\SucceededJobs.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n\r\n");


            
            #line 64 "..\..\Pages\SucceededJobs.cshtml"
                     if (job.Value == null)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <td colspan=\"3\"><em>Job was expired.</em>\r\n              " +
"          </td>\r\n");


            
            #line 68 "..\..\Pages\SucceededJobs.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <td>\r\n                            <span title=\"");


            
            #line 72 "..\..\Pages\SucceededJobs.cshtml"
                                    Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 73 "..\..\Pages\SucceededJobs.cshtml"
                           Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("    \r\n                            </span>\r\n                        </td>\r\n");



WriteLiteral("                        <td>\r\n");


            
            #line 77 "..\..\Pages\SucceededJobs.cshtml"
                             if (job.Value.SucceededAt.HasValue)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span  data-moment=\"");


            
            #line 79 "..\..\Pages\SucceededJobs.cshtml"
                                               Write(JobHelper.ToStringTimestamp(job.Value.SucceededAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 80 "..\..\Pages\SucceededJobs.cshtml"
                               Write(job.Value.SucceededAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </span>\r\n");


            
            #line 82 "..\..\Pages\SucceededJobs.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n");


            
            #line 84 "..\..\Pages\SucceededJobs.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </tr>\r\n");


            
            #line 86 "..\..\Pages\SucceededJobs.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 89 "..\..\Pages\SucceededJobs.cshtml"
    
    
            
            #line default
            #line hidden
            
            #line 90 "..\..\Pages\SucceededJobs.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 90 "..\..\Pages\SucceededJobs.cshtml"
                                        
}
            
            #line default
            #line hidden

        }
        public override void Execute()
        {
            WriteLiteral("\n");



            #line 8 "..\..\Pages\DeletedJobsPage.cshtml"

            Layout = new LayoutPage {
                Title = "Deleted Jobs"
            };

            int from, perPage;

            int.TryParse(Request.QueryString["from"], out from);
            int.TryParse(Request.QueryString["count"], out perPage);

            var   monitor = JobStorage.Current.GetMonitoringApi();
            Pager pager   = new Pager(from, perPage, monitor.DeletedListCount())
            {
                BasePageUrl = Request.LinkTo("/deleted")
            };

            JobList <DeletedJobDto> jobs = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage);



            #line default
            #line hidden
            WriteLiteral("\n");



            #line 25 "..\..\Pages\DeletedJobsPage.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"alert alert-info\">\n        No deleted jobs found.\n    </div>\n");



            #line 30 "..\..\Pages\DeletedJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"js-jobs-list\">\n        <div class=\"btn-toolbar btn-toolbar-top\">\n" +
                             "            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\n        " +
                             "            data-url=\"");



            #line 36 "..\..\Pages\DeletedJobsPage.cshtml"
                Write(Request.LinkTo("/deleted/requeue"));


            #line default
            #line hidden
                WriteLiteral("\"\n                    data-loading-text=\"Enqueueing...\">\n                <span cl" +
                             "ass=\"glyphicon glyphicon-repeat\"></span>\n                Requeue jobs\n          " +
                             "  </button>\n            ");



            #line 41 "..\..\Pages\DeletedJobsPage.cshtml"
                Write(RenderPartial(new PerPageSelector(pager)));


            #line default
            #line hidden
                WriteLiteral(@"
        </div>
        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th>Job</th>
                    <th class=""align-right"">Deleted</th>
                </tr>
            </thead>
            <tbody>
");



            #line 55 "..\..\Pages\DeletedJobsPage.cshtml"
                foreach (var job in jobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <tr class=\"js-jobs-list-row ");



            #line 57 "..\..\Pages\DeletedJobsPage.cshtml"
                    Write(job.Value != null && !job.Value.InDeletedState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral(" ");



            #line 57 "..\..\Pages\DeletedJobsPage.cshtml"
                    Write(job.Value != null && job.Value.InDeletedState && job.Value != null ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\n                        <td>\n");



            #line 59 "..\..\Pages\DeletedJobsPage.cshtml"
                    if (job.Value != null && job.Value.InDeletedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <input type=\"checkbox\" class=\"js-jobs-list-checkb" +
                                     "ox\" name=\"jobs[]\" value=\"");



            #line 61 "..\..\Pages\DeletedJobsPage.cshtml"
                        Write(job.Key);


            #line default
            #line hidden
                        WriteLiteral("\" />\n");



            #line 62 "..\..\Pages\DeletedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\n                        <td class=\"min-width\">\n    " +
                                 "                        <a href=\"");



            #line 65 "..\..\Pages\DeletedJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\n                                ");



            #line 66 "..\..\Pages\DeletedJobsPage.cshtml"
                    Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\n                            </a>\n");



            #line 68 "..\..\Pages\DeletedJobsPage.cshtml"
                    if (job.Value != null && !job.Value.InDeletedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
                                     "etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\n");



            #line 71 "..\..\Pages\DeletedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\n\n");



            #line 74 "..\..\Pages\DeletedJobsPage.cshtml"
                    if (job.Value == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <td colspan=\"2\">\n                                <em>" +
                                     "Job was expired.</em>\n                            </td>\n");



            #line 79 "..\..\Pages\DeletedJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <td>\n                                <a class=\"job-me" +
                                     "thod\" href=\"");



            #line 83 "..\..\Pages\DeletedJobsPage.cshtml"
                        Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                        WriteLiteral("\">\n                                    ");



            #line 84 "..\..\Pages\DeletedJobsPage.cshtml"
                        Write(HtmlHelper.DisplayMethod(job.Value.Job));


            #line default
            #line hidden
                        WriteLiteral("\n                                </a>\n                            </td>\n");



                        WriteLiteral("                            <td class=\"align-right\">\n");



            #line 88 "..\..\Pages\DeletedJobsPage.cshtml"
                        if (job.Value.DeletedAt.HasValue)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                    <span data-moment=\"");



            #line 90 "..\..\Pages\DeletedJobsPage.cshtml"
                            Write(JobHelper.ToStringTimestamp(job.Value.DeletedAt.Value));


            #line default
            #line hidden
                            WriteLiteral("\">\n                                        ");



            #line 91 "..\..\Pages\DeletedJobsPage.cshtml"
                            Write(job.Value.DeletedAt);


            #line default
            #line hidden
                            WriteLiteral("\n                                    </span>\n");



            #line 93 "..\..\Pages\DeletedJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                            </td>\n");



            #line 95 "..\..\Pages\DeletedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </tr>\n");



            #line 97 "..\..\Pages\DeletedJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </tbody>\n        </table>\n    </div>\n");



            #line 101 "..\..\Pages\DeletedJobsPage.cshtml"


            #line default
            #line hidden

            #line 101 "..\..\Pages\DeletedJobsPage.cshtml"
                Write(RenderPartial(new Paginator(pager)));


            #line default
            #line hidden

            #line 101 "..\..\Pages\DeletedJobsPage.cshtml"
            }


            #line default
            #line hidden
        }
Ejemplo n.º 32
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 10 "..\..\Pages\EnqueuedJobsPage.cshtml"

            Layout = new LayoutPage
            {
                Title       = Queue.ToUpperInvariant(),
                Subtitle    = "Enqueued jobs",
                Breadcrumbs = new Dictionary <string, string>
                {
                    { "Queues", Request.LinkTo("/queues") }
                }
            };

            int from, perPage;

            int.TryParse(Request.QueryString["from"], out from);
            int.TryParse(Request.QueryString["count"], out perPage);

            Pager pager;
            JobList <EnqueuedJobDto> enqueuedJobs;

            using (var monitor = JobStorage.Current.GetMonitoringApi())
            {
                pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue))
                {
                    BasePageUrl = Request.LinkTo("/queues/" + Queue)
                };

                enqueuedJobs = monitor
                               .EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);
            }



            #line default
            #line hidden
            WriteLiteral("\r\n");



            #line 41 "..\..\Pages\EnqueuedJobsPage.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"alert alert-info\">\r\n        The queue is empty.\r\n    </div>\r\n");



            #line 46 "..\..\Pages\EnqueuedJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
                             "\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-default\"\r\n     " +
                             "               data-url=\"");



            #line 52 "..\..\Pages\EnqueuedJobsPage.cshtml"
                Write(Request.LinkTo("/enqueued/delete"));


            #line default
            #line hidden
                WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");



            #line 59 "..\..\Pages\EnqueuedJobsPage.cshtml"
                Write(RenderPartial(new PerPageSelector(pager)));


            #line default
            #line hidden
                WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th class=""min-width"">State</th>
                    <th>Job</th>
                    <th class=""align-right"">Enqueued</th>
                </tr>
            </thead>
            <tbody>
");



            #line 75 "..\..\Pages\EnqueuedJobsPage.cshtml"
                foreach (var job in enqueuedJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <tr class=\"js-jobs-list-row hover ");



            #line 77 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    Write(!job.Value.InEnqueuedState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                        <td>\r\n                            <input type=\"checkb" +
                                 "ox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\"");



            #line 79 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    Write(job.Key);


            #line default
            #line hidden
                    WriteLiteral("\" />\r\n                        </td>\r\n                        <td class=\"min-width" +
                                 "\">\r\n                            <a href=\"");



            #line 82 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                ");



            #line 83 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n                            </a>\r\n");



            #line 85 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    if (!job.Value.InEnqueuedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
                                     "etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");



            #line 88 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n  " +
                                 "                          <span class=\"label label-default\" style=\"");



            #line 91 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    Write(JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.Value.State) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.Value.State]) : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                ");



            #line 92 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    Write(job.Value.State);


            #line default
            #line hidden
                    WriteLiteral("\r\n                            </span>\r\n                        </td>\r\n           " +
                                 "             <td>\r\n                            <a class=\"job-method\" href=\"");



            #line 96 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                ");



            #line 97 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    Write(HtmlHelper.DisplayMethod(job.Value.Job));


            #line default
            #line hidden
                    WriteLiteral("\r\n                            </a>\r\n                        </td>\r\n              " +
                                 "          <td class=\"align-right\">\r\n");



            #line 101 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    if (job.Value.EnqueuedAt.HasValue)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span data-moment=\"");



            #line 103 "..\..\Pages\EnqueuedJobsPage.cshtml"
                        Write(JobHelper.ToStringTimestamp(job.Value.EnqueuedAt.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                    ");



            #line 104 "..\..\Pages\EnqueuedJobsPage.cshtml"
                        Write(job.Value.EnqueuedAt);


            #line default
            #line hidden
                        WriteLiteral("\r\n                                </span>\r\n");



            #line 106 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <em>n/a</em>\r\n");



            #line 110 "..\..\Pages\EnqueuedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                    </tr>\r\n");



            #line 113 "..\..\Pages\EnqueuedJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");



            #line 117 "..\..\Pages\EnqueuedJobsPage.cshtml"


            #line default
            #line hidden

            #line 117 "..\..\Pages\EnqueuedJobsPage.cshtml"
                Write(RenderPartial(new Paginator(pager)));


            #line default
            #line hidden

            #line 117 "..\..\Pages\EnqueuedJobsPage.cshtml"
            }


            #line default
            #line hidden
        }