コード例 #1
0
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
  
    Layout = new LayoutPage(Strings.FailedJobsPage_Title);

    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    var monitor = Storage.GetMonitoringApi();
    var pager = new Pager(from, perPage, monitor.FailedCount());
    var failedJobs = monitor.FailedJobs(pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 22 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");


            
            #line 25 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                           Write(Strings.FailedJobsPage_Title);

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


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

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-success\">\r\n               ");


            
            #line 30 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
          Write(Strings.FailedJobsPage_NoJobs);

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


            
            #line 32 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
        }
        else
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-warning\">\r\n                ");


            
            #line 36 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
           Write(Html.Raw(Strings.FailedJobsPage_FailedJobsNotExpire_Warning_Html));

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


            
            #line 38 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
            

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


            
            #line 42 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                 Write(Url.To("/jobs/failed/requeue"));

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


            
            #line 43 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                          Write(Strings.Common_Enqueueing);

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
"n class=\"glyphicon glyphicon-repeat\"></span>\r\n                        ");


            
            #line 46 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                   Write(Strings.Common_RequeueJobs);

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </button>\r\n\r\n                    <button class=\"js-jobs-lis" +
"t-command btn btn-sm btn-default\"\r\n                            data-url=\"");


            
            #line 50 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                 Write(Url.To("/jobs/failed/delete"));

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


            
            #line 51 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                          Write(Strings.Common_Deleting);

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


            
            #line 52 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                     Write(Strings.Common_DeleteConfirm);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <span class=\"glyphicon glyphicon-remove\"></span>\r\n   " +
"                     ");


            
            #line 54 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                   Write(Strings.Common_DeleteSelected);

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


            
            #line 57 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
               Write(Html.PerPageSelector(pager));

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

                <div class=""table-responsive"">
                    <table class=""table"">
                        <thead>
                            <tr>
                                <th class=""min-width"">
                                    <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                </th>
                                <th class=""min-width"">");


            
            #line 67 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                 Write(Strings.Common_Id);

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


            
            #line 68 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                               Write(Strings.FailedJobsPage_Table_Failed);

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


            
            #line 69 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                               Write(Strings.Common_Job);

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


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

            
            #line default
            #line hidden

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

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


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

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


            
            #line 76 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                                                                             Write(job.Value.InFailedState ? "hover" : null);

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


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

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


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

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


            
            #line 80 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                                                                                 Write(job.Key);

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


            
            #line 81 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                        }

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


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

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


            
            #line 84 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                   Write(Html.JobIdLink(job.Key));

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


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

            
            #line default
            #line hidden
WriteLiteral("                                            <span title=\"");


            
            #line 87 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                    Write(Strings.Common_JobStateChanged_Text);

            
            #line default
            #line hidden
WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 88 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                        }

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


            
            #line 91 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                         if (job.Value.FailedAt.HasValue)
                                        {
                                            
            
            #line default
            #line hidden
            
            #line 93 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                       Write(Html.RelativeTime(job.Value.FailedAt.Value));

            
            #line default
            #line hidden
            
            #line 93 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                                                        
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                    </td>\r\n                                    <t" +
"d>\r\n                                        <div class=\"word-break\">\r\n          " +
"                                  ");


            
            #line 98 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                       Write(Html.JobNameLink(job.Key, job.Value.Job));

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


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

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


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

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


            
            #line 103 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                                                           Write(index == 0 ? Strings.Common_LessDetails : Strings.Common_MoreDetails);

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


            
            #line 105 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                        }

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


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

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


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

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


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

            
            #line default
            #line hidden
WriteLiteral("</h4>\r\n                                                <p class=\"text-muted\">\r\n  " +
"                                                  ");


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

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


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

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


            
            #line 120 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                                              Write(Html.StackTrace(job.Value.ExceptionDetails));

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


            
            #line 121 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                }

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


            
            #line 125 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                }
                            }

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


            
            #line 131 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
           Write(Html.Paginator(pager));

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


            
            #line 133 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
        }

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


        }
コード例 #2
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 6 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"

            Layout = new LayoutPage(Strings.ScheduledJobsPage_Title);

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            var monitor       = Storage.GetMonitoringApi();
            var pager         = new Pager(from, perPage, monitor.ScheduledCount());
            var scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage);



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 21 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");



            #line 24 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
            Write(Strings.ScheduledJobsPage_Title);


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



            #line 26 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");



            #line 29 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Strings.ScheduledJobsPage_NoJobs);


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



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



            #line 37 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Url.To("/jobs/scheduled/enqueue"));


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



            #line 38 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Strings.Common_Enqueueing);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
                             "n class=\"glyphicon glyphicon-play\"></span>\r\n                        ");



            #line 41 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Strings.ScheduledJobsPage_EnqueueNow);


            #line default
            #line hidden
                WriteLiteral("\r\n                    </button>\r\n\r\n                    <button class=\"js-jobs-lis" +
                             "t-command btn btn-sm btn-default\"\r\n                            data-url=\"");



            #line 45 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Url.To("/jobs/scheduled/delete"));


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



            #line 46 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Strings.Common_Deleting);


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



            #line 47 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Strings.Common_DeleteConfirm);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
                             "n class=\"glyphicon glyphicon-remove\"></span>\r\n                        ");



            #line 50 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Strings.Common_DeleteSelected);


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



            #line 53 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Html.PerPageSelector(pager));


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

                <div class=""table-responsive"">
                    <table class=""table"">
                        <thead>
                            <tr>
                                <th class=""min-width"">
                                    <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                </th>
                                <th class=""min-width"">");



            #line 63 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Strings.Common_Id);


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



            #line 64 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Strings.ScheduledJobsPage_Table_Enqueue);


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



            #line 65 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Strings.Common_Job);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"align-right\">ScheduledJobsPage_" +
                             "Table_Scheduled</th>\r\n                            </tr>\r\n                       " +
                             " </thead>\r\n");



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



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


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



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


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



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



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


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



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


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



            #line 79 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    Write(Html.JobIdLink(job.Key));


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



            #line 80 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    if (!job.Value.InScheduledState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <span title=\"");



            #line 82 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                        Write(Strings.Common_JobStateChanged_Text);


            #line default
            #line hidden
                        WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");



            #line 83 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    }


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



            #line 86 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    Write(Html.RelativeTime(job.Value.EnqueueAt));


            #line default
            #line hidden
                    WriteLiteral("\r\n                                </td>\r\n                                <td clas" +
                                 "s=\"word-break\">\r\n                                    ");



            #line 89 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    Write(Html.JobNameLink(job.Key, job.Value.Job));


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



            #line 92 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    if (job.Value.ScheduledAt.HasValue)
                    {
            #line default
            #line hidden

            #line 94 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                        Write(Html.RelativeTime(job.Value.ScheduledAt.Value));


            #line default
            #line hidden

            #line 94 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    }


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



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


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



            #line 102 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(Html.Paginator(pager));


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



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


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #3
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 9 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"

            Layout = new LayoutPage("Recurring jobs");
            List <RecurringJobDto> recurringJobs;

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            Pager pager = null;

            using (var connection = Storage.GetConnection())
            {
                var storageConnection = connection as JobStorageConnection;
                if (storageConnection != null)
                {
                    pager         = new Pager(from, perPage, storageConnection.GetRecurringJobCount());
                    recurringJobs = storageConnection.GetRecurringJobs(pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1);
                }
                else
                {
                    recurringJobs = connection.GetRecurringJobs();
                }
            }



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-12\">\r\n        <h1 class=\"page-header\"" +
                         ">Recurring Jobs</h1>\r\n\r\n");



            #line 39 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
            if (recurringJobs.Count == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-info\">\r\n                No recurring jobs fou" +
                             "nd.\r\n            </div>\r\n");



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



            #line 50 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Url.To("/recurring/trigger"));


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

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



            #line 58 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Url.To("/recurring/remove"));


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

");



            #line 66 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                if (pager != null)
                {
            #line default
            #line hidden
                    WriteLiteral("                        ");

                    WriteLiteral(" ");



            #line 68 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Html.PerPageSelector(pager));


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



            #line 69 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


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

                <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>Time zone</th>
                        <th>Job</th>
                        <th class=""align-right min-width"">Next execution</th>
                        <th class=""align-right min-width"">Last execution</th>
                        <th class=""align-right min-width"">Created At</th>
                    </tr>
                    </thead>
                    <tbody>
");



            #line 88 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                foreach (var job in recurringJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                        <tr class=\"js-jobs-list-row hover\">\r\n                    " +
                                 "        <td>\r\n                                <input type=\"checkbox\" class=\"js-j" +
                                 "obs-list-checkbox\" name=\"jobs[]\" value=\"");



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


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



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


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



                    WriteLiteral("\r\n");



            #line 97 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"

                    var cronDescription = job.Cron;
                    try
                    {
                        cronDescription = ExpressionDescriptor.GetDescription(job.Cron);
                    }
                    catch (FormatException)
                    {
                    }



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



            #line 107 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(cronDescription);


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



            #line 110 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (!String.IsNullOrWhiteSpace(job.TimeZoneId))
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <span title=\"");



            #line 112 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(TimeZoneInfo.FindSystemTimeZoneById(job.TimeZoneId).DisplayName);


            #line default
            #line hidden
                        WriteLiteral("\" data-container=\"body\">");



            #line 112 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(job.TimeZoneId);


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



            #line 113 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    ");

                        WriteLiteral(" UTC\r\n");



            #line 117 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


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



            #line 120 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.Job != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    ");

                        WriteLiteral(" ");



            #line 122 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Html.JobName(job.Job));


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



            #line 123 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <em>");



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


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



            #line 127 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


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



            #line 130 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.NextExecution != null)
                    {
            #line default
            #line hidden

            #line 132 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Html.RelativeTime(job.NextExecution.Value));


            #line default
            #line hidden

            #line 132 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <em>N/A</em>\r\n");



            #line 137 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


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



            #line 140 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.LastExecution != null)
                    {
                        if (!String.IsNullOrEmpty(job.LastJobId))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                        <a href=\"");



            #line 144 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Url.JobDetails(job.LastJobId));


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



            #line 145 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(String.Format("background-color: {0};", JobHistoryRenderer.GetForegroundStateColor(job.LastJobState)));


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



            #line 146 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Html.RelativeTime(job.LastExecution.Value));


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



            #line 149 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                        <em>\r\n                                   " +
                                         "         Canceled\r\n                                            ");



            #line 154 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Html.RelativeTime(job.LastExecution.Value));


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



            #line 156 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        }
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <em>N/A</em>\r\n");



            #line 161 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


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



            #line 164 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.CreatedAt != null)
                    {
            #line default
            #line hidden

            #line 166 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Html.RelativeTime(job.CreatedAt.Value));


            #line default
            #line hidden

            #line 166 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <em>N/A</em>\r\n");



            #line 171 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


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



            #line 174 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


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



            #line 178 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                if (pager != null)
                {
            #line default
            #line hidden
                    WriteLiteral("                    ");

                    WriteLiteral(" ");



            #line 180 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Html.Paginator(pager));


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



            #line 181 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


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



            #line 183 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>    ");
        }
コード例 #4
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 8 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"

            Layout = new LayoutPage(Strings.FailedJobsPage_Title);

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            var monitor    = Storage.GetMonitoringApi();
            var pager      = new Pager(from, perPage, monitor.FailedCount());
            var failedJobs = monitor.FailedJobs(pager.FromRecord, pager.RecordsPerPage);



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 23 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");



            #line 26 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
            Write(Strings.FailedJobsPage_Title);


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



            #line 28 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-success\">\r\n               ");



            #line 31 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                Write(Strings.FailedJobsPage_NoJobs);


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



            #line 33 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-warning\">\r\n                ");



            #line 37 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                Write(Html.Raw(Strings.FailedJobsPage_FailedJobsNotExpire_Warning_Html));


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



            #line 39 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"



            #line default
            #line hidden
                WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
                             "tn-toolbar-top\">\r\n");



            #line 42 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                if (!IsReadOnly)
                {
            #line default
            #line hidden
                    WriteLiteral("                        <button class=\"js-jobs-list-command btn btn-sm btn-primar" +
                                 "y\"\r\n                                data-url=\"");



            #line 45 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(Url.To("/jobs/failed/requeue"));


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



            #line 46 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(Strings.Common_Enqueueing);


            #line default
            #line hidden
                    WriteLiteral("\"\r\n                                disabled=\"disabled\">\r\n                        " +
                                 "    <span class=\"glyphicon glyphicon-repeat\"></span>\r\n                          " +
                                 "  ");



            #line 49 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(Strings.Common_RequeueJobs);


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



            #line 51 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                }


            #line default
            #line hidden


            #line 52 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                if (!IsReadOnly)
                {
            #line default
            #line hidden
                    WriteLiteral("                        <button class=\"js-jobs-list-command btn btn-sm btn-defaul" +
                                 "t\"\r\n                                data-url=\"");



            #line 55 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(Url.To("/jobs/failed/delete"));


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



            #line 56 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(Strings.Common_Deleting);


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



            #line 57 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(Strings.Common_DeleteConfirm);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                            <span class=\"glyphicon glyphicon-remove\"></span>\r" +
                                 "\n                            ");



            #line 59 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(Strings.Common_DeleteSelected);


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



            #line 61 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                }


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



            #line 62 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                Write(Html.PerPageSelector(pager));


            #line default
            #line hidden
                WriteLiteral("\r\n                </div>\r\n\r\n                <div class=\"table-responsive\">\r\n     " +
                             "               <table class=\"table\">\r\n                        <thead>\r\n         " +
                             "                   <tr>\r\n");



            #line 69 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                if (!IsReadOnly)
                {
            #line default
            #line hidden
                    WriteLiteral("                                    <th class=\"min-width\">\r\n                     " +
                                 "                   <input type=\"checkbox\" class=\"js-jobs-list-select-all\"/>\r\n   " +
                                 "                                 </th>\r\n");



            #line 74 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                                <th class=\"min-width\">");



            #line 75 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                Write(Strings.Common_Id);


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



            #line 76 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                Write(Strings.Common_Job);


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



            #line 77 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                Write(Strings.FailedJobsPage_Table_Failed);


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



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


            #line default
            #line hidden


            #line 82 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                foreach (var job in failedJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                                <tr class=\"js-jobs-list-row ");



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


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



            #line 84 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(job.Value != null && job.Value.InFailedState ? "hover" : null);


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



            #line 85 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    if (!IsReadOnly)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td rowspan=\"");



            #line 87 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        Write(job.Value != null && job.Value.InFailedState ? "2" : "1");


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



            #line 88 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        if (job.Value != null && job.Value.InFailedState)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <input type=\"checkbox\" class=\"js-" +
                                         "jobs-list-checkbox\" name=\"jobs[]\" value=\"");



            #line 90 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                            Write(job.Key);


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



            #line 91 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        }


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



            #line 93 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    <td class=\"min-width\" rowspan=\"");



            #line 94 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(job.Value != null && job.Value.InFailedState ? "2" : "1");


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



            #line 95 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(Html.JobIdLink(job.Key));


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



            #line 96 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    if (job.Value != null && !job.Value.InFailedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <span title=\"");



            #line 98 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        Write(Strings.Common_JobStateChanged_Text);


            #line default
            #line hidden
                        WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");



            #line 99 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    }


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



            #line 101 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    if (job.Value == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td colspan=\"2\">\r\n                       " +
                                     "                     <em>");



            #line 104 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        Write(Strings.Common_JobExpired);


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



            #line 106 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td>\r\n                                   " +
                                     "         <div class=\"word-break\">\r\n                                             " +
                                     "   ");



            #line 111 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        Write(Html.JobNameLink(job.Key, job.Value.Job));


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



            #line 113 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        if (!String.IsNullOrEmpty(job.Value.ExceptionMessage))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <div style=\"color: #888;\">\r\n     " +
                                         "                                               ");



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


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



            #line 116 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                            Write(index == 0 ? Strings.Common_LessDetails : Strings.Common_MoreDetails);


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



            #line 118 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        }


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



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



            #line 121 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        if (job.Value.FailedAt.HasValue)
                        {
            #line default
            #line hidden

            #line 123 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                            Write(Html.RelativeTime(job.Value.FailedAt.Value));


            #line default
            #line hidden

            #line 123 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        }


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



            #line 126 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    }


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



            #line 128 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    if (job.Value != null && job.Value.InFailedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <tr>\r\n                                       " +
                                     " <td colspan=\"2\" class=\"failed-job-details\">\r\n                                  " +
                                     "          <div class=\"expandable\" style=\"");



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


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



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


            #line default
            #line hidden
                        WriteLiteral("</h4>\r\n                                                <p class=\"text-muted\">\r\n  " +
                                     "                                                  ");



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


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



            #line 138 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        if (!String.IsNullOrEmpty(job.Value.ExceptionDetails))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                    <pre class=\"stack-trace\"><cod" +
                                         "e>");



            #line 140 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                            Write(Html.StackTrace(job.Value.ExceptionDetails));


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



            #line 141 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        }


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



            #line 145 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    }
                }


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



            #line 151 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                Write(Html.Paginator(pager));


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



            #line 153 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #5
0
        public override void Execute()
        {


WriteLiteral("\r\n");








            
            #line 8 "..\..\Dashboard\Pages\ServersPage.cshtml"
  
    Layout = new LayoutPage("Servers");
    
    var monitor = Storage.GetMonitoringApi();
    var servers = monitor.Servers();


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-12\">\r\n        <h1 class=\"page-header\"" +
">Servers</h1>\r\n\r\n");


            
            #line 19 "..\..\Dashboard\Pages\ServersPage.cshtml"
         if (servers.Count == 0)
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-warning\">\r\n                There are no activ" +
"e servers. Background tasks will not be processed.\r\n            </div>\r\n");


            
            #line 24 "..\..\Dashboard\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 38 "..\..\Dashboard\Pages\ServersPage.cshtml"
                 foreach (var server in servers)
                {

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


            
            #line 41 "..\..\Dashboard\Pages\ServersPage.cshtml"
                       Write(server.Name.ToUpperInvariant());

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


            
            #line 42 "..\..\Dashboard\Pages\ServersPage.cshtml"
                       Write(server.WorkersCount);

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


            
            #line 43 "..\..\Dashboard\Pages\ServersPage.cshtml"
                       Write(Html.Raw(String.Join(" ", server.Queues.Select(Html.QueueLabel))));

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


            
            #line 44 "..\..\Dashboard\Pages\ServersPage.cshtml"
                                    Write(JobHelper.ToTimestamp(server.StartedAt));

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


            
            #line 44 "..\..\Dashboard\Pages\ServersPage.cshtml"
                                                                              Write(server.StartedAt);

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


            
            #line 46 "..\..\Dashboard\Pages\ServersPage.cshtml"
                             if (server.Heartbeat.HasValue)
                            {
                                
            
            #line default
            #line hidden
            
            #line 48 "..\..\Dashboard\Pages\ServersPage.cshtml"
                           Write(Html.RelativeTime(server.Heartbeat.Value));

            
            #line default
            #line hidden
            
            #line 48 "..\..\Dashboard\Pages\ServersPage.cshtml"
                                                                          
                            }

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


            
            #line 52 "..\..\Dashboard\Pages\ServersPage.cshtml"
                }

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


            
            #line 55 "..\..\Dashboard\Pages\ServersPage.cshtml"
        }

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


        }
コード例 #6
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 5 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"

            Layout = new LayoutPage("Deleted Jobs");

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            var monitor = Storage.GetMonitoringApi();
            var pager   = new Pager(from, perPage, monitor.DeletedListCount());
            var jobs    = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage);



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 20 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">Deleted" +
                         " Jobs</h1>\r\n\r\n");



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



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



            #line 36 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                Write(Url.To("/jobs/deleted/requeue"));


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



            #line 42 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                Write(Html.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 56 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                foreach (var job in jobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                        <tr class=\"js-jobs-list-row ");



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


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



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


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



            #line 60 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    if (job.Value != null && job.Value.InDeletedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <input type=\"checkbox\" class=\"js-jobs-list-ch" +
                                     "eckbox\" name=\"jobs[]\" value=\"");



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


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



            #line 63 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    }


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



            #line 66 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    Write(Html.JobIdLink(job.Key));


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



            #line 67 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    if (job.Value != null && !job.Value.InDeletedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <span title=\"Job\'s state has been changed whi" +
                                     "le fetching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");



            #line 70 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    }


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



            #line 73 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    if (job.Value == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <td colspan=\"2\"><em>Job has expired.</em></td>\r\n");



            #line 76 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <td>\r\n                                    ");



            #line 80 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                        Write(Html.JobNameLink(job.Key, job.Value.Job));


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



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



            #line 83 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                        if (job.Value.DeletedAt.HasValue)
                        {
            #line default
            #line hidden

            #line 85 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                            Write(Html.RelativeTime(job.Value.DeletedAt.Value));


            #line default
            #line hidden

            #line 85 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                        }


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



            #line 88 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    }


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



            #line 90 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                }


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



            #line 94 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                Write(Html.Paginator(pager));


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



            #line 96 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>\r\n\r\n");
        }
コード例 #7
0
        public override void Execute()
        {


WriteLiteral("\r\n");









            
            #line 9 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
  
    Layout = new LayoutPage("Recurring jobs");
	List<RecurringJobDto> recurringJobs;
    
    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    Pager pager = null;

	using (var connection = Storage.GetConnection())
	{
	    var storageConnection = connection as JobStorageConnection;
	    if (storageConnection != null)
	    {
	        pager = new Pager(from, perPage, storageConnection.GetRecurringJobCount());
	        recurringJobs = storageConnection.GetRecurringJobs(pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1);
	    }
	    else
	    {
            recurringJobs = connection.GetRecurringJobs();
	    }
	}


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-12\">\r\n        <h1 class=\"page-header\"" +
">Recurring Jobs</h1>\r\n\r\n");


            
            #line 39 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
         if (recurringJobs.Count == 0)
        {

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


            
            #line 44 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
        }
        else
        {

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


            
            #line 50 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                 Write(Url.To("/recurring/trigger"));

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

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


            
            #line 58 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                 Write(Url.To("/recurring/remove"));

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

");


            
            #line 66 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                     if (pager != null)
                    {

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

WriteLiteral(" ");


            
            #line 68 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                      Write(Html.PerPageSelector(pager));

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


            
            #line 69 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }

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

                <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>Time zone</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 87 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                     foreach (var job in recurringJobs)
                    {

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


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

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


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

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



WriteLiteral("\r\n");


            
            #line 96 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                  
                                    var cronDescription = job.Cron;
                                    try
                                    {
                                        cronDescription = ExpressionDescriptor.GetDescription(job.Cron);
                                    }
                                    catch (FormatException)
                                    {
                                    }
                                

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


            
            #line 106 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                           Write(cronDescription);

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


            
            #line 109 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                 if (!String.IsNullOrWhiteSpace(job.TimeZoneId))
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span title=\"");


            
            #line 111 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                            Write(TimeZoneInfo.FindSystemTimeZoneById(job.TimeZoneId).DisplayName);

            
            #line default
            #line hidden
WriteLiteral("\" data-container=\"body\">");


            
            #line 111 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                                                                                                    Write(job.TimeZoneId);

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


            
            #line 112 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                }
                                else
                                {

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

WriteLiteral(" UTC\r\n");


            
            #line 116 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                }

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


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

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

WriteLiteral(" ");


            
            #line 121 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                  Write(Html.JobName(job.Job));

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


            
            #line 122 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                }
                                else
                                {

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


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

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


            
            #line 126 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                }

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


            
            #line 129 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                 if (job.NextExecution != null)
                                {
                                    
            
            #line default
            #line hidden
            
            #line 131 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                               Write(Html.RelativeTime(job.NextExecution.Value));

            
            #line default
            #line hidden
            
            #line 131 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                                               
                                }
                                else
                                {

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


            
            #line 136 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                }

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


            
            #line 139 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                 if (job.LastExecution != null)
                                {
                                    if (!String.IsNullOrEmpty(job.LastJobId))
                                    {

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


            
            #line 143 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                            Write(Url.JobDetails(job.LastJobId));

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


            
            #line 144 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                                                            Write(String.Format("background-color: {0};", JobHistoryRenderer.GetForegroundStateColor(job.LastJobState)));

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


            
            #line 145 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                           Write(Html.RelativeTime(job.LastExecution.Value));

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


            
            #line 148 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                    }
                                    else
                                    {

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


            
            #line 153 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                       Write(Html.RelativeTime(job.LastExecution.Value));

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


            
            #line 155 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                    }
                                }
                                else
                                {

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


            
            #line 160 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                }

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


            
            #line 163 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }

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


            
            #line 167 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                 if (pager != null)
                {

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

WriteLiteral(" ");


            
            #line 169 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                  Write(Html.Paginator(pager));

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


            
            #line 170 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }

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


            
            #line 172 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
        }

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


        }
コード例 #8
0
        public override void Execute()
        {


WriteLiteral("\r\n");








            
            #line 8 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
  
    Layout = new LayoutPage(Strings.ProcessingJobsPage_Title);

    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    var monitor = Storage.GetMonitoringApi();
    var pager = new Pager(from, perPage, monitor.ProcessingCount());
    var processingJobs = monitor.ProcessingJobs(pager.FromRecord, pager.RecordsPerPage);
    var servers = monitor.Servers();


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 24 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");


            
            #line 27 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                           Write(Strings.ProcessingJobsPage_Title);

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


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

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");


            
            #line 32 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
           Write(Strings.ProcessingJobsPage_NoJobs);

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


            
            #line 34 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
        }
        else
        {

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


            
            #line 40 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                 Write(Url.To("/jobs/processing/requeue"));

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


            
            #line 41 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                          Write(Strings.Common_Enqueueing);

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
"n class=\"glyphicon glyphicon-repeat\"></span>\r\n                        ");


            
            #line 44 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                   Write(Strings.Common_RequeueJobs);

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </button>\r\n\r\n                    <button class=\"js-jobs-lis" +
"t-command btn btn-sm btn-default\"\r\n                            data-url=\"");


            
            #line 48 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                 Write(Url.To("/jobs/processing/delete"));

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


            
            #line 49 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                          Write(Strings.Common_Deleting);

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


            
            #line 50 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                     Write(Strings.Common_DeleteConfirm);

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
"n class=\"glyphicon glyphicon-remove\"></span>\r\n                        ");


            
            #line 53 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                   Write(Strings.Common_DeleteSelected);

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


            
            #line 56 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
               Write(Html.PerPageSelector(pager));

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

                <div class=""table-responsive"">
                    <table class=""table"">
                        <thead>
                            <tr>
                                <th class=""min-width"">
                                    <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                </th>
                                <th class=""min-width"">");


            
            #line 66 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                                 Write(Strings.Common_Id);

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


            
            #line 67 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                                 Write(Strings.Common_Server);

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


            
            #line 68 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                               Write(Strings.Common_Job);

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


            
            #line 69 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                                   Write(Strings.ProcessingJobsPage_Table_Started);

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


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

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


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

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


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

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


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

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


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

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


            
            #line 80 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                        }

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


            
            #line 83 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                   Write(Html.JobIdLink(job.Key));

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


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

            
            #line default
            #line hidden
WriteLiteral("                                            <span title=\"");


            
            #line 86 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                                    Write(Strings.Common_JobStateChanged_Text);

            
            #line default
            #line hidden
WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 87 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                        }

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


            
            #line 90 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                   Write(Html.ServerId(job.Value.ServerId));

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


            
            #line 93 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                         if (servers.All(x => x.Name != job.Value.ServerId || x.Heartbeat < DateTime.UtcNow.AddMinutes(-1)))
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <span title=\"");


            
            #line 95 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                                    Write(Strings.ProcessingJobsPage_Aborted);

            
            #line default
            #line hidden
WriteLiteral("\" class=\"glyphicon glyphicon-warning-sign\" style=\"font-size: 10px;\"></span>\r\n");


            
            #line 96 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                        }

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


            
            #line 98 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                   Write(Html.JobNameLink(job.Key, job.Value.Job));

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


            
            #line 101 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                         if (job.Value.StartedAt.HasValue)
                                        {
                                            
            
            #line default
            #line hidden
            
            #line 103 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                       Write(Html.RelativeTime(job.Value.StartedAt.Value));

            
            #line default
            #line hidden
            
            #line 103 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                                                                         
                                        }

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


            
            #line 107 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                            }

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


            
            #line 112 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
           Write(Html.Paginator(pager));

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


            
            #line 114 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
        }

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


        }
コード例 #9
0
        public override void Execute()
        {


WriteLiteral("\r\n");









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

    int from, perPage;

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

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

    JobList<SucceededJobDto> succeededJobs = monitor
        .SucceededJobs(pager.FromRecord, pager.RecordsPerPage);


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


            
            #line 27 "..\..\Dashboard\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 32 "..\..\Dashboard\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 38 "..\..\Dashboard\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 44 "..\..\Dashboard\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 60 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                 foreach (var job in succeededJobs)
                {

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


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

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


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

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


            
            #line 64 "..\..\Dashboard\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 66 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                                                                                     Write(job.Key);

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


            
            #line 67 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                            }

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


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

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


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

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


            
            #line 73 "..\..\Dashboard\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 76 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                            }

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


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

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


            
            #line 84 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        }
                        else
                        {

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


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

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


            
            #line 89 "..\..\Dashboard\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 93 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                 if (job.Value.TotalDuration.HasValue)
                                {

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

WriteLiteral(" ");


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

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


            
            #line 96 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                }

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



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


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

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


            
            #line 101 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                                  Write(JobHelper.ToTimestamp(job.Value.SucceededAt.Value));

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


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

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


            
            #line 104 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                }

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


            
            #line 106 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        }

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


            
            #line 108 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                }

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


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

            
            #line default
            #line hidden
            
            #line 112 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
コード例 #10
0
        public override void Execute()
        {


WriteLiteral("\r\n");













            
            #line 13 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
  
    var monitor = Storage.GetMonitoringApi();
    var job = monitor.JobDetails(JobId);
    
    string title = null;

    if (job != null)
    {
        title = job.Job != null ? Html.JobName(job.Job) : null;
        job.History.Add(new StateHistoryDto { StateName = "Created", CreatedAt = job.CreatedAt ?? default(DateTime) });
    }

    title = title ?? Strings.Common_Job;
    Layout = new LayoutPage(title);


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 31 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");


            
            #line 34 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                           Write(title);

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


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

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-warning\">\r\n                ");


            
            #line 39 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
           Write(String.Format(Strings.JobDetailsPage_JobExpired, JobId));

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


            
            #line 41 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
        }
        else
        {
            var currentState = job.History[0];
            if (currentState.StateName == ProcessingState.StateName)
            {
                var server = monitor.Servers().FirstOrDefault(x => x.Name == currentState.Data["ServerId"]);
                if (server == null)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div class=\"alert alert-danger\">\r\n                        ");


            
            #line 51 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                   Write(Html.Raw(String.Format(Strings.JobDetailsPage_JobAbortedNotActive_Warning_Html, currentState.Data["ServerId"], Url.To("/servers"))));

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


            
            #line 53 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }
                else if (server.Heartbeat.HasValue && server.Heartbeat < DateTime.UtcNow.AddMinutes(-1))
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div class=\"alert alert-warning\">\r\n                        ");


            
            #line 57 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                   Write(Html.Raw(String.Format(Strings.JobDetailsPage_JobAbortedWithHeartbeat_Warning_Html, server.Name)));

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


            
            #line 59 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }
            }

            if (job.ExpireAt.HasValue)
            {

            
            #line default
            #line hidden
WriteLiteral("                <div class=\"alert alert-info\">\r\n                    ");


            
            #line 65 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
               Write(Html.Raw(String.Format(Strings.JobDetailsPage_JobFinished_Warning_Html, JobHelper.ToTimestamp(job.ExpireAt.Value), job.ExpireAt)));

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


            
            #line 67 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            }


            
            #line default
            #line hidden
WriteLiteral("            <div class=\"job-snippet\">\r\n                <div class=\"job-snippet-co" +
"de\">\r\n                    <pre><code><span class=\"comment\">// ");


            
            #line 71 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                   Write(Strings.JobDetailsPage_JobId);

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


            
            #line 71 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                                  Write(Html.JobId(JobId.ToString(), false));

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


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

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


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

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


            
            #line 80 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                             foreach (var property in job.Properties.Where(x => x.Key != "Continuations"))
                            {

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


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

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



WriteLiteral("                                <dd><pre><code>");


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

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


            
            #line 84 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            }

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


            
            #line 87 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }

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


            
            #line 89 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

            if (job.Properties.ContainsKey("Continuations"))
            {
                List<Continuation> continuations;

                using (var connection = Storage.GetConnection())
                {
                    continuations = JobHelper.FromJson<List<Continuation>>(connection.GetJobParameter(
                        JobId, "Continuations")) ?? new List<Continuation>();
                }

                if (continuations.Count > 0)
                {

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


            
            #line 102 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                   Write(Strings.Common_Continuations);

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



WriteLiteral("                    <div class=\"table-responsive\">\r\n                        <tabl" +
"e class=\"table\">\r\n                            <thead>\r\n                         " +
"   <tr>\r\n                                <th class=\"min-width\">");


            
            #line 107 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                 Write(Strings.Common_Id);

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


            
            #line 108 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                 Write(Strings.Common_Condition);

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


            
            #line 109 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                 Write(Strings.Common_State);

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


            
            #line 110 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                               Write(Strings.Common_Job);

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


            
            #line 111 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                   Write(Strings.Common_Created);

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


            
            #line 115 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                             foreach (var continuation in continuations)
                            {
                                JobData jobData;

                                using (var connection = Storage.GetConnection())
                                {
                                    jobData = connection.GetJobData(continuation.JobId);
                                }


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


            
            #line 125 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                     if (jobData == null)
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <td colspan=\"5\"><em>");


            
            #line 127 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                       Write(String.Format(Strings.JobDetailsPage_JobExpired, continuation.JobId));

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


            
            #line 128 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                    }
                                    else
                                    {

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


            
            #line 131 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                         Write(Html.JobIdLink(continuation.JobId));

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



WriteLiteral("                                        <td class=\"min-width\"><code>");


            
            #line 132 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                               Write(continuation.Options.ToString("G"));

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



WriteLiteral("                                        <td class=\"min-width\">");


            
            #line 133 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                         Write(Html.StateLabel(jobData.State));

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



WriteLiteral("                                        <td class=\"word-break\">");


            
            #line 134 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                          Write(Html.JobNameLink(continuation.JobId, jobData.Job));

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



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


            
            #line 135 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                           Write(Html.RelativeTime(jobData.CreatedAt));

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


            
            #line 136 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                    }

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


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

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


            
            #line 142 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }
            }


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


            
            #line 146 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                 if (job.History.Count > 1)
                {

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


            
            #line 149 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                     Write(Url.To("/jobs/actions/requeue/" + JobId));

            
            #line default
            #line hidden
WriteLiteral("\" data-loading-text=\"");


            
            #line 149 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                                                                                   Write(Strings.Common_Enqueueing);

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


            
            #line 149 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                                                                                                               Write(Strings.JobDetailsPage_Requeue);

            
            #line default
            #line hidden
WriteLiteral("</button>\r\n                        <button class=\"btn btn-sm btn-death\" data-ajax" +
"=\"");


            
            #line 150 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                   Write(Url.To("/jobs/actions/delete/" + JobId));

            
            #line default
            #line hidden
WriteLiteral("\" data-loading-text=\"");


            
            #line 150 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                                                                                Write(Strings.Common_Deleting);

            
            #line default
            #line hidden
WriteLiteral("\" data-confirm=\"");


            
            #line 150 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                                                                                                                        Write(Strings.JobDetailsPage_DeleteConfirm);

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


            
            #line 150 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                                                                                                                                                               Write(Strings.Common_Delete);

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


            
            #line 152 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }

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


            
            #line 154 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
           Write(Strings.JobDetailsPage_State);

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


            
            #line 156 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

            var index = 0;

            foreach (var entry in job.History)
            {
                var accentColor = JobHistoryRenderer.GetForegroundStateColor(entry.StateName);
                var backgroundColor = JobHistoryRenderer.GetBackgroundStateColor(entry.StateName);


            
            #line default
            #line hidden
WriteLiteral("                <div class=\"state-card\" style=\"");


            
            #line 164 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                           Write(index == 0 ? $"border-color: {accentColor}" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <h4 class=\"state-card-title\" style=\"");


            
            #line 165 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                    Write(index == 0 ? $"color: {accentColor}" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <small class=\"pull-right text-muted\">\r\n");


            
            #line 167 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                             if (index == job.History.Count - 1)
                            {
                                
            
            #line default
            #line hidden
            
            #line 169 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                           Write(Html.RelativeTime(entry.CreatedAt));

            
            #line default
            #line hidden
            
            #line 169 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                   
                            }
                            else
                            {
                                var duration = Html.ToHumanDuration(entry.CreatedAt - job.History[index + 1].CreatedAt);

                                if (index == 0)
                                {

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

WriteLiteral(" ");


            
            #line 177 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                  Write(Html.RelativeTime(entry.CreatedAt));

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


            
            #line 177 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                       Write(duration);

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


            
            #line 178 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                }
                                else
                                {

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

WriteLiteral(" ");


            
            #line 181 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                  Write(Html.MomentTitle(entry.CreatedAt, duration));

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


            
            #line 182 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                }
                            }

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


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

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


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

            
            #line default
            #line hidden
WriteLiteral("                        <p class=\"state-card-text text-muted\">");


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

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


            
            #line 192 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }

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


            
            #line 194 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                      
                        var rendered = Html.RenderHistory(entry.StateName, entry.Data);
                    

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


            
            #line 198 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                     if (rendered != null)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <div class=\"state-card-body\" style=\"");


            
            #line 200 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                        Write(index == 0 ? $"background-color: {backgroundColor}" : null);

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


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

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


            
            #line 203 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }

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


            
            #line 205 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

                index++;
            }
        }

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


        }
コード例 #11
0
        public override void Execute()
        {


WriteLiteral("\r\n");








            
            #line 8 "..\..\Dashboard\Pages\HomePage.cshtml"
  
    Layout = new LayoutPage("Dashboard");
    IDictionary<DateTime, long> succeeded = null;
    IDictionary<DateTime, long> failed = null;

    var period = Query("period") ?? "day";

    var monitor = Storage.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<div class=\"row\">\r\n    <div class=\"col-md-12\">\r\n        <h1 class=\"page-header\"" +
">Dashboard</h1>\r\n");


            
            #line 31 "..\..\Dashboard\Pages\HomePage.cshtml"
         if (Metrics.Count > 0)
        {

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


            
            #line 34 "..\..\Dashboard\Pages\HomePage.cshtml"
                 foreach (var metric in Metrics)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div class=\"col-md-2\">\r\n                        ");


            
            #line 37 "..\..\Dashboard\Pages\HomePage.cshtml"
                   Write(Html.BlockMetric(metric));

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


            
            #line 39 "..\..\Dashboard\Pages\HomePage.cshtml"
                }

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


            
            #line 41 "..\..\Dashboard\Pages\HomePage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("        <h3>Realtime graph</h3>\r\n        <div id=\"realtimeGraph\" data-succeeded=\"" +
"");


            
            #line 43 "..\..\Dashboard\Pages\HomePage.cshtml"
                                           Write(Statistics.Succeeded);

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


            
            #line 43 "..\..\Dashboard\Pages\HomePage.cshtml"
                                                                               Write(Statistics.Failed);

            
            #line default
            #line hidden
WriteLiteral(@"""></div>
        <div style=""display: none;"">
            <span data-metric=""succeeded:count""></span>
            <span data-metric=""failed:count""></span>
        </div>

        <h3>
            <div class=""btn-group pull-right"" style=""margin-top: 2px;"">
                <a href=""?period=day"" class=""btn btn-sm btn-default ");


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

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


            
            #line 54 "..\..\Dashboard\Pages\HomePage.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 59 "..\..\Dashboard\Pages\HomePage.cshtml"
         if (succeeded != null && failed != null)
        {

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


            
            #line 62 "..\..\Dashboard\Pages\HomePage.cshtml"
                            Write(JsonConvert.SerializeObject(succeeded));

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


            
            #line 63 "..\..\Dashboard\Pages\HomePage.cshtml"
                         Write(JsonConvert.SerializeObject(failed));

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


            
            #line 65 "..\..\Dashboard\Pages\HomePage.cshtml"
        }

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


        }
コード例 #12
0
        public override void Execute()
        {


WriteLiteral("\r\n");








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

    int from, perPage;

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

    var monitor = Storage.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("\r\n");


            
            #line 26 "..\..\Dashboard\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 31 "..\..\Dashboard\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 37 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                   var index = 0; 

            
            #line default
            #line hidden

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

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


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

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


            
            #line 69 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                                                                 Write(job.Value.InFailedState ? "hover" : null);

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


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

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


            
            #line 71 "..\..\Dashboard\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 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                                                                     Write(job.Key);

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


            
            #line 74 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                            }

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


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

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


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

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


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

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


            
            #line 80 "..\..\Dashboard\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 83 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                            }

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


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

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


            
            #line 88 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                              Write(JobHelper.ToTimestamp(job.Value.FailedAt.Value));

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


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

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


            
            #line 91 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                            }

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


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

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


            
            #line 96 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                               Write(HtmlHelper.DisplayMethod(job.Value.Job));

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


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

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


            
            #line 102 "..\..\Dashboard\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 104 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                            }

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


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

            
            #line default
            #line hidden
WriteLiteral("                        <tr>\r\n                            <td colspan=\"2\" class=\"" +
"failed-job-details\">\r\n                                <div class=\"expandable\" st" +
"yle=\"");


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

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


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

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


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

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


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

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


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

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


            
            #line 120 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                    }

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


            
            #line 124 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    }
                }

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


            
            #line 129 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"

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

            
            #line default
            #line hidden
            
            #line 130 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
コード例 #13
0
        public override void Execute()
        {


WriteLiteral("\r\n");







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

    int from, perPage;

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

    var monitor = Storage.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("\r\n");


            
            #line 25 "..\..\Dashboard\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 30 "..\..\Dashboard\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 36 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                 foreach (var job in processingJobs)
                {

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


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

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


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

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


            
            #line 70 "..\..\Dashboard\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 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                                                                                     Write(job.Key);

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


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

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


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

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


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

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


            
            #line 79 "..\..\Dashboard\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 82 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                            }

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


            
            #line 85 "..\..\Dashboard\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 88 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                                   Write(Request.LinkTo("/job/" + job.Key));

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


            
            #line 89 "..\..\Dashboard\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 93 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                             if (job.Value.StartedAt.HasValue)
                            {

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


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

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


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

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


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

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


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

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


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

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

            
            #line default
            #line hidden

        }
コード例 #14
0
        public override void Execute()
        {


WriteLiteral("\r\n");









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

    var monitor = JobStorage.Current.GetMonitoringApi();
    IList<QueueWithTopEnqueuedJobsDto> queues = monitor.Queues();


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


            
            #line 16 "..\..\Dashboard\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 21 "..\..\Dashboard\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 34 "..\..\Dashboard\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 38 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                Write(Request.LinkTo("/queues/" + queue.Name));

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


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

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


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

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


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

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


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

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


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

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


            
            #line 49 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        }
                        else
                        {

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


            
            #line 53 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        }

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


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

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


            
            #line 59 "..\..\Dashboard\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 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                     foreach (var job in queue.FirstJobs)
                                    {

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


            
            #line 74 "..\..\Dashboard\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 76 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                    Write(Request.LinkTo("/job/" + job.Key));

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


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

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


            
            #line 77 "..\..\Dashboard\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 80 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                }

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


            
            #line 83 "..\..\Dashboard\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 84 "..\..\Dashboard\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 88 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                                       Write(Request.LinkTo("/job/" + job.Key));

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


            
            #line 89 "..\..\Dashboard\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 93 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                 if (job.Value.EnqueuedAt.HasValue)
                                                {

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


            
            #line 95 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                                  Write(JobHelper.ToTimestamp(job.Value.EnqueuedAt.Value));

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


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

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


            
            #line 98 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                }
                                                else
                                                {

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


            
            #line 102 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                }

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


            
            #line 105 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                    }

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


            
            #line 108 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        }

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


            
            #line 111 "..\..\Dashboard\Pages\QueuesPage.cshtml"
            }

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


            
            #line 114 "..\..\Dashboard\Pages\QueuesPage.cshtml"
}
            
            #line default
            #line hidden

        }
コード例 #15
0
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
  
    Layout = new LayoutPage(Queue.ToUpperInvariant());

    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    var monitor = Storage.GetMonitoringApi();
    var pager = new Pager(from, perPage, monitor.FetchedCount(Queue));
    var fetchedJobs = monitor.FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 22 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        ");


            
            #line 25 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
   Write(Html.Breadcrumbs(Queue.ToUpperInvariant(), new Dictionary<string, string>
        {
            { "Queues", Url.LinkToQueues() },
            { Queue.ToUpperInvariant(), Url.Queue(Queue) }
        }));

            
            #line default
            #line hidden
WriteLiteral("\r\n\r\n        <h1 class=\"page-header\">\r\n            ");


            
            #line 32 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
       Write(Queue.ToUpperInvariant());

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


            
            #line 35 "..\..\Dashboard\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 40 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
        }
        else
        {

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


            
            #line 46 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                             Write(Url.To("/jobs/enqueued/requeue"));

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

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


            
            #line 54 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                             Write(Url.To("/jobs/enqueued/delete"));

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

                ");


            
            #line 62 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
           Write(Html.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 78 "..\..\Dashboard\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 82 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                                                                                                 Write(job.Key);

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


            
            #line 85 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                       Write(Html.JobIdLink(job.Key));

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


            
            #line 88 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                       Write(Html.StateLabel(job.Value.State));

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


            
            #line 91 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                       Write(Html.JobNameLink(job.Key, job.Value.Job));

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


            
            #line 94 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                             if (job.Value.FetchedAt.HasValue)
                            {
                                
            
            #line default
            #line hidden
            
            #line 96 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                           Write(Html.RelativeTime(job.Value.FetchedAt.Value));

            
            #line default
            #line hidden
            
            #line 96 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                                                                             
                            }

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


            
            #line 100 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                }

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


            
            #line 104 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
       Write(Html.Paginator(pager));

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


            
            #line 106 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
        }

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


        }
コード例 #16
0
        public override void Execute()
        {


WriteLiteral("\r\n");










            
            #line 10 "..\..\Dashboard\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.Query["from"], out from);
    int.TryParse(Request.Query["count"], out perPage);

    var monitor = Storage.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("\r\n");


            
            #line 36 "..\..\Dashboard\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 41 "..\..\Dashboard\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 47 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                 foreach (var job in enqueuedJobs)
                {

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


            
            #line 72 "..\..\Dashboard\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 74 "..\..\Dashboard\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 77 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                Write(Request.LinkTo("/job/" + job.Key));

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


            
            #line 78 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                           Write(HtmlHelper.JobId(job.Key));

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


            
            #line 80 "..\..\Dashboard\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 83 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                            }

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


            
            #line 86 "..\..\Dashboard\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 87 "..\..\Dashboard\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 91 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                                   Write(Request.LinkTo("/job/" + job.Key));

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


            
            #line 92 "..\..\Dashboard\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 96 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                             if (job.Value.EnqueuedAt.HasValue)
                            {

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


            
            #line 98 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                              Write(JobHelper.ToTimestamp(job.Value.EnqueuedAt.Value));

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


            
            #line 99 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                               Write(job.Value.EnqueuedAt);

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


            
            #line 101 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                            }
                            else
                            {

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


            
            #line 105 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                            }

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


            
            #line 108 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                }

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


            
            #line 112 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
    
            
            #line default
            #line hidden
            
            #line 112 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 112 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
コード例 #17
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 8 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

            var monitor = Storage.GetMonitoringApi();
            var job     = monitor.JobDetails(JobId.ToString());

            string title = null;

            if (job != null)
            {
                title = job.Job != null?Html.JobName(job.Job) : null;
            }

            title  = title ?? "Job";
            Layout = new LayoutPage(title);



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 25 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");



            #line 28 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            Write(title);


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



            #line 30 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            if (job == null)
            {
            #line default
            #line hidden
                WriteLiteral("            ");

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



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


            #line default
            #line hidden
                WriteLiteral("\' has expired or could not be found on the server.\r\n");



            #line 33 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            }
            else
            {
                var currentState = job.History.Count > 0 ? job.History[0] : null;
                if (currentState != null && currentState.StateName == ProcessingState.StateName)
                {
                    var server = monitor.Servers().FirstOrDefault(x => x.Name == currentState.Data["ServerId"]);
                    if (server == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <div class=\"alert alert-danger\">\r\n                        <st" +
                                     "rong>The job was aborted</strong> – it is processed by server\r\n                 " +
                                     "       <code>");



            #line 44 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(currentState.Data["ServerId"]);


            #line default
            #line hidden
                        WriteLiteral("</code> which is not in the \r\n                        <a href=\"");



            #line 45 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Url.To("/servers"));


            #line default
            #line hidden
                        WriteLiteral("\">active servers</a> list for now.\r\n                        It will be retried au" +
                                     "tomatically after invisibility timeout, but you can\r\n                        als" +
                                     "o re-queue or delete it manually.\r\n                    </div>\r\n");



            #line 49 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }
                    else if (server.Heartbeat.HasValue && server.Heartbeat < DateTime.UtcNow.AddMinutes(-1))
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <div class=\"alert alert-warning\">\r\n                        <s" +
                                     "trong>Looks like the job was aborted</strong> – it is processed by server\r\n     " +
                                     "                   <code>");



            #line 54 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(server.Name);


            #line default
            #line hidden
                        WriteLiteral("</code>, which reported its heartbeat more than 1 minute ago.\r\n                  " +
                                     "      It will be retried automatically after invisibility timeout, but you can\r\n" +
                                     "                        also re-queue or delete it manually.\r\n                  " +
                                     "  </div>\r\n");



            #line 58 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }
                }

                if (job.ExpireAt.HasValue)
                {
            #line default
            #line hidden
                    WriteLiteral("                <div class=\"alert alert-info\">\r\n                    <strong>The j" +
                                 "ob is finished</strong>.\r\n                    It will be removed automatically <" +
                                 "em><abbr data-moment=\"");



            #line 65 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(JobHelper.ToTimestamp(job.ExpireAt.Value));


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



            #line 65 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(job.ExpireAt);


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



            #line 67 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }



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



            #line 72 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                Write(Html.JobId(JobId.ToString(), false));


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



            #line 76 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                Write(Url.To("/jobs/actions/requeue/" + JobId));


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



            #line 77 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                Write(Url.To("/jobs/actions/delete/" + JobId));


            #line default
            #line hidden
                WriteLiteral(@""" data-loading-text=""Deleting..."" data-confirm=""Do you really want to delete this job?"">Delete</button>
                    </span>

                    <div class=""clearfix""></div>
                </div>
                <div class=""job-snippet-body"">
                    <div class=""job-snippet-code"">
");



            #line 84 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                if (job.CreatedAt.HasValue)
                {
            #line default
            #line hidden
                    WriteLiteral("                            <div class=\"pull-right job-creation-date\">\r\n         " +
                                 "                       Created\r\n                                ");



            #line 88 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Html.RelativeTime(job.CreatedAt.Value));


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



            #line 90 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }


            #line default
            #line hidden


            #line 91 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                if (job != null)
                {
            #line default
            #line hidden
                    WriteLiteral("                            <pre><code>");



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


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



            #line 94 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }


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



            #line 98 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                if (job.Properties.Count > 0)
                {
            #line default
            #line hidden
                    WriteLiteral("                        <div class=\"job-snippet-properties\">\r\n                   " +
                                 "         <dl>\r\n");



            #line 102 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    foreach (var property in job.Properties)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <dt>");



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


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



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



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


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



            #line 108 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }


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



            #line 111 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }


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



            #line 114 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

                if (job.History.Count > 0)
                {
            #line default
            #line hidden
                    WriteLiteral("                <h3>History</h3>\r\n");



            #line 118 "..\..\Dashboard\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 = index == 0
                        ? JobHistoryRenderer.GetForegroundStateColor(entry.StateName)
                        : JobHistoryRenderer.GetBackgroundStateColor(entry.StateName);



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



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


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



            #line 130 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(String.Format("background-color: {0};", background));


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



            #line 131 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(JobHelper.ToTimestamp(entry.CreatedAt));


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



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


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



            #line 133 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        nextEntry++;


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



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


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



            #line 138 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        if (!String.IsNullOrWhiteSpace(entry.Reason))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                    <small>");



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


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



            #line 141 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        }


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



            #line 145 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        if (JobHistoryRenderer.Exists(entry.StateName))
                        {
                            var rendered = Html.RenderHistory(entry.StateName, entry.Data);
                            if (rendered != null)
                            {
            #line default
            #line hidden
                                WriteLiteral("                                <div class=\"job-history-body\">\r\n                 " +
                                             "                   ");



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


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



            #line 153 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            }
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                            <div class=\"job-history-body\">\r\n                     " +
                                         "           <dl class=\"dl-horizontal\">\r\n");



            #line 159 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            foreach (var item in entry.Data)
                            {
            #line default
            #line hidden
                                WriteLiteral("                                        <dt>");



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


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



                                WriteLiteral("                                        <dd>");



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


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



            #line 163 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            }


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



            #line 166 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        }


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



            #line 168 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

                        index++;
                    }
                }
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #18
0
        public override void Execute()
        {


WriteLiteral("\r\n");








            
            #line 8 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
  
    Layout = new LayoutPage(Queue.ToUpperInvariant());

    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    var monitor = Storage.GetMonitoringApi();
    var pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue));
    var enqueuedJobs = monitor.EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 23 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        ");


            
            #line 26 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
   Write(Html.Breadcrumbs(Queue.ToUpperInvariant(), new Dictionary<string, string>
        {
            { "Queues", Url.LinkToQueues() }
        }));

            
            #line default
            #line hidden
WriteLiteral("\r\n\r\n        <h1 class=\"page-header\">");


            
            #line 31 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                           Write(Queue.ToUpperInvariant());

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


            
            #line 31 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                                            Write(Strings.EnqueuedJobsPage_Title);

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


            
            #line 33 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
         if (pager.TotalPageCount == 0)
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");


            
            #line 36 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
           Write(Strings.EnqueuedJobsPage_NoJobs);

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


            
            #line 38 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
        }
        else
        {

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


            
            #line 44 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                 Write(Url.To("/jobs/enqueued/delete"));

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


            
            #line 45 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                          Write(Strings.Common_Deleting);

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


            
            #line 46 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                     Write(Strings.Common_DeleteConfirm);

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
"n class=\"glyphicon glyphicon-remove\"></span>\r\n                        ");


            
            #line 49 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                   Write(Strings.Common_DeleteSelected);

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


            
            #line 52 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
               Write(Html.PerPageSelector(pager));

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

                <div class=""table-responsive"">
                    <table class=""table"">
                        <thead>
                        <tr>
                            <th class=""min-width"">
                                <input type=""checkbox"" class=""js-jobs-list-select-all""/>
                            </th>
                            <th class=""min-width"">");


            
            #line 62 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                             Write(Strings.Common_Id);

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


            
            #line 63 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                             Write(Strings.Common_State);

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


            
            #line 64 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                           Write(Strings.Common_Job);

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


            
            #line 65 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                               Write(Strings.Common_Enqueued);

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


            
            #line 69 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                         foreach (var job in enqueuedJobs)
                        {

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


            
            #line 71 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                                          Write(job.Value == null || !job.Value.InEnqueuedState ? "obsolete-data" : null);

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


            
            #line 73 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                     if (job.Value != null)
                                    {

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


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

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


            
            #line 76 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                    }

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


            
            #line 79 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                               Write(Html.JobIdLink(job.Key));

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


            
            #line 80 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                     if (job.Value != null && !job.Value.InEnqueuedState)
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <span title=\"");


            
            #line 82 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                                Write(Strings.Common_JobStateChanged_Text);

            
            #line default
            #line hidden
WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 83 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                    }

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


            
            #line 85 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                 if (job.Value == null)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <td colspan=\"3\"><em>");


            
            #line 87 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                                   Write(Strings.Common_JobExpired);

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


            
            #line 88 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                }
                                else
                                {

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


            
            #line 92 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                   Write(Html.StateLabel(job.Value.State));

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



WriteLiteral("                                    <td class=\"word-break\">\r\n                    " +
"                    ");


            
            #line 95 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                   Write(Html.JobNameLink(job.Key, job.Value.Job));

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



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


            
            #line 98 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                         if (job.Value.EnqueuedAt.HasValue)
                                        {
                                            
            
            #line default
            #line hidden
            
            #line 100 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                       Write(Html.RelativeTime(job.Value.EnqueuedAt.Value));

            
            #line default
            #line hidden
            
            #line 100 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                                                                          
                                        }
                                        else
                                        {

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


            
            #line 104 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                           Write(Strings.Common_NotAvailable);

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


            
            #line 105 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                        }

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


            
            #line 107 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                }

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


            
            #line 109 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                        }

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


            
            #line 114 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
           Write(Html.Paginator(pager));

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


            
            #line 116 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
        }

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


        }
コード例 #19
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 9 "..\..\Dashboard\Pages\QueuesPage.cshtml"

            Layout = new LayoutPage {
                Title = "Queues"
            };

            var monitor = Storage.GetMonitoringApi();
            IList <QueueWithTopEnqueuedJobsDto> queues = monitor.Queues();



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



            #line 16 "..\..\Dashboard\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 21 "..\..\Dashboard\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 34 "..\..\Dashboard\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 38 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    Write(Request.LinkTo("/queues/" + queue.Name));


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



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


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



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


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



            #line 44 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    if (queue.Fetched.HasValue)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <a href=\"");



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


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



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


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



            #line 49 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <em>N/A</em>\r\n");



            #line 53 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    }


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



            #line 56 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    if (queue.FirstJobs.Count == 0)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <em>No jobs queued.</em>\r\n");



            #line 59 "..\..\Dashboard\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 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        foreach (var job in queue.FirstJobs)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                        <tr class=\"");



            #line 74 "..\..\Dashboard\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 76 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));


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



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


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



            #line 77 "..\..\Dashboard\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 80 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            }


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



            #line 83 "..\..\Dashboard\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 84 "..\..\Dashboard\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 88 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));


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



            #line 89 "..\..\Dashboard\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 93 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            if (job.Value.EnqueuedAt.HasValue)
                            {
            #line default
            #line hidden
                                WriteLiteral("                                                    <span data-moment=\"");



            #line 95 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                Write(JobHelper.ToTimestamp(job.Value.EnqueuedAt.Value));


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



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


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



            #line 98 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            }
                            else
                            {
            #line default
            #line hidden
                                WriteLiteral("                                                    <em>n/a</em>\r\n");



            #line 102 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            }


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



            #line 105 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        }


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



            #line 108 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    }


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



            #line 111 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                }


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



            #line 114 "..\..\Dashboard\Pages\QueuesPage.cshtml"
            }

            #line default
            #line hidden
        }
コード例 #20
0
        public override void Execute()
        {


WriteLiteral("\r\n");









            
            #line 9 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
  
    Layout = new LayoutPage("Awaiting Jobs");

    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    List<string> jobIds;
    Pager pager;

    using (var connection = Storage.GetConnection())
    {
        var storageConnection = connection as JobStorageConnection;

        if (storageConnection == null)
        {
            throw new NotSupportedException("Continuations are not supported for your current job storage implementation.");
        }

        pager = new Pager(from, perPage, storageConnection.GetSetCount("awaiting"));
        jobIds = storageConnection.GetRangeFromSet("awaiting", pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 36 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">Awaitin" +
"g Jobs</h1>\r\n\r\n");


            
            #line 41 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
         if (jobIds.Count > 0)
        {

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


            
            #line 46 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                 Write(Url.To("/jobs/awaiting/enqueue"));

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

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


            
            #line 53 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                 Write(Url.To("/jobs/awaiting/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 60 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
               Write(Html.PerPageSelector(pager));

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

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


            
            #line 77 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                         foreach (var jobId in jobIds)
                        {
                            JobData jobData;
                            StateData stateData;
                            StateData parentStateData = null;

                            using (var connection = Storage.GetConnection())
                            {
                                jobData = connection.GetJobData(jobId);
                                stateData = connection.GetStateData(jobId);

                                if (stateData != null && stateData.Name == AwaitingState.StateName)
                                {
                                    parentStateData = connection.GetStateData(stateData.Data["ParentId"]);
                                }
                            }


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


            
            #line 94 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                    Write(jobData != null ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                <td>\r\n                                    <in" +
"put type=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\"");


            
            #line 96 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                                                                         Write(jobId);

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


            
            #line 99 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                               Write(Html.JobIdLink(jobId));

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


            
            #line 101 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                 if (jobData == null)
                                {

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


            
            #line 104 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                }
                                else
                                {

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


            
            #line 108 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                   Write(Html.JobNameLink(jobId, jobData.Job));

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



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


            
            #line 111 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                         if (stateData != null && stateData.Data.ContainsKey("Options") && !String.IsNullOrWhiteSpace(stateData.Data["Options"]))
                                        {

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


            
            #line 113 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                             Write(stateData.Data["Options"]);

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


            
            #line 114 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                        }
                                        else
                                        {

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


            
            #line 118 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                        }

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



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


            
            #line 121 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                         if (parentStateData != null)
                                        {

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


            
            #line 123 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                Write(Url.JobDetails(stateData.Data["ParentId"]));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                                <span class=\"label label-defa" +
"ult label-hover\" style=\"");


            
            #line 124 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                                                                 Write(String.Format("background-color: {0};", JobHistoryRenderer.GetForegroundStateColor(parentStateData.Name)));

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


            
            #line 125 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                               Write(parentStateData.Name);

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


            
            #line 128 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                        }
                                        else
                                        {

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


            
            #line 132 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                        }

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



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


            
            #line 135 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                   Write(Html.RelativeTime(jobData.CreatedAt));

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


            
            #line 137 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                }

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


            
            #line 139 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        }

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


            
            #line 142 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
           Write(Html.Paginator(pager));

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


            
            #line 144 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
        }
        else
        {

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


            
            #line 150 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
        }

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


        }
コード例 #21
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 9 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"

            Layout = new LayoutPage(Strings.OnEventJobsPage_Title);
            List <OnEventJobDto> onEventJobs;

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            Pager pager = null;

            using (var connection = Storage.GetConnection())
            {
                var storageConnection = connection as JobStorageConnection;
                if (storageConnection != null)
                {
                    pager       = new Pager(from, perPage, storageConnection.GetOnEventJobCount());
                    onEventJobs = storageConnection.GetOnEventJobs(pager.FromRecord, pager.FromRecord + pager.RecordsPerPage);
                }
                else
                {
                    onEventJobs = connection.GetOnEventJobs();
                }
            }



            #line default
            #line hidden
            WriteLiteral(@"<style>
    .table {
        /*table-layout: fixed;*/
    }

        .table td {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
</style>
<div class=""row"">
    <div class=""col-md-12"">
        <h1 class=""page-header"">");



            #line 47 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
            Write(Strings.OnEventJobsPage_Title);


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



            #line 49 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
            if (onEventJobs.Count == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");



            #line 52 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Strings.OnEventJobsPage_NoJobs);


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



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



            #line 60 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Url.To("/onevent/trigger"));


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



            #line 61 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Strings.OnEventJobsPage_Triggering);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
                             "n class=\"glyphicon glyphicon-play-circle\"></span>\r\n                        ");



            #line 64 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Strings.OnEventJobsPage_TriggerNow);


            #line default
            #line hidden
                WriteLiteral("\r\n                    </button>\r\n\r\n                    <button class=\"js-jobs-lis" +
                             "t-command btn btn-sm btn-default\"\r\n                            data-url=\"");



            #line 68 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Url.To("/onevent/remove"));


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



            #line 69 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Strings.Common_Deleting);


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



            #line 70 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Strings.Common_DeleteConfirm);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
                             "n class=\"glyphicon glyphicon-remove\"></span>\r\n                        ");



            #line 73 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Strings.Common_Delete);


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



            #line 76 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                if (pager != null)
                {
            #line default
            #line hidden
                    WriteLiteral("                        ");

                    WriteLiteral(" ");



            #line 78 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    Write(Html.PerPageSelector(pager));


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



            #line 79 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                }


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

                <div class=""table-responsive"">
                    <table class=""table"">
                        <thead>
                            <tr>
                                <th class=""min-width"">
                                    <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                </th>
                                ");



                WriteLiteral("\r\n                                <th class=\"min-width\">");



            #line 90 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Strings.OnEventJobsPage_Table_Signal);


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



            #line 91 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Strings.OnEventJobsPage_Table_Trigger);


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



            #line 92 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Strings.OnEventJobsPage_Table_Name);


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



            #line 93 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Strings.OnEventJobsPage_Table_LastExecution);


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



            #line 94 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                Write(Strings.Common_Created);


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



            #line 98 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                foreach (var job in onEventJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                                <tr class=\"js-jobs-list-row hover\">\r\n            " +
                                 "                        <td>\r\n                                        <input typ" +
                                 "e=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\"");



            #line 102 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    Write(job.Id);


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



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



                    WriteLiteral("\r\n");



            #line 108 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"

                    string triggerSignal = job.TriggerSignal;



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



            #line 113 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    if (triggerSignal != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <code title=\"");



            #line 115 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                        Write(triggerSignal);


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



            #line 115 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                        Write(triggerSignal);


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



            #line 116 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    }


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



                    WriteLiteral("\r\n");



            #line 122 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"

                    string triggerExpression = job.TriggerExpression;



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



            #line 126 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    if (triggerExpression != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <code title=\"");



            #line 128 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                        Write(triggerExpression);


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



            #line 128 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                        Write(job.TriggerExpression);


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



            #line 129 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <code>");



            #line 132 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                        Write(job.TriggerExpression);


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



            #line 133 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    }


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



            #line 137 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    if (!String.IsNullOrWhiteSpace(job.Name))
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <span data-container=\"body\">");



            #line 139 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                        Write(job.Name);


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



            #line 140 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    }


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



            #line 145 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    if (job.LastExecution != null)
                    {
                        if (!String.IsNullOrEmpty(job.LastJobId))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <a href=\"");



            #line 149 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                            Write(Url.JobDetails(job.LastJobId));


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



            #line 150 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                            Write($"background-color: {JobHistoryRenderer.GetForegroundStateColor(job.LastJobState)};");


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



            #line 151 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                            Write(Html.RelativeTime(job.LastExecution.Value));


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



            #line 154 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <em>\r\n                           " +
                                         "                         ");



            #line 158 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                            Write(Strings.OnEventJobsPage_Canceled);


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



            #line 158 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                            Write(Html.RelativeTime(job.LastExecution.Value));


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



            #line 160 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                        }
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <em>");



            #line 164 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                        Write(Strings.Common_NotAvailable);


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



            #line 165 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    }


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



            #line 168 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    if (job.CreatedAt != null)
                    {
            #line default
            #line hidden

            #line 170 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                        Write(Html.RelativeTime(job.CreatedAt.Value));


            #line default
            #line hidden

            #line 170 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <em>N/A</em>\r\n");



            #line 175 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    }


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



            #line 178 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                }


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



            #line 183 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                if (pager != null)
                {
            #line default
            #line hidden
                    WriteLiteral("                    ");

                    WriteLiteral(" ");



            #line 185 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                    Write(Html.Paginator(pager));


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



            #line 186 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
                }


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



            #line 188 "..\..\Dashboard\Pages\OnEventJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>    ");
        }
コード例 #22
0
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
  
    Layout = new LayoutPage(Strings.SucceededJobsPage_Title);

    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    var monitor = Storage.GetMonitoringApi();
    var pager = new Pager(from, perPage, monitor.SucceededListCount());
    var succeededJobs = monitor.SucceededJobs(pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 22 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");


            
            #line 25 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                           Write(Strings.SucceededJobsPage_Title);

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


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

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");


            
            #line 30 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
           Write(Strings.SucceededJobsPage_NoJobs);

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


            
            #line 32 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
        }
        else
        {

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


            
            #line 38 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                 Write(Url.To("/jobs/succeeded/requeue"));

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


            
            #line 39 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                          Write(Strings.Common_Enqueueing);

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
"n class=\"glyphicon glyphicon-repeat\"></span>\r\n                        ");


            
            #line 42 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                   Write(Strings.Common_RequeueJobs);

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


            
            #line 45 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
               Write(Html.PerPageSelector(pager));

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

                <div class=""table-responsive"">
                    <table class=""table"">
                        <thead>
                            <tr>
                                <th class=""min-width"">
                                    <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                </th>
                                <th class=""min-width"">");


            
            #line 55 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                                 Write(Strings.Common_Id);

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


            
            #line 56 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                               Write(Strings.Common_Job);

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


            
            #line 57 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                                 Write(Strings.SucceededJobsPage_Table_TotalDuration);

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


            
            #line 58 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                                   Write(Strings.SucceededJobsPage_Table_Succeeded);

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


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

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


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

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


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

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


            
            #line 66 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                         if (job.Value == null || job.Value.InSucceededState)
                                        {

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


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

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


            
            #line 69 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                        }

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


            
            #line 72 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                   Write(Html.JobIdLink(job.Key));

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


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

            
            #line default
            #line hidden
WriteLiteral("                                            <span title=\"");


            
            #line 75 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                                    Write(Strings.Common_JobStateChanged_Text);

            
            #line default
            #line hidden
WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 76 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                        }

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


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

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


            
            #line 82 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                           Write(Strings.Common_JobExpired);

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


            
            #line 84 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                    }
                                    else
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <td class=\"word-break\">\r\n                " +
"                            ");


            
            #line 88 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                       Write(Html.JobNameLink(job.Key, job.Value.Job));

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



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


            
            #line 91 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                             if (job.Value.TotalDuration.HasValue)
                                            {
                                                
            
            #line default
            #line hidden
            
            #line 93 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                           Write(Html.ToHumanDuration(TimeSpan.FromMilliseconds(job.Value.TotalDuration.Value), false));

            
            #line default
            #line hidden
            
            #line 93 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                                                                                                                      
                                            }

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



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


            
            #line 97 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                             if (job.Value.SucceededAt.HasValue)
                                            {
                                                
            
            #line default
            #line hidden
            
            #line 99 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                           Write(Html.RelativeTime(job.Value.SucceededAt.Value));

            
            #line default
            #line hidden
            
            #line 99 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                                                                               
                                            }

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


            
            #line 102 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                                    }

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


            
            #line 104 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                            }

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


            
            #line 109 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
           Write(Html.Paginator(pager));

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


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

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


        }
コード例 #23
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 13 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

            var monitor = Storage.GetMonitoringApi();
            var job     = monitor.JobDetails(JobId);

            string title = null;

            if (job != null)
            {
                title = job.Job != null?Html.JobName(job.Job) : null;

                job.History.Add(new StateHistoryDto {
                    StateName = "Created", CreatedAt = job.CreatedAt ?? default(DateTime)
                });
            }

            title  = title ?? Strings.Common_Job;
            Layout = new LayoutPage(title);



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 31 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");



            #line 34 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            Write(title);


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



            #line 36 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            if (job == null)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-warning\">\r\n                ");



            #line 39 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                Write(String.Format(Strings.JobDetailsPage_JobExpired, JobId));


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



            #line 41 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            }
            else
            {
                var currentState = job.History[0];
                if (currentState.StateName == ProcessingState.StateName)
                {
                    var server = monitor.Servers().FirstOrDefault(x => x.Name == currentState.Data["ServerId"]);
                    if (server == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <div class=\"alert alert-danger\">\r\n                        ");



            #line 51 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Html.Raw(String.Format(Strings.JobDetailsPage_JobAbortedNotActive_Warning_Html, currentState.Data["ServerId"], Url.To("/servers"))));


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



            #line 53 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }
                    else if (server.Heartbeat.HasValue && server.Heartbeat < DateTime.UtcNow.AddMinutes(-1))
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <div class=\"alert alert-warning\">\r\n                        ");



            #line 57 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Html.Raw(String.Format(Strings.JobDetailsPage_JobAbortedWithHeartbeat_Warning_Html, server.Name)));


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



            #line 59 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }
                }

                if (job.ExpireAt.HasValue)
                {
            #line default
            #line hidden
                    WriteLiteral("                <div class=\"alert alert-info\">\r\n                    ");



            #line 65 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Html.Raw(String.Format(Strings.JobDetailsPage_JobFinished_Warning_Html, JobHelper.ToTimestamp(job.ExpireAt.Value), job.ExpireAt)));


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



            #line 67 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }



            #line default
            #line hidden
                WriteLiteral("            <div class=\"job-snippet\">\r\n                <div class=\"job-snippet-co" +
                             "de\">\r\n                    <pre><code><span class=\"comment\">// ");



            #line 71 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                Write(Strings.JobDetailsPage_JobId);


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



            #line 71 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                Write(Html.JobId(JobId.ToString(), false));


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



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


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



            #line 76 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                if (job.Properties.Count > 0)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <div class=\"job-snippet-properties\">\r\n                       " +
                                 " <dl>\r\n");



            #line 80 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    foreach (var property in job.Properties.Where(x => x.Key != "Continuations"))
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <dt>");



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


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



                        WriteLiteral("                                <dd><pre><code>");



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


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



            #line 84 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }


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



            #line 87 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }


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



            #line 89 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

                if (job.Properties.ContainsKey("Continuations"))
                {
                    List <ContinuationsSupportAttribute.Continuation> continuations;

                    using (var connection = Storage.GetConnection())
                    {
                        continuations = JobHelper.FromJson <List <ContinuationsSupportAttribute.Continuation> >(connection.GetJobParameter(
                                                                                                                    JobId, "Continuations")) ?? new List <ContinuationsSupportAttribute.Continuation>();
                    }

                    if (continuations.Count > 0)
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <h3>");



            #line 102 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Continuations);


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



                        WriteLiteral("                    <div class=\"table-responsive\">\r\n                        <tabl" +
                                     "e class=\"table\">\r\n                            <thead>\r\n                         " +
                                     "   <tr>\r\n                                <th class=\"min-width\">");



            #line 107 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Id);


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



            #line 108 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Condition);


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



            #line 109 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_State);


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



            #line 110 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Job);


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



            #line 111 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Created);


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



            #line 115 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        foreach (var continuation in continuations)
                        {
                            JobData jobData;

                            using (var connection = Storage.GetConnection())
                            {
                                jobData = connection.GetJobData(continuation.JobId);
                            }



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



            #line 125 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            if (jobData == null)
                            {
            #line default
            #line hidden
                                WriteLiteral("                                        <td colspan=\"5\"><em>");



            #line 127 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(String.Format(Strings.JobDetailsPage_JobExpired, continuation.JobId));


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



            #line 128 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            }
                            else
                            {
            #line default
            #line hidden
                                WriteLiteral("                                        <td class=\"min-width\">");



            #line 131 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(Html.JobIdLink(continuation.JobId));


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



                                WriteLiteral("                                        <td class=\"min-width\"><code>");



            #line 132 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(continuation.Options.ToString("G"));


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



                                WriteLiteral("                                        <td class=\"min-width\">");



            #line 133 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(Html.StateLabel(jobData.State));


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



                                WriteLiteral("                                        <td class=\"word-break\">");



            #line 134 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(Html.JobNameLink(continuation.JobId, jobData.Job));


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



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



            #line 135 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(Html.RelativeTime(jobData.CreatedAt));


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



            #line 136 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            }


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



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


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



            #line 142 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }
                }



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



            #line 146 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                if (job.History.Count > 1)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <span class=\"job-snippet-buttons pull-right\">\r\n              " +
                                 "          <button class=\"btn btn-sm btn-default\" data-ajax=\"");



            #line 149 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Url.To("/jobs/actions/requeue/" + JobId));


            #line default
            #line hidden
                    WriteLiteral("\" data-loading-text=\"");



            #line 149 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Strings.Common_Enqueueing);


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



            #line 149 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Strings.JobDetailsPage_Requeue);


            #line default
            #line hidden
                    WriteLiteral("</button>\r\n                        <button class=\"btn btn-sm btn-death\" data-ajax" +
                                 "=\"");



            #line 150 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Url.To("/jobs/actions/delete/" + JobId));


            #line default
            #line hidden
                    WriteLiteral("\" data-loading-text=\"");



            #line 150 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Strings.Common_Deleting);


            #line default
            #line hidden
                    WriteLiteral("\" data-confirm=\"");



            #line 150 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Strings.JobDetailsPage_DeleteConfirm);


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



            #line 150 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Strings.Common_Delete);


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



            #line 152 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }


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



            #line 154 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                Write(Strings.JobDetailsPage_State);


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



            #line 156 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

                var index = 0;

                foreach (var entry in job.History)
                {
                    var accentColor     = JobHistoryRenderer.GetForegroundStateColor(entry.StateName);
                    var backgroundColor = JobHistoryRenderer.GetBackgroundStateColor(entry.StateName);



            #line default
            #line hidden
                    WriteLiteral("                <div class=\"state-card\" style=\"");



            #line 164 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(index == 0 ? $"border-color: {accentColor}" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                    <h4 class=\"state-card-title\" style=\"");



            #line 165 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(index == 0 ? $"color: {accentColor}" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                        <small class=\"pull-right text-muted\">\r\n");



            #line 167 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    if (index == job.History.Count - 1)
                    {
            #line default
            #line hidden

            #line 169 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Html.RelativeTime(entry.CreatedAt));


            #line default
            #line hidden

            #line 169 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }
                    else
                    {
                        var duration = Html.ToHumanDuration(entry.CreatedAt - job.History[index + 1].CreatedAt);

                        if (index == 0)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                    ");

                            WriteLiteral(" ");



            #line 177 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            Write(Html.RelativeTime(entry.CreatedAt));


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



            #line 177 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            Write(duration);


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



            #line 178 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                    ");

                            WriteLiteral(" ");



            #line 181 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            Write(Html.MomentTitle(entry.CreatedAt, duration));


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



            #line 182 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        }
                    }


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



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


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



            #line 189 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    if (!String.IsNullOrWhiteSpace(entry.Reason))
                    {
            #line default
            #line hidden
                        WriteLiteral("                        <p class=\"state-card-text text-muted\">");



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


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



            #line 192 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }


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



            #line 194 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

                    var rendered = Html.RenderHistory(entry.StateName, entry.Data);



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



            #line 198 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    if (rendered != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                        <div class=\"state-card-body\" style=\"");



            #line 200 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(index == 0 ? $"background-color: {backgroundColor}" : null);


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



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


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



            #line 203 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }


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



            #line 205 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

                    index++;
                }
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #24
0
        public override void Execute()
        {


WriteLiteral("\r\n");









            
            #line 9 "..\..\Dashboard\Pages\RetriesPage.cshtml"
  
    Layout = new LayoutPage(Strings.RetriesPage_Title);
    
    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    Pager pager = null;
    List<string> jobIds = null;

    using (var connection = Storage.GetConnection())
    {
        var storageConnection = connection as JobStorageConnection;

        if (storageConnection != null)
        {
            pager = new Pager(@from, perPage, storageConnection.GetSetCount("retries"));
            jobIds = storageConnection.GetRangeFromSet("retries", pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1);
        }
    }


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


            
            #line 32 "..\..\Dashboard\Pages\RetriesPage.cshtml"
 if (pager == null)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-warning\">\r\n        ");


            
            #line 35 "..\..\Dashboard\Pages\RetriesPage.cshtml"
   Write(Html.Raw(String.Format(Strings.RetriesPage_Warning_Html, Url.To("/jobs/scheduled"))));

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


            
            #line 37 "..\..\Dashboard\Pages\RetriesPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"row\">\r\n        <div class=\"col-md-12\">\r\n            <h1 class=\"pa" +
"ge-header\">");


            
            #line 42 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                               Write(Strings.RetriesPage_Title);

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


            
            #line 43 "..\..\Dashboard\Pages\RetriesPage.cshtml"
             if (jobIds.Count == 0)
            {

            
            #line default
            #line hidden
WriteLiteral("                <div class=\"alert alert-success\">\r\n                    ");


            
            #line 46 "..\..\Dashboard\Pages\RetriesPage.cshtml"
               Write(Strings.RetriesPage_NoJobs);

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


            
            #line 48 "..\..\Dashboard\Pages\RetriesPage.cshtml"
            }
            else
            {

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


            
            #line 54 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                     Write(Url.To("/jobs/scheduled/enqueue"));

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


            
            #line 55 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                              Write(Strings.Common_Enqueueing);

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                                disabled=\"disabled\">\r\n                        " +
"    <span class=\"glyphicon glyphicon-repeat\"></span>\r\n                          " +
"  ");


            
            #line 58 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                       Write(Strings.Common_EnqueueButton_Text);

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


            
            #line 62 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                     Write(Url.To("/jobs/scheduled/delete"));

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


            
            #line 63 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                              Write(Strings.Common_Deleting);

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


            
            #line 64 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                         Write(Strings.Common_DeleteConfirm);

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                                disabled=\"disabled\">\r\n                        " +
"    <span class=\"glyphicon glyphicon-remove\"></span>\r\n                          " +
"  ");


            
            #line 67 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                       Write(Strings.Common_DeleteSelected);

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


            
            #line 70 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                   Write(Html.PerPageSelector(pager));

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

                    <div class=""table-responsive"">
                        <table class=""table table-hover"">
                            <thead>
                                <tr>
                                    <th class=""min-width"">
                                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                    </th>
                                    <th class=""min-width"">");


            
            #line 80 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                                     Write(Strings.Common_Id);

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


            
            #line 81 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                                     Write(Strings.Common_State);

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


            
            #line 82 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                   Write(Strings.Common_Job);

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


            
            #line 83 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                   Write(Strings.Common_Reason);

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


            
            #line 84 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                                       Write(Strings.Common_Retry);

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


            
            #line 85 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                                       Write(Strings.Common_Created);

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


            
            #line 89 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                 foreach (var jobId in jobIds)
                                {
                                    JobData jobData;
                                    StateData stateData;

                                    using (var connection = Storage.GetConnection())
                                    {
                                        jobData = connection.GetJobData(jobId);
                                        stateData = connection.GetStateData(jobId);
                                    }


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


            
            #line 100 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                                            Write(jobData != null ? "hover" : null);

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


            
            #line 102 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                                                                                                 Write(jobId);

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


            
            #line 105 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                       Write(Html.JobIdLink(jobId));

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


            
            #line 107 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                         if (jobData == null)
                                        {

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


            
            #line 110 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                        }
                                        else
                                        {

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


            
            #line 114 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                           Write(Html.StateLabel(jobData.State));

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



WriteLiteral("                                            <td class=\"word-break\">\r\n            " +
"                                    ");


            
            #line 117 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                           Write(Html.JobNameLink(jobId, jobData.Job));

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



WriteLiteral("                                            <td>\r\n                               " +
"                 ");


            
            #line 120 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                            Write(stateData?.Reason);

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



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


            
            #line 123 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                                 if (stateData != null && stateData.Data.ContainsKey("EnqueueAt"))
                                                {
                                                    
            
            #line default
            #line hidden
            
            #line 125 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                               Write(Html.RelativeTime(JobHelper.DeserializeDateTime(stateData.Data["EnqueueAt"])));

            
            #line default
            #line hidden
            
            #line 125 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                                                                                                                  
                                                }

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



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


            
            #line 129 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                           Write(Html.RelativeTime(jobData.CreatedAt));

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


            
            #line 131 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                        }

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


            
            #line 133 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                }

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


            
            #line 138 "..\..\Dashboard\Pages\RetriesPage.cshtml"
               Write(Html.Paginator(pager));

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


            
            #line 140 "..\..\Dashboard\Pages\RetriesPage.cshtml"
            }

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


            
            #line 143 "..\..\Dashboard\Pages\RetriesPage.cshtml"
}
            
            #line default
            #line hidden

        }
コード例 #25
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 11 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"

            Layout = new LayoutPage(Strings.RecurringJobsPage_Title);
            List <RecurringJobDto> recurringJobs;

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            Pager pager = null;

            using (var connection = Storage.GetConnection())
            {
                var storageConnection = connection as JobStorageConnection;
                if (storageConnection != null)
                {
                    pager         = new Pager(from, perPage, storageConnection.GetRecurringJobCount());
                    recurringJobs = storageConnection.GetRecurringJobs(pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1);
                }
                else
                {
                    recurringJobs = connection.GetRecurringJobs();
                }
            }



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-12\">\r\n        <h1 class=\"page-header\"" +
                         ">");



            #line 39 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
            Write(Strings.RecurringJobsPage_Title);


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



            #line 40 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
            if (recurringJobs.Count == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");



            #line 43 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.RecurringJobsPage_NoJobs);


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



            #line 45 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
                             "tn-toolbar-top\">\r\n");



            #line 50 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                if (!IsReadOnly)
                {
            #line default
            #line hidden
                    WriteLiteral("                        <button class=\"js-jobs-list-command btn btn-sm btn-primar" +
                                 "y\"\r\n                                data-url=\"");



            #line 53 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Url.To("/recurring/trigger"));


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



            #line 54 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Strings.RecurringJobsPage_Triggering);


            #line default
            #line hidden
                    WriteLiteral("\"\r\n                                disabled=\"disabled\">\r\n                        " +
                                 "    <span class=\"glyphicon glyphicon-play-circle\"></span>\r\n                     " +
                                 "       ");



            #line 57 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Strings.RecurringJobsPage_TriggerNow);


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



            #line 59 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden


            #line 60 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                if (!IsReadOnly)
                {
            #line default
            #line hidden
                    WriteLiteral("                        <button class=\"js-jobs-list-command btn btn-sm btn-defaul" +
                                 "t\"\r\n                                data-url=\"");



            #line 63 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Url.To("/recurring/remove"));


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



            #line 64 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Strings.Common_Deleting);


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



            #line 65 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Strings.Common_DeleteConfirm);


            #line default
            #line hidden
                    WriteLiteral("\"\r\n                                disabled=\"disabled\">\r\n                        " +
                                 "    <span class=\"glyphicon glyphicon-remove\"></span>\r\n                          " +
                                 "  ");



            #line 68 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Strings.Common_Delete);


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



            #line 70 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden


            #line 71 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                if (!IsReadOnly)
                {
            #line default
            #line hidden
                    WriteLiteral("                        <button class=\"js-jobs-list-command btn btn-sm btn-defaul" +
                                 "t\"\r\n                                data-url=\"");



            #line 74 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Url.To("/recurring/start"));


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



            #line 75 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Strings.Start);


            #line default
            #line hidden
                    WriteLiteral("\"\r\n                                disabled=\"disabled\">\r\n                        " +
                                 "    <span class=\"glyphicon glyphicon-play\"></span>\r\n                            " +
                                 "");



            #line 78 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Strings.Start);


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



            #line 80 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden


            #line 81 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                if (!IsReadOnly)
                {
            #line default
            #line hidden
                    WriteLiteral("                        <button class=\"js-jobs-list-command btn btn-sm btn-defaul" +
                                 "t\"\r\n                                data-url=\"");



            #line 84 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Url.To("/recurring/stop"));


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



            #line 85 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Strings.Stop);


            #line default
            #line hidden
                    WriteLiteral("\"\r\n                                disabled=\"disabled\">\r\n                        " +
                                 "    <span class=\"glyphicon glyphicon-pause\"></span>\r\n                           " +
                                 " ");



            #line 88 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Strings.Stop);


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



            #line 90 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden


            #line 91 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                if (pager != null)
                {
            #line default
            #line hidden
                    WriteLiteral("                        ");

                    WriteLiteral(" ");



            #line 93 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Html.PerPageSelector(pager));


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



            #line 94 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                </div>\r\n\r\n                <div class=\"table-responsive\">\r\n       " +
                             "             <table class=\"table\">\r\n                        <thead>\r\n           " +
                             "                 <tr>\r\n");



            #line 101 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                if (!IsReadOnly)
                {
            #line default
            #line hidden
                    WriteLiteral("                                    <th class=\"min-width\">\r\n                     " +
                                 "                   <input type=\"checkbox\" class=\"js-jobs-list-select-all\" />\r\n  " +
                                 "                                  </th>\r\n");



            #line 106 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                                <th class=\"min-width\">");



            #line 107 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.Common_Id);


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



            #line 108 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.RecurringJobsPage_Table_Cron);


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



            #line 109 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.RecurringJobsPage_Table_TimeZone);


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



            #line 110 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.Common_Job);


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



            #line 111 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.RecurringJobsPage_Table_NextExecution);


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



            #line 112 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.RecurringJobsPage_Table_LastExecution);


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



            #line 113 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.Common_Created);


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



            #line 114 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.Status);


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



            #line 118 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                foreach (var job in recurringJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                                <tr class=\"js-jobs-list-row hover\">\r\n");



            #line 121 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (!IsReadOnly)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td>\r\n                                   " +
                                     "         <input type=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" valu" +
                                     "e=\"");



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


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



            #line 126 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


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



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


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



                    WriteLiteral("\r\n");



            #line 130 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"

                    string cronDescription = null;
                    bool   cronError       = false;

                    if (!String.IsNullOrEmpty(job.Cron))
                    {
                        try
                        {
                            RecurringJobEntity.ParseCronExpression(job.Cron);
                        }
                        catch (Exception ex)
                        {
                            cronDescription = ex.Message;
                            cronError       = true;
                        }

                        if (cronDescription == null)
                        {
#if FEATURE_CRONDESCRIPTOR
                            try
                            {
                                cronDescription = CronExpressionDescriptor.ExpressionDescriptor.GetDescription(job.Cron);
                            }
                            catch (FormatException)
                            {
                            }
#endif
                        }
                    }



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



            #line 161 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (cronDescription != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <code title=\"");



            #line 163 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(cronDescription);


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



            #line 164 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        if (cronError)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                    <span class=\"glyphicon glyphi" +
                                         "con-exclamation-sign\"></span>\r\n");



            #line 167 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        }


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



            #line 168 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(job.Cron);


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



            #line 170 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <code>");



            #line 173 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(job.Cron);


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



            #line 174 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


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



            #line 177 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (!String.IsNullOrWhiteSpace(job.TimeZoneId))
                    {
                        string    displayName;
                        Exception exception = null;

                        try
                        {
                            var resolver = DashboardOptions.TimeZoneResolver ?? new DefaultTimeZoneResolver();
                            displayName = resolver.GetTimeZoneById(job.TimeZoneId).DisplayName;
                        }
                        catch (Exception ex)
                        {
                            displayName = null;
                            exception   = ex;
                        }



            #line default
            #line hidden
                        WriteLiteral("                                            <span title=\"");



            #line 193 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(displayName);


            #line default
            #line hidden
                        WriteLiteral("\" data-container=\"body\">\r\n                                                ");



            #line 194 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(job.TimeZoneId);


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



            #line 195 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        if (exception != null)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                    <span class=\"glyphicon glyphi" +
                                         "con-exclamation-sign\" title=\"");



            #line 197 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(exception.Message);


            #line default
            #line hidden
                            WriteLiteral("\"></span>\r\n");



            #line 198 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                            </span>\r\n");



            #line 200 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            ");

                        WriteLiteral(" UTC\r\n");



            #line 204 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                    <t" +
                                 "d class=\"word-break\">\r\n");



            #line 207 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.Job != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            ");

                        WriteLiteral(" ");



            #line 209 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Html.JobName(job.Job));


            #line default
            #line hidden
                        WriteLiteral("\r\n");



            #line 210 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else if (job.LoadException != null && job.LoadException.InnerException != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <em>");



            #line 213 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(job.LoadException.InnerException.Message);


            #line default
            #line hidden
                        WriteLiteral("</em>\r\n");



            #line 214 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else if (job.LoadException != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <em>");



            #line 217 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(job.LoadException.Message);


            #line default
            #line hidden
                        WriteLiteral("</em>\r\n");



            #line 218 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <em>");



            #line 221 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Strings.Common_NotAvailable);


            #line default
            #line hidden
                        WriteLiteral("</em>\r\n");



            #line 222 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                    <t" +
                                 "d class=\"align-right min-width\">\r\n");



            #line 225 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.NextExecution != null)
                    {
            #line default
            #line hidden

            #line 227 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Html.RelativeTime(job.NextExecution.Value));


            #line default
            #line hidden

            #line 227 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
                        if (!String.IsNullOrEmpty(job.Error))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <span class=\"label label-danger t" +
                                         "ext-uppercase\" title=\"");



            #line 233 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(job.Error);


            #line default
            #line hidden
                            WriteLiteral("\">");



            #line 233 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Strings.Common_Error);


            #line default
            #line hidden
                            WriteLiteral("</span>\r\n");



            #line 234 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <span class=\"label label-warning " +
                                         "text-uppercase\" title=\"");



            #line 237 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Strings.RecurringJobsPage_RecurringJobDisabled_Tooltip);


            #line default
            #line hidden
                            WriteLiteral("\">");



            #line 237 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Strings.Common_Disabled);


            #line default
            #line hidden
                            WriteLiteral("</span>\r\n");



            #line 238 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        }
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                    <t" +
                                 "d class=\"align-right min-width\">\r\n");



            #line 242 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.LastExecution != null)
                    {
                        if (!String.IsNullOrEmpty(job.LastJobId))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <a href=\"");



            #line 246 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Url.JobDetails(job.LastJobId));


            #line default
            #line hidden
                            WriteLiteral("\" style=\"text-decoration: none\">\r\n                                               " +
                                         "     <span class=\"label label-default label-hover\" style=\"");



            #line 247 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write($"background-color: {JobHistoryRenderer.GetForegroundStateColor(job.LastJobState ?? EnqueuedState.StateName)};");


            #line default
            #line hidden
                            WriteLiteral("\">\r\n                                                        ");



            #line 248 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Html.RelativeTime(job.LastExecution.Value));


            #line default
            #line hidden
                            WriteLiteral("\r\n                                                    </span>\r\n                  " +
                                         "                              </a>\r\n");



            #line 251 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <em>\r\n                           " +
                                         "                         ");



            #line 255 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Strings.RecurringJobsPage_Canceled);


            #line default
            #line hidden
                            WriteLiteral(" ");



            #line 255 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Html.RelativeTime(job.LastExecution.Value));


            #line default
            #line hidden
                            WriteLiteral("\r\n                                                </em>\r\n");



            #line 257 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        }
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <em>");



            #line 261 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Strings.Common_NotAvailable);


            #line default
            #line hidden
                        WriteLiteral("</em>\r\n");



            #line 262 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                    <t" +
                                 "d class=\"align-right min-width\">\r\n");



            #line 265 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.CreatedAt != null)
                    {
            #line default
            #line hidden

            #line 267 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Html.RelativeTime(job.CreatedAt.Value));


            #line default
            #line hidden

            #line 267 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <em>N/A</em>\r\n");



            #line 272 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                    <t" +
                                 "d class=\"align-right min-width\">\r\n                                        ");



            #line 275 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(job.IsActive ? "Active" : "Passive");


            #line default
            #line hidden
                    WriteLiteral("\r\n                                    </td>\r\n                                </tr" +
                                 ">\r\n");



            #line 278 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                        </tbody>\r\n                    </table>\r\n                <" +
                             "/div>\r\n\r\n");



            #line 283 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                if (pager != null)
                {
            #line default
            #line hidden
                    WriteLiteral("                    ");

                    WriteLiteral(" ");



            #line 285 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Html.Paginator(pager));


            #line default
            #line hidden
                    WriteLiteral("\r\n");



            #line 286 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </div>\r\n");



            #line 288 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>    ");
        }
コード例 #26
0
        public override void Execute()
        {


WriteLiteral("\r\n");






            
            #line 6 "..\..\Dashboard\Pages\QueuesPage.cshtml"
  
    Layout = new LayoutPage("Queues");

    var monitor = Storage.GetMonitoringApi();
    var queues = monitor.Queues();


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 15 "..\..\Dashboard\Pages\QueuesPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">Queues<" +
"/h1>\r\n\r\n");


            
            #line 20 "..\..\Dashboard\Pages\QueuesPage.cshtml"
         if (queues.Count == 0)
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-warning\">\r\n                No queued jobs fou" +
"nd. Try to enqueue a job.\r\n            </div>\r\n");


            
            #line 25 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                    Write(Url.Queue(queue.Name));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 43 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                           Write(queue.Name);

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </a>\r\n                        </td>\r\n              " +
"          <td>");


            
            #line 46 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                       Write(queue.Length);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                        <td>\r\n");


            
            #line 48 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                             if (queue.Fetched.HasValue)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <a href=\"");


            
            #line 50 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                    Write(Url.To("/jobs/enqueued/fetched/" + queue.Name));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 51 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                               Write(queue.Fetched);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </a>\r\n");


            
            #line 53 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <em>N/A</em>\r\n");


            
            #line 57 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td>\r\n");


            
            #line 60 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                             if (queue.FirstJobs.Count == 0)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <em>No jobs queued.</em>\r\n");


            
            #line 63 "..\..\Dashboard\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 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                     foreach (var job in queue.FirstJobs.Where(j => j.Value != null))
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <tr class=\"");


            
            #line 78 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                               Write(!job.Value.InEnqueuedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                            <td class=\"min-width\">\r\n         " +
"                                       ");


            
            #line 80 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                           Write(Html.JobIdLink(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 81 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                 if (!job.Value.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 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                }

            
            #line default
            #line hidden
WriteLiteral("                                            </td>\r\n                              " +
"              <td class=\"min-width\">\r\n                                          " +
"      ");


            
            #line 87 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                           Write(Html.StateLabel(job.Value.State));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                            </td>\r\n                            " +
"                <td>\r\n                                                ");


            
            #line 90 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                           Write(Html.JobNameLink(job.Key, job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                            </td>\r\n                            " +
"                <td class=\"align-right min-width\">\r\n");


            
            #line 93 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                 if (job.Value.EnqueuedAt.HasValue)
                                                {
                                                    
            
            #line default
            #line hidden
            
            #line 95 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                               Write(Html.RelativeTime(job.Value.EnqueuedAt.Value));

            
            #line default
            #line hidden
            
            #line 95 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                                                                  
                                                }
                                                else
                                                {

            
            #line default
            #line hidden
WriteLiteral("                                                    <em>n/a</em>\r\n");


            
            #line 100 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                                }

            
            #line default
            #line hidden
WriteLiteral("                                            </td>\r\n                              " +
"          </tr>\r\n");


            
            #line 103 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                    </tbody>\r\n                                </t" +
"able>\r\n");


            
            #line 106 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                    </tr>\r\n");


            
            #line 109 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("                </tbody>\r\n            </table>\r\n");


            
            #line 112 "..\..\Dashboard\Pages\QueuesPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </div>\r\n</div>");


        }
コード例 #27
0
        public override void Execute()
        {


WriteLiteral("\r\n");








            
            #line 8 "..\..\Dashboard\Pages\DashboardPage.cshtml"
  
    Layout = new LayoutPage { Title = "Dashboard" };
    IDictionary<DateTime, long> succeeded = null;
    IDictionary<DateTime, long> failed = null;

    var period = Request.Query["period"]?? "day";

    var monitor = Storage.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 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\Pages\DashboardPage.cshtml"
 if (succeeded != null && failed != null)
{

            
            #line default
            #line hidden
WriteLiteral("    <div id=\"historyGraph\" \r\n          data-succeeded=\"");


            
            #line 44 "..\..\Dashboard\Pages\DashboardPage.cshtml"
                     Write(JsonConvert.SerializeObject(succeeded));

            
            #line default
            #line hidden
WriteLiteral("\" \r\n          data-failed=\"");


            
            #line 45 "..\..\Dashboard\Pages\DashboardPage.cshtml"
                  Write(JsonConvert.SerializeObject(failed));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n    </div>\r\n");


            
            #line 47 "..\..\Dashboard\Pages\DashboardPage.cshtml"
}
            
            #line default
            #line hidden

        }
コード例 #28
0
        public override void Execute()
        {


WriteLiteral("\r\n");










            
            #line 10 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
  
    var monitor = Storage.GetMonitoringApi();
    var job = monitor.JobDetails(JobId.ToString());

    string title = null;

    if (job != null)
    {
        title = job.Job != null ? Html.JobName(job.Job) : null;
    }

    title = title ?? "Job";
    Layout = new LayoutPage(title);


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 27 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");


            
            #line 30 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                           Write(title);

            
            #line default
            #line hidden
WriteLiteral("</h1>\r\n\r\n");


            
            #line 32 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
         if (job == null)
        {

            
            #line default
            #line hidden
WriteLiteral("            ");

WriteLiteral(" The job with id \'");


            
            #line 34 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                           Write(JobId);

            
            #line default
            #line hidden
WriteLiteral("\' has expired or could not be found on the server.\r\n");


            
            #line 35 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
        }
        else
        {
            var currentState = job.History.Count > 0 ? job.History[0] : null;
            if (currentState != null && currentState.StateName == ProcessingState.StateName)
            {
                var server = monitor.Servers().FirstOrDefault(x => x.Name == currentState.Data["ServerId"]);
                if (server == null)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div class=\"alert alert-danger\">\r\n                        <st" +
"rong>The job was aborted</strong> – it is processed by server\r\n                 " +
"       <code>");


            
            #line 46 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                         Write(currentState.Data["ServerId"]);

            
            #line default
            #line hidden
WriteLiteral("</code> which is not in the \r\n                        <a href=\"");


            
            #line 47 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            Write(Url.To("/servers"));

            
            #line default
            #line hidden
WriteLiteral("\">active servers</a> list for now.\r\n                        It will be retried au" +
"tomatically after invisibility timeout, but you can\r\n                        als" +
"o re-queue or delete it manually.\r\n                    </div>\r\n");


            
            #line 51 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }
                else if (server.Heartbeat.HasValue && server.Heartbeat < DateTime.UtcNow.AddMinutes(-1))
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div class=\"alert alert-warning\">\r\n                        <s" +
"trong>Looks like the job was aborted</strong> – it is processed by server\r\n     " +
"                   <code>");


            
            #line 56 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                         Write(server.Name);

            
            #line default
            #line hidden
WriteLiteral("</code>, which reported its heartbeat more than 1 minute ago.\r\n                  " +
"      It will be retried automatically after invisibility timeout, but you can\r\n" +
"                        also re-queue or delete it manually.\r\n                  " +
"  </div>\r\n");


            
            #line 60 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }
            }

            if (job.ExpireAt.HasValue)
            {

            
            #line default
            #line hidden
WriteLiteral("                <div class=\"alert alert-info\">\r\n                    <strong>The j" +
"ob is finished</strong>.\r\n                    It will be removed automatically <" +
"em><abbr data-moment=\"");


            
            #line 67 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                       Write(JobHelper.ToTimestamp(job.ExpireAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 67 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                                                                   Write(job.ExpireAt);

            
            #line default
            #line hidden
WriteLiteral("</abbr></em>.\r\n                </div>\r\n");


            
            #line 69 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            }


            
            #line default
            #line hidden
WriteLiteral("            <div class=\"job-snippet\">\r\n                <div class=\"job-snippet-he" +
"ader\">\r\n                    <span class=\"job-snippet-tab\">\r\n                    " +
"    Job ID: <span class=\"job-snippet-id\">");


            
            #line 74 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                        Write(Html.JobId(JobId.ToString(), false));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n                    </span>\r\n\r\n                    <span class=\"job-snip" +
"pet-buttons pull-right\">\r\n                        <button class=\"btn btn-xs btn-" +
"default\" data-ajax=\"");


            
            #line 78 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                     Write(Url.To("/jobs/actions/requeue/" + JobId));

            
            #line default
            #line hidden
WriteLiteral("\" data-loading-text=\"Enqueueing...\">Requeue</button>\r\n                        <bu" +
"tton class=\"btn btn-xs btn-death\" data-ajax=\"");


            
            #line 79 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                   Write(Url.To("/jobs/actions/delete/" + JobId));

            
            #line default
            #line hidden
WriteLiteral(@""" data-loading-text=""Deleting..."" data-confirm=""Do you really want to delete this job?"">Delete</button>
                    </span>

                    <div class=""clearfix""></div>
                </div>
                <div class=""job-snippet-body"">
                    <div class=""job-snippet-code"">
");


            
            #line 86 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                         if (job.CreatedAt.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <div class=\"pull-right job-creation-date\">\r\n         " +
"                       Created\r\n                                <span data-momen" +
"t=\"");


            
            #line 90 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                              Write(JobHelper.ToTimestamp(job.CreatedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\"></span>\r\n                            </div>\r\n");


            
            #line 92 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        }

            
            #line default
            #line hidden

            
            #line 93 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                         if (job != null)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <pre><code>");


            
            #line 95 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                  Write(JobMethodCallRenderer.Render(job.Job));

            
            #line default
            #line hidden
WriteLiteral("</code></pre>\r\n");


            
            #line 96 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                        <div class=\"clearfix\"></div>\r\n                    </div>\r" +
"\n\r\n");


            
            #line 100 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                     if (job.Properties.Count > 0)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <div class=\"job-snippet-properties\">\r\n                   " +
"         <dl>\r\n");


            
            #line 104 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                 foreach (var property in job.Properties)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <dt>");


            
            #line 106 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                   Write(property.Key);

            
            #line default
            #line hidden
WriteLiteral("</dt>\r\n");



WriteLiteral("                                    <dd>\r\n                                       " +
" <pre>");


            
            #line 108 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                        Write(property.Value);

            
            #line default
            #line hidden
WriteLiteral("</pre>\r\n                                    </dd>\r\n");


            
            #line 110 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </dl>\r\n                        </div>\r\n");


            
            #line 113 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </div>\r\n            </div>\r\n");


            
            #line 116 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

            if (job.History.Count > 0)
            {

            
            #line default
            #line hidden
WriteLiteral("                <h3>History</h3>\r\n");


            
            #line 120 "..\..\Dashboard\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 = index == 0
                        ? JobHistoryRenderer.GetForegroundStateColor(entry.StateName)
                        : JobHistoryRenderer.GetBackgroundStateColor(entry.StateName);


            
            #line default
            #line hidden
WriteLiteral("                    <div class=\"job-history ");


            
            #line 131 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                        Write(index == 0 ? "job-history-current" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <div class=\"job-history-heading\" style=\"");


            
            #line 132 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                           Write(String.Format("background-color: {0};", background));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            <span class=\"pull-right\" data-moment-title=\"");


            
            #line 133 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                                    Write(JobHelper.ToTimestamp(entry.CreatedAt));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 134 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                           Write(Html.ToHumanDuration(entry.CreatedAt - (nextEntry < entriesCreationTime.Length ? entriesCreationTime[nextEntry] : job.CreatedAt)));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 135 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                   nextEntry++; 

            
            #line default
            #line hidden
WriteLiteral("                            </span>\r\n                            <h4 class=\"job-h" +
"istory-title\">\r\n                                ");


            
            #line 138 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                           Write(entry.StateName);

            
            #line default
            #line hidden
WriteLiteral("\r\n\r\n");


            
            #line 140 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                 if (!String.IsNullOrWhiteSpace(entry.Reason))
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <small>");


            
            #line 142 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                      Write(entry.Reason);

            
            #line default
            #line hidden
WriteLiteral("</small>\r\n");


            
            #line 143 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </h4>\r\n                        </div>\r\n\r\n");


            
            #line 147 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                         if (JobHistoryRenderer.Exists(entry.StateName))
                        {
                            var rendered = Html.RenderHistory(entry.StateName, entry.Data);
                            if (rendered != null)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <div class=\"job-history-body\">\r\n                 " +
"                   ");


            
            #line 153 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                               Write(rendered);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </div>\r\n");


            
            #line 155 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            }
                        }
                        else
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <div class=\"job-history-body\">\r\n                     " +
"           <dl class=\"dl-horizontal\">\r\n");


            
            #line 161 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                     foreach (var item in entry.Data)
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <dt>");


            
            #line 163 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                       Write(item.Key);

            
            #line default
            #line hidden
WriteLiteral(":</dt>\r\n");



WriteLiteral("                                        <dd>");


            
            #line 164 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                       Write(item.Value);

            
            #line default
            #line hidden
WriteLiteral("</dd>\r\n");


            
            #line 165 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                </dl>\r\n                            </div>\r\n");


            
            #line 168 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </div>\r\n");


            
            #line 170 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

                        index++;
                }
            }
        }

            
            #line default
            #line hidden
WriteLiteral("    </div>\r\n</div>");


        }
コード例 #29
0
        public override void Execute()
        {


WriteLiteral("\r\n");






            
            #line 6 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
  
    Layout = new LayoutPage("Failed Jobs");

    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    var monitor = Storage.GetMonitoringApi();
    var pager = new Pager(from, perPage, monitor.FailedCount());
    var failedJobs = monitor.FailedJobs(pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 21 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">Failed " +
"Jobs</h1>\r\n\r\n");


            
            #line 26 "..\..\Dashboard\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 moment.\r\n            </div>\r\n");


            
            #line 31 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
        }
        else
        {

            
            #line default
            #line hidden
WriteLiteral(@"            <div class=""alert alert-warning"">
                <strong>Failed jobs do not become expired</strong> to allow you to re-queue them without any
                time pressure. You should re-queue or delete them manually, or apply <code>AutomaticRetry(OnAttemptsExceeded = AttemptsExceededAction.Delete)</code>
                attribute to delete them automatically.
            </div>
");


            
            #line 39 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
            

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
"tn-toolbar-top\">\r\n                    <button class=\"js-jobs-list-command btn bt" +
"n-sm btn-primary\"\r\n                            data-url=\"");


            
            #line 43 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                 Write(Url.To("/jobs/failed/requeue"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                            data-loading-text=""Enqueueing...""
                            disabled=""disabled"">
                        <span class=""glyphicon glyphicon-repeat""></span>
                        Requeue jobs
                    </button>

                    <button class=""js-jobs-list-command btn btn-sm btn-default""
                            data-url=""");


            
            #line 51 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                 Write(Url.To("/jobs/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 58 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
               Write(Html.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>Failed</th>
                        <th>Job</th>
                    </tr>
                    </thead>
                    <tbody>
");


            
            #line 73 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                       var index = 0; 

            
            #line default
            #line hidden

            
            #line 74 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                     foreach (var job in failedJobs)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <tr class=\"js-jobs-list-row ");


            
            #line 76 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                Write(!job.Value.InFailedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 76 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                                                                     Write(job.Value.InFailedState ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            <td rowspan=\"");


            
            #line 77 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                     Write(job.Value.InFailedState ? "2" : "1");

            
            #line default
            #line hidden
WriteLiteral("\">\r\n");


            
            #line 78 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                 if (job.Value.InFailedState)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <input type=\"checkbox\" class=\"js-jobs-list-ch" +
"eckbox\" name=\"jobs[]\" value=\"");


            
            #line 80 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                                                                         Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\"/>\r\n");


            
            #line 81 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                            <td class=\"min-wid" +
"th\" rowspan=\"");


            
            #line 83 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                       Write(job.Value.InFailedState ? "2" : "1");

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 84 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                           Write(Html.JobIdLink(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 85 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                 if (!job.Value.InFailedState)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span title=\"Job\'s state has been changed whi" +
"le fetching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 88 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                            <td class=\"min-wid" +
"th\">\r\n");


            
            #line 91 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                 if (job.Value.FailedAt.HasValue)
                                {
                                    
            
            #line default
            #line hidden
            
            #line 93 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                               Write(Html.RelativeTime(job.Value.FailedAt.Value));

            
            #line default
            #line hidden
            
            #line 93 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                                                
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                            <td>\r\n            " +
"                    <div>\r\n                                    ");


            
            #line 98 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                               Write(Html.JobNameLink(job.Key, job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </div>\r\n");


            
            #line 100 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                 if (!String.IsNullOrEmpty(job.Value.ExceptionMessage))
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <div style=\"color: #888;\">\r\n                 " +
"                       ");


            
            #line 103 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                   Write(job.Value.Reason);

            
            #line default
            #line hidden
WriteLiteral(" <a class=\"expander\" href=\"#\">");


            
            #line 103 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                                                   Write(index == 0 ? "Less details..." : "More details...");

            
            #line default
            #line hidden
WriteLiteral("</a>\r\n                                    </div>\r\n");


            
            #line 105 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                        </tr>\r\n");


            
            #line 108 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        if (job.Value.InFailedState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <tr>\r\n                                <td colspan=\"2\"" +
" class=\"failed-job-details\">\r\n                                    <div class=\"ex" +
"pandable\" style=\"");


            
            #line 112 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                               Write(index++ == 0 ? "display: block;" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                        <h4>");


            
            #line 113 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                       Write(job.Value.ExceptionType);

            
            #line default
            #line hidden
WriteLiteral("</h4>\r\n                                        <p>\r\n                             " +
"               ");


            
            #line 115 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                       Write(job.Value.ExceptionMessage);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                        </p>\r\n\r\n");


            
            #line 118 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                         if (!String.IsNullOrEmpty(job.Value.ExceptionDetails))
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <pre class=\"stack-trace\"><code>");


            
            #line 120 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                                                      Write(Html.StackTrace(job.Value.ExceptionDetails));

            
            #line default
            #line hidden
WriteLiteral("</code></pre>\r\n");


            
            #line 121 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                    </div>\r\n                                </td>" +
"\r\n                            </tr>\r\n");


            
            #line 125 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        }
                    }

            
            #line default
            #line hidden
WriteLiteral("                    </tbody>\r\n                </table>\r\n\r\n                ");


            
            #line 130 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
           Write(Html.Paginator(pager));

            
            #line default
            #line hidden
WriteLiteral("\r\n            </div>\r\n");


            
            #line 132 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </div>\r\n</div>");


        }
コード例 #30
0
        public override void Execute()
        {


WriteLiteral("\r\n");










            
            #line 10 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
  
    Layout = new LayoutPage(Strings.AwaitingJobsPage_Title);

    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    List<string> jobIds = null;
    Pager pager = null;

    using (var connection = Storage.GetConnection())
    {
        var storageConnection = connection as JobStorageConnection;

        if (storageConnection != null)
        {
            pager = new Pager(from, perPage, storageConnection.GetSetCount("awaiting"));
            jobIds = storageConnection.GetRangeFromSet("awaiting", pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1);
        }
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 35 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");


            
            #line 38 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                           Write(Strings.AwaitingJobsPage_Title);

            
            #line default
            #line hidden
WriteLiteral("</h1>\r\n\r\n");


            
            #line 40 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
         if (jobIds == null)
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-warning\">\r\n                <h4>");


            
            #line 43 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
               Write(Strings.AwaitingJobsPage_ContinuationsWarning_Title);

            
            #line default
            #line hidden
WriteLiteral("</h4>\r\n                <p>");


            
            #line 44 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
              Write(Strings.AwaitingJobsPage_ContinuationsWarning_Text);

            
            #line default
            #line hidden
WriteLiteral("</p>\r\n            </div>\r\n");


            
            #line 46 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
        }
        else if (jobIds.Count > 0)
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
"tn-toolbar-top\">\r\n                    <button class=\"js-jobs-list-command btn bt" +
"n-sm btn-primary\"\r\n                            data-url=\"");


            
            #line 52 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                 Write(Url.To("/jobs/awaiting/enqueue"));

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            data-loading-text=\"");


            
            #line 53 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                          Write(Strings.Common_Enqueueing);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <span class=\"glyphicon glyphicon-repeat\"></span>\r\n   " +
"                     ");


            
            #line 55 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                   Write(Strings.Common_EnqueueButton_Text);

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </button>\r\n\r\n                    <button class=\"js-jobs-lis" +
"t-command btn btn-sm btn-default\"\r\n                            data-url=\"");


            
            #line 59 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                 Write(Url.To("/jobs/awaiting/delete"));

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            data-loading-text=\"");


            
            #line 60 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                          Write(Strings.Common_Deleting);

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            data-confirm=\"");


            
            #line 61 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                     Write(Strings.Common_DeleteConfirm);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <span class=\"glyphicon glyphicon-remove\"></span>\r\n   " +
"                     ");


            
            #line 63 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                   Write(Strings.Common_DeleteSelected);

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </button>\r\n\r\n                    ");


            
            #line 66 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
               Write(Html.PerPageSelector(pager));

            
            #line default
            #line hidden
WriteLiteral(@"
                </div>

                <div class=""table-responsive"">
                    <table class=""table table-hover"">
                        <thead>
                            <tr>
                                <th class=""min-width"">
                                    <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                </th>
                                <th class=""min-width"">");


            
            #line 76 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                 Write(Strings.Common_Id);

            
            #line default
            #line hidden
WriteLiteral("</th>\r\n                                <th>");


            
            #line 77 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                               Write(Strings.Common_Job);

            
            #line default
            #line hidden
WriteLiteral("</th>\r\n                                <th class=\"min-width\">");


            
            #line 78 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                 Write(Strings.AwaitingJobsPage_Table_Options);

            
            #line default
            #line hidden
WriteLiteral("</th>\r\n                                <th class=\"min-width\">");


            
            #line 79 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                 Write(Strings.AwaitingJobsPage_Table_Parent);

            
            #line default
            #line hidden
WriteLiteral("</th>\r\n                                <th class=\"align-right\">");


            
            #line 80 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                   Write(Strings.Common_Created);

            
            #line default
            #line hidden
WriteLiteral("</th>\r\n                            </tr>\r\n                        </thead>\r\n     " +
"                   <tbody>\r\n");


            
            #line 84 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                             foreach (var jobId in jobIds)
                            {
                                JobData jobData;
                                StateData stateData;
                                StateData parentStateData = null;

                                using (var connection = Storage.GetConnection())
                                {
                                    jobData = connection.GetJobData(jobId);
                                    stateData = connection.GetStateData(jobId);

                                    if (stateData != null && stateData.Name == AwaitingState.StateName)
                                    {
                                        parentStateData = connection.GetStateData(stateData.Data["ParentId"]);
                                    }
                                }


            
            #line default
            #line hidden
WriteLiteral("                                <tr class=\"js-jobs-list-row ");


            
            #line 101 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                        Write(jobData != null ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    <td>\r\n                                   " +
"     <input type=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\"");


            
            #line 103 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                                                                             Write(jobId);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n                                    </td>\r\n                                " +
"    <td class=\"min-width\">\r\n                                        ");


            
            #line 106 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                   Write(Html.JobIdLink(jobId));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                    </td>\r\n");


            
            #line 108 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                     if (jobData == null)
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <td colspan=\"2\"><em>");


            
            #line 110 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                       Write(Strings.Common_JobExpired);

            
            #line default
            #line hidden
WriteLiteral("</em></td>\r\n");


            
            #line 111 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                    }
                                    else
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <td class=\"word-break\">\r\n                " +
"                            ");


            
            #line 115 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                       Write(Html.JobNameLink(jobId, jobData.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                        </td>\r\n");



WriteLiteral("                                        <td class=\"min-width\">\r\n");


            
            #line 118 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                             if (stateData != null && stateData.Data.ContainsKey("Options") && !String.IsNullOrWhiteSpace(stateData.Data["Options"]))
                                            {

            
            #line default
            #line hidden
WriteLiteral("                                                <code>");


            
            #line 120 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                 Write(stateData.Data["Options"]);

            
            #line default
            #line hidden
WriteLiteral("</code>\r\n");


            
            #line 121 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                            }
                                            else
                                            {

            
            #line default
            #line hidden
WriteLiteral("                                                <em>");


            
            #line 124 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                               Write(Strings.Common_NotAvailable);

            
            #line default
            #line hidden
WriteLiteral("</em>\r\n");


            
            #line 125 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                            }

            
            #line default
            #line hidden
WriteLiteral("                                        </td>\r\n");



WriteLiteral("                                        <td class=\"min-width\">\r\n");


            
            #line 128 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                             if (parentStateData != null)
                                            {

            
            #line default
            #line hidden
WriteLiteral("                                                <a href=\"");


            
            #line 130 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                    Write(Url.JobDetails(stateData.Data["ParentId"]));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                                    <span class=\"label label-" +
"default label-hover\" style=\"");


            
            #line 131 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                                                                     Write($"background-color: {JobHistoryRenderer.GetForegroundStateColor(parentStateData.Name)};");

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                                        ");


            
            #line 132 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                                   Write(parentStateData.Name);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                                    </span>\r\n                  " +
"                              </a>\r\n");


            
            #line 135 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                            }
                                            else
                                            {

            
            #line default
            #line hidden
WriteLiteral("                                                <em>");


            
            #line 138 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                               Write(Strings.Common_NotAvailable);

            
            #line default
            #line hidden
WriteLiteral("</em>\r\n");


            
            #line 139 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                            }

            
            #line default
            #line hidden
WriteLiteral("                                        </td>\r\n");



WriteLiteral("                                        <td class=\"min-width align-right\">\r\n     " +
"                                       ");


            
            #line 142 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                       Write(Html.RelativeTime(jobData.CreatedAt));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                        </td>\r\n");


            
            #line 144 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                </tr>\r\n");


            
            #line 146 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </tbody>\r\n                    </table>\r\n                <" +
"/div>\r\n                ");


            
            #line 150 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
           Write(Html.Paginator(pager));

            
            #line default
            #line hidden
WriteLiteral("\r\n            </div>\r\n");


            
            #line 152 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
        }
        else
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");


            
            #line 156 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
           Write(Strings.AwaitingJobsPage_NoJobs);

            
            #line default
            #line hidden
WriteLiteral("\r\n            </div>\r\n");


            
            #line 158 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </div>\r\n</div>\r\n");


        }
コード例 #31
0
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Scheduled Jobs" };

    int from, perPage;

    int.TryParse(Request.Query["from"], out from);
    int.TryParse(Request.Query["count"], out perPage);

    var monitor = Storage.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("\r\n");


            
            #line 24 "..\..\Dashboard\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 29 "..\..\Dashboard\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 35 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
             foreach (var job in scheduledJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr class=\"js-jobs-list-row ");


            
            #line 66 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                        Write(!job.Value.InScheduledState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 66 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                                                                                Write(job.Value.InScheduledState ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <td>\r\n");


            
            #line 68 "..\..\Dashboard\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 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                                                                                 Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n");


            
            #line 71 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td class=\"min-width\">\r\n          " +
"              <a href=\"");


            
            #line 74 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 75 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                       Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n");


            
            #line 77 "..\..\Dashboard\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 80 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td class=\"min-width\">\r\n          " +
"              <span data-moment=\"");


            
            #line 83 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                      Write(JobHelper.ToTimestamp(job.Value.EnqueueAt));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 84 "..\..\Dashboard\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 88 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                               Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 89 "..\..\Dashboard\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 93 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                         if (job.Value.ScheduledAt != null)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 95 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                          Write(JobHelper.ToTimestamp(job.Value.ScheduledAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 96 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                           Write(job.Value.ScheduledAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </span>\r\n");


            
            #line 98 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 101 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </table>\r\n    </div>\r\n");


            
            #line 104 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"

    
            
            #line default
            #line hidden
            
            #line 105 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 105 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
コード例 #32
0
        public override void Execute()
        {


WriteLiteral("\r\n");









            
            #line 9 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
  
    Layout = new LayoutPage(Strings.RecurringJobsPage_Title);
	List<RecurringJobDto> recurringJobs;
    
    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    Pager pager = null;

	using (var connection = Storage.GetConnection())
	{
	    var storageConnection = connection as JobStorageConnection;
	    if (storageConnection != null)
	    {
	        pager = new Pager(from, perPage, storageConnection.GetRecurringJobCount());
	        recurringJobs = storageConnection.GetRecurringJobs(pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1);
	    }
	    else
	    {
            recurringJobs = connection.GetRecurringJobs();
	    }
	}


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-12\">\r\n        <h1 class=\"page-header\"" +
">");


            
            #line 37 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                           Write(Strings.RecurringJobsPage_Title);

            
            #line default
            #line hidden
WriteLiteral("</h1>\r\n\r\n");


            
            #line 39 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
         if (recurringJobs.Count == 0)
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");


            
            #line 42 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
           Write(Strings.RecurringJobsPage_NoJobs);

            
            #line default
            #line hidden
WriteLiteral("\r\n            </div>\r\n");


            
            #line 44 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
        }
        else
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
"tn-toolbar-top\">\r\n                    <button class=\"js-jobs-list-command btn bt" +
"n-sm btn-primary\"\r\n                            data-url=\"");


            
            #line 50 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                 Write(Url.To("/recurring/trigger"));

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            data-loading-text=\"");


            
            #line 51 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                          Write(Strings.RecurringJobsPage_Triggering);

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
"n class=\"glyphicon glyphicon-play-circle\"></span>\r\n                        ");


            
            #line 54 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                   Write(Strings.RecurringJobsPage_TriggerNow);

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </button>\r\n\r\n                    <button class=\"js-jobs-lis" +
"t-command btn btn-sm btn-default\"\r\n                            data-url=\"");


            
            #line 58 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                 Write(Url.To("/recurring/remove"));

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            data-loading-text=\"");


            
            #line 59 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                          Write(Strings.Common_Deleting);

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            data-confirm=\"");


            
            #line 60 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                     Write(Strings.Common_DeleteConfirm);

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
"n class=\"glyphicon glyphicon-remove\"></span>\r\n                        ");


            
            #line 63 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                   Write(Strings.Common_Delete);

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </button>\r\n\r\n");


            
            #line 66 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                     if (pager != null)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        ");

WriteLiteral(" ");


            
            #line 68 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                      Write(Html.PerPageSelector(pager));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 69 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral(@"                </div>

                <div class=""table-responsive"">
                    <table class=""table"">
                        <thead>
                            <tr>
                                <th class=""min-width"">
                                    <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                </th>
                                <th class=""min-width"">");


            
            #line 79 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                 Write(Strings.Common_Id);

            
            #line default
            #line hidden
WriteLiteral("</th>\r\n                                <th class=\"min-width\">");


            
            #line 80 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                 Write(Strings.RecurringJobsPage_Table_Cron);

            
            #line default
            #line hidden
WriteLiteral("</th>\r\n                                <th class=\"min-width\">");


            
            #line 81 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                 Write(Strings.RecurringJobsPage_Table_TimeZone);

            
            #line default
            #line hidden
WriteLiteral("</th>\r\n                                <th>");


            
            #line 82 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                               Write(Strings.Common_Job);

            
            #line default
            #line hidden
WriteLiteral("</th>\r\n                                <th class=\"align-right min-width\">");


            
            #line 83 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                             Write(Strings.RecurringJobsPage_Table_NextExecution);

            
            #line default
            #line hidden
WriteLiteral("</th>\r\n                                <th class=\"align-right min-width\">");


            
            #line 84 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                             Write(Strings.RecurringJobsPage_Table_LastExecution);

            
            #line default
            #line hidden
WriteLiteral("</th>\r\n                                <th class=\"align-right min-width\">");


            
            #line 85 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                             Write(Strings.Common_Created);

            
            #line default
            #line hidden
WriteLiteral("</th>\r\n                            </tr>\r\n                        </thead>\r\n     " +
"                   <tbody>\r\n");


            
            #line 89 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                             foreach (var job in recurringJobs)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <tr class=\"js-jobs-list-row hover\">\r\n            " +
"                        <td>\r\n                                        <input typ" +
"e=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\"");


            
            #line 93 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                                                                             Write(job.Id);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n                                    </td>\r\n                                " +
"    <td class=\"min-width\">");


            
            #line 95 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                     Write(job.Id);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                                    <td class=\"min-width\">\r\n              " +
"                          ");



WriteLiteral("\r\n");


            
            #line 98 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                          
                                            string cronDescription = null;
#if NETFULL
                                            try
                                            {
                                                cronDescription = CronExpressionDescriptor.ExpressionDescriptor.GetDescription(job.Cron);
                                            }
                                            catch (FormatException)
                                            {
                                            }
#endif
                                        

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 111 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                         if (cronDescription != null)
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <code title=\"");


            
            #line 113 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                    Write(cronDescription);

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 113 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                                      Write(job.Cron);

            
            #line default
            #line hidden
WriteLiteral("</code>\r\n");


            
            #line 114 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                        }
                                        else
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <code>");


            
            #line 117 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                             Write(job.Cron);

            
            #line default
            #line hidden
WriteLiteral("</code>\r\n");


            
            #line 118 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                    </td>\r\n                                    <t" +
"d class=\"min-width\">\r\n");


            
            #line 121 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                         if (!String.IsNullOrWhiteSpace(job.TimeZoneId))
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <span title=\"");


            
            #line 123 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                    Write(TimeZoneInfo.FindSystemTimeZoneById(job.TimeZoneId).DisplayName);

            
            #line default
            #line hidden
WriteLiteral("\" data-container=\"body\">");


            
            #line 123 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                                                                                                            Write(job.TimeZoneId);

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");


            
            #line 124 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                        }
                                        else
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            ");

WriteLiteral(" UTC\r\n");


            
            #line 128 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                    </td>\r\n                                    <t" +
"d class=\"word-break\">\r\n");


            
            #line 131 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                         if (job.Job != null)
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            ");

WriteLiteral(" ");


            
            #line 133 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                          Write(Html.JobName(job.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 134 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                        }
                                        else
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <em>");


            
            #line 137 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                           Write(job.LoadException.InnerException.Message);

            
            #line default
            #line hidden
WriteLiteral("</em>\r\n");


            
            #line 138 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                    </td>\r\n                                    <t" +
"d class=\"align-right min-width\">\r\n");


            
            #line 141 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                         if (job.NextExecution != null)
                                        {
                                            
            
            #line default
            #line hidden
            
            #line 143 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                       Write(Html.RelativeTime(job.NextExecution.Value));

            
            #line default
            #line hidden
            
            #line 143 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                                                       
                                        }
                                        else
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <em>");


            
            #line 147 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                           Write(Strings.Common_NotAvailable);

            
            #line default
            #line hidden
WriteLiteral("</em>\r\n");


            
            #line 148 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                    </td>\r\n                                    <t" +
"d class=\"align-right min-width\">\r\n");


            
            #line 151 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                         if (job.LastExecution != null)
                                        {
                                            if (!String.IsNullOrEmpty(job.LastJobId))
                                            {

            
            #line default
            #line hidden
WriteLiteral("                                                <a href=\"");


            
            #line 155 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                    Write(Url.JobDetails(job.LastJobId));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                                    <span class=\"label label-" +
"default label-hover\" style=\"");


            
            #line 156 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                                                                     Write($"background-color: {JobHistoryRenderer.GetForegroundStateColor(job.LastJobState)};");

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                                        ");


            
            #line 157 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                   Write(Html.RelativeTime(job.LastExecution.Value));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                                    </span>\r\n                  " +
"                              </a>\r\n");


            
            #line 160 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                            }
                                            else
                                            {

            
            #line default
            #line hidden
WriteLiteral("                                                <em>\r\n                           " +
"                         ");


            
            #line 164 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                               Write(Strings.RecurringJobsPage_Canceled);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 164 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                                                   Write(Html.RelativeTime(job.LastExecution.Value));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                                </em>\r\n");


            
            #line 166 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                            }
                                        }
                                        else
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <em>");


            
            #line 170 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                           Write(Strings.Common_NotAvailable);

            
            #line default
            #line hidden
WriteLiteral("</em>\r\n");


            
            #line 171 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                    </td>\r\n                                    <t" +
"d class=\"align-right min-width\">\r\n");


            
            #line 174 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                         if (job.CreatedAt != null)
                                        {
                                            
            
            #line default
            #line hidden
            
            #line 176 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                       Write(Html.RelativeTime(job.CreatedAt.Value));

            
            #line default
            #line hidden
            
            #line 176 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                                                   
                                        }
                                        else
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <em>N/A</em>\r\n");


            
            #line 181 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                    </td>\r\n                                </tr>\r" +
"\n");


            
            #line 184 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                             }

            
            #line default
            #line hidden
WriteLiteral("                        </tbody>\r\n                    </table>\r\n                <" +
"/div>\r\n\r\n");


            
            #line 189 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                 if (pager != null)
                {

            
            #line default
            #line hidden
WriteLiteral("                    ");

WriteLiteral(" ");


            
            #line 191 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                  Write(Html.Paginator(pager));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 192 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </div>\r\n");


            
            #line 194 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </div>\r\n</div>    ");


        }
コード例 #33
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 8 "..\..\Dashboard\Pages\SucceededJobs.cshtml"

            Layout = new LayoutPage(Strings.SucceededJobsPage_Title);

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            var monitor       = Storage.GetMonitoringApi();
            var pager         = new Pager(from, perPage, monitor.SucceededListCount());
            var succeededJobs = monitor.SucceededJobs(pager.FromRecord, pager.RecordsPerPage);



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 23 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");



            #line 26 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
            Write(Strings.SucceededJobsPage_Title);


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n");



            #line 28 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");



            #line 31 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                Write(Strings.SucceededJobsPage_NoJobs);


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 33 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
                             "tn-toolbar-top\">\r\n");



            #line 38 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                if (!IsReadOnly)
                {
            #line default
            #line hidden
                    WriteLiteral("                        <button class=\"js-jobs-list-command btn btn-sm btn-primar" +
                                 "y\"\r\n                                data-url=\"");



            #line 41 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    Write(Url.To("/jobs/succeeded/requeue"));


            #line default
            #line hidden
                    WriteLiteral("\"\r\n                                data-loading-text=\"");



            #line 42 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    Write(Strings.Common_Enqueueing);


            #line default
            #line hidden
                    WriteLiteral("\"\r\n                                disabled=\"disabled\">\r\n                        " +
                                 "    <span class=\"glyphicon glyphicon-repeat\"></span>\r\n                          " +
                                 "  ");



            #line 45 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    Write(Strings.Common_RequeueJobs);


            #line default
            #line hidden
                    WriteLiteral("\r\n                        </button>\r\n");



            #line 47 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                    ");



            #line 48 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                Write(Html.PerPageSelector(pager));


            #line default
            #line hidden
                WriteLiteral("\r\n                </div>\r\n\r\n                <div class=\"table-responsive\">\r\n     " +
                             "               <table class=\"table\">\r\n                        <thead>\r\n         " +
                             "                   <tr>\r\n");



            #line 55 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                if (!IsReadOnly)
                {
            #line default
            #line hidden
                    WriteLiteral("                                    <th class=\"min-width\">\r\n                     " +
                                 "                   <input type=\"checkbox\" class=\"js-jobs-list-select-all\"/>\r\n   " +
                                 "                                 </th>\r\n");



            #line 60 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                                <th class=\"min-width\">");



            #line 61 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                Write(Strings.Common_Id);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th>");



            #line 62 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                Write(Strings.Common_Job);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"min-width\">");



            #line 63 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                Write(Strings.SucceededJobsPage_Table_TotalDuration);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"align-right\">");



            #line 64 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                Write(Strings.SucceededJobsPage_Table_Succeeded);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            </tr>\r\n                        </thead>\r\n     " +
                             "                   <tbody>\r\n");



            #line 68 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                foreach (var job in succeededJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                                <tr class=\"js-jobs-list-row ");



            #line 70 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    Write(job.Value == null || !job.Value.InSucceededState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral(" ");



            #line 70 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    Write(job.Value != null && job.Value.InSucceededState ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n");



            #line 71 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    if (!IsReadOnly)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td>\r\n");



            #line 74 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        if (job.Value == null || job.Value.InSucceededState)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <input type=\"checkbox\" class=\"js-" +
                                         "jobs-list-checkbox\" name=\"jobs[]\" value=\"");



            #line 76 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                            Write(job.Key);


            #line default
            #line hidden
                            WriteLiteral("\"/>\r\n");



            #line 77 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                        </td>\r\n");



            #line 79 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    <td class=\"min-width\">\r\n                     " +
                                 "                   ");



            #line 81 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    Write(Html.JobIdLink(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n");



            #line 82 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    if (job.Value != null && !job.Value.InSucceededState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <span title=\"");



            #line 84 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        Write(Strings.Common_JobStateChanged_Text);


            #line default
            #line hidden
                        WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");



            #line 85 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n\r\n");



            #line 88 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    if (job.Value == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td colspan=\"3\">\r\n                       " +
                                     "                     <em>");



            #line 91 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        Write(Strings.Common_JobExpired);


            #line default
            #line hidden
                        WriteLiteral("</em>\r\n                                        </td>\r\n");



            #line 93 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td class=\"word-break\">\r\n                " +
                                     "                            ");



            #line 97 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        Write(Html.JobNameLink(job.Key, job.Value.Job));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                        </td>\r\n");



                        WriteLiteral("                                        <td class=\"min-width align-right\">\r\n");



            #line 100 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        if (job.Value.TotalDuration.HasValue)
                        {
            #line default
            #line hidden

            #line 102 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                            Write(Html.ToHumanDuration(TimeSpan.FromMilliseconds(job.Value.TotalDuration.Value), false));


            #line default
            #line hidden

            #line 102 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                        </td>\r\n");



                        WriteLiteral("                                        <td class=\"min-width align-right\">\r\n");



            #line 106 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        if (job.Value.SucceededAt.HasValue)
                        {
            #line default
            #line hidden

            #line 108 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                            Write(Html.RelativeTime(job.Value.SucceededAt.Value));


            #line default
            #line hidden

            #line 108 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                        </td>\r\n");



            #line 111 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                </tr>\r\n");



            #line 113 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                        </tbody>\r\n                    </table>\r\n                <" +
                             "/div>\r\n\r\n                ");



            #line 118 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                Write(Html.Paginator(pager));


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 120 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #34
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 9 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"

            Layout = new LayoutPage("Awaiting Jobs");

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            List <string> jobIds = null;
            Pager         pager  = null;

            using (var connection = Storage.GetConnection())
            {
                var storageConnection = connection as JobStorageConnection;

                if (storageConnection != null)
                {
                    pager  = new Pager(from, perPage, storageConnection.GetSetCount("awaiting"));
                    jobIds = storageConnection.GetRangeFromSet("awaiting", pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1);
                }
            }



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 34 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">Awaitin" +
                         "g Jobs</h1>\r\n\r\n");



            #line 39 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
            if (jobIds == null)
            {
            #line default
            #line hidden
                WriteLiteral(@"            <div class=""alert alert-warning"">
                <h4>Continuations are working, but this page can't be displayed</h4>
                <p>
                    Don't worry, continuations are working as expected. But your current job storage does not
                    support some queries required to show this page. Please try to update your storage or wait
                    until the full command set is implemented.
                </p>
            </div>
");



            #line 49 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
            }
            else if (jobIds.Count > 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
                             "tn-toolbar-top\">\r\n                    <button class=\"js-jobs-list-command btn bt" +
                             "n-sm btn-primary\"\r\n                            data-url=\"");



            #line 55 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Url.To("/jobs/awaiting/enqueue"));


            #line default
            #line hidden
                WriteLiteral(@"""
                            data-loading-text=""Enqueueing..."">
                        <span class=""glyphicon glyphicon-repeat""></span>
                        Enqueue jobs
                    </button>

                    <button class=""js-jobs-list-command btn btn-sm btn-default""
                            data-url=""");



            #line 62 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Url.To("/jobs/awaiting/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 69 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Html.PerPageSelector(pager));


            #line default
            #line hidden
                WriteLiteral(@"
                </div>

                <table class=""table table-hover"">
                    <thead>
                        <tr>
                            <th class=""min-width"">
                                <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                            </th>
                            <th class=""min-width"">Id</th>
                            <th>Job</th>
                            <th class=""min-width"">Options</th>
                            <th class=""min-width"">Parent</th>
                            <th class=""align-right"">Created</th>
                        </tr>
                    </thead>
                    <tbody>
");



            #line 86 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                foreach (var jobId in jobIds)
                {
                    JobData   jobData;
                    StateData stateData;
                    StateData parentStateData = null;

                    using (var connection = Storage.GetConnection())
                    {
                        jobData   = connection.GetJobData(jobId);
                        stateData = connection.GetStateData(jobId);

                        if (stateData != null && stateData.Name == AwaitingState.StateName)
                        {
                            parentStateData = connection.GetStateData(stateData.Data["ParentId"]);
                        }
                    }



            #line default
            #line hidden
                    WriteLiteral("                            <tr class=\"js-jobs-list-row ");



            #line 103 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                    Write(jobData != null ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                <td>\r\n                                    <in" +
                                 "put type=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\"");



            #line 105 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                    Write(jobId);


            #line default
            #line hidden
                    WriteLiteral("\" />\r\n                                </td>\r\n                                <td " +
                                 "class=\"min-width\">\r\n                                    ");



            #line 108 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                    Write(Html.JobIdLink(jobId));


            #line default
            #line hidden
                    WriteLiteral("\r\n                                </td>\r\n");



            #line 110 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                    if (jobData == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <td colspan=\"2\"><em>Job expired.</em></td>\r\n");



            #line 113 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <td>\r\n                                       " +
                                     " ");



            #line 117 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        Write(Html.JobNameLink(jobId, jobData.Job));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                    </td>\r\n");



                        WriteLiteral("                                    <td class=\"min-width\">\r\n");



            #line 120 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        if (stateData != null && stateData.Data.ContainsKey("Options") && !String.IsNullOrWhiteSpace(stateData.Data["Options"]))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                            <code>");



            #line 122 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                            Write(stateData.Data["Options"]);


            #line default
            #line hidden
                            WriteLiteral("</code>\r\n");



            #line 123 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                            <em>N/A</em>\r\n");



            #line 127 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                    </td>\r\n");



                        WriteLiteral("                                    <td class=\"min-width\">\r\n");



            #line 130 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        if (parentStateData != null)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                            <a href=\"");



            #line 132 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                            Write(Url.JobDetails(stateData.Data["ParentId"]));


            #line default
            #line hidden
                            WriteLiteral("\">\r\n                                                <span class=\"label label-defa" +
                                         "ult label-hover\" style=\"");



            #line 133 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                            Write(String.Format("background-color: {0};", JobHistoryRenderer.GetForegroundStateColor(parentStateData.Name)));


            #line default
            #line hidden
                            WriteLiteral("\">\r\n                                                    ");



            #line 134 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                            Write(parentStateData.Name);


            #line default
            #line hidden
                            WriteLiteral("\r\n                                                </span>\r\n                      " +
                                         "                      </a>\r\n");



            #line 137 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                            <em>N/A</em>\r\n");



            #line 141 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                    </td>\r\n");



                        WriteLiteral("                                    <td class=\"min-width align-right\">\r\n         " +
                                     "                               ");



            #line 144 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        Write(Html.RelativeTime(jobData.CreatedAt));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                    </td>\r\n");



            #line 146 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                            </tr>\r\n");



            #line 148 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                    </tbody>\r\n                </table>\r\n                ");



            #line 151 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Html.Paginator(pager));


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 153 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-info\">\r\n                No jobs found in awai" +
                             "ting state.\r\n            </div>\r\n");



            #line 159 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>\r\n");
        }
コード例 #35
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 8 "..\..\Dashboard\Pages\CornJobsPage.cshtml"

            Layout = new LayoutPage("Corn表达式在线生成");



            #line default
            #line hidden
            WriteLiteral(@"
<style>
    body {
        width: 50%;
        margin: 0 auto;
        padding-bottom: 20px;
    }

    input[type=number] {
        height: 25px;
        width: 52px;
    }

    .search-field input[type=text] {
        width: 152px !important;
    }
</style>
<div>
    <div style=""text-align: center;"">
        <h3>Corn表达式在线生成</h3>
        <br>
    </div>
    <div>
        <!-- Nav tabs -->
        <ul class=""nav nav-tabs"" role=""tablist"">
            ");



            WriteLiteral(@"
            <li role=""presentation"">
                <a href=""#minute"" aria-controls=""minute"" role=""tab"" data-toggle=""tab"">分钟</a>
            </li>
            <li role=""presentation"">
                <a href=""#hour"" aria-controls=""hour"" role=""tab"" data-toggle=""tab"">小时</a>
            </li>
            <li role=""presentation"">
                <a href=""#day"" aria-controls=""day"" role=""tab"" data-toggle=""tab"">日</a>
            </li>
            <li role=""presentation"">
                <a href=""#month"" aria-controls=""month"" role=""tab"" data-toggle=""tab"">月</a>
            </li>
            <li role=""presentation"">
                <a href=""#week"" aria-controls=""week"" role=""tab"" data-toggle=""tab"">周</a>
            </li>
            ");



            WriteLiteral("\r\n        </ul>\r\n\r\n        <!-- Tab panes -->\r\n        <div class=\"tab-content\">\r" +
                         "\n\r\n            <!--秒-->\r\n            ");



            WriteLiteral("\r\n\r\n            <!--分钟-->\r\n            <div role=\"tabpanel\" class=\"tab-pane activ" +
                         "e\" id=\"minute\">\r\n                <div class=\"radio\">\r\n                    <label" +
                         ">\r\n                        <input type=\"radio\" name=\"minuteType\" value=\"All\" che" +
                         "cked=\"checked\">\r\n                        每分钟 允许的通配符[, - * /]\r\n                  " +
                         "  </label>\r\n                </div>\r\n                <div class=\"radio\">\r\n       " +
                         "             <label>\r\n                        <input type=\"radio\" name=\"minuteTy" +
                         "pe\" value=\"Cyclic\">\r\n                        周期从\r\n                        <input" +
                         " type=\"number\" id=\"minuteTypeCyclic_1\" value=\"\">\r\n                        -\r\n   " +
                         "                     <input type=\"number\" id=\"minuteTypeCyclic_2\" value=\"\">\r\n   " +
                         "                     分钟\r\n                    </label>\r\n                </div>\r\n\r" +
                         "\n                <div class=\"radio\">\r\n                    <label>\r\n             " +
                         "           <input type=\"radio\" name=\"minuteType\" value=\"Interval\">\r\n            " +
                         "            从\r\n                        <input type=\"number\" id=\"minuteTypeInterv" +
                         "al_1\" value=\"\">\r\n                        分钟开始,每\r\n                        <input " +
                         "type=\"number\" id=\"minuteTypeInterval_2\" value=\"\">\r\n                        分钟执行一" +
                         "次\r\n                    </label>\r\n                </div>\r\n\r\n                <div " +
                         "class=\"radio\">\r\n                    <label>\r\n                        <input type" +
                         "=\"radio\" name=\"minuteType\" value=\"Assigned\">\r\n                        指定\r\n      " +
                         "              </label>\r\n                </div>\r\n                <div style=\"marg" +
                         "in-left: 20px;\">\r\n                    <select id=\"minuteTypeAssigned_1\" data-pla" +
                         "ceholder=\"选择指定的分钟...\"\r\n                            style=\"width:350px;\" multiple" +
                         "></select>\r\n                </div>\r\n            </div>\r\n\r\n            <!--小时-->\r" +
                         "\n            <div role=\"tabpanel\" class=\"tab-pane\" id=\"hour\">\r\n\r\n               " +
                         " <div class=\"radio\">\r\n                    <label>\r\n                        <inpu" +
                         "t type=\"radio\" name=\"hourType\" value=\"All\" checked=\"checked\">\r\n                 " +
                         "       每小时 允许的通配符[, - * /]\r\n                    </label>\r\n                </div>" +
                         "\r\n                <div class=\"radio\">\r\n                    <label>\r\n            " +
                         "            <input type=\"radio\" name=\"hourType\" value=\"Cyclic\">\r\n               " +
                         "         周期从\r\n                        <input type=\"number\" id=\"hourTypeCyclic_1\"" +
                         " value=\"\">\r\n                        -\r\n                        <input type=\"numb" +
                         "er\" id=\"hourTypeCyclic_2\" value=\"\">\r\n                        小时\r\n               " +
                         "     </label>\r\n                </div>\r\n\r\n                <div class=\"radio\">\r\n  " +
                         "                  <label>\r\n                        <input type=\"radio\" name=\"hou" +
                         "rType\" value=\"Interval\">\r\n                        从\r\n                        <in" +
                         "put type=\"number\" id=\"hourTypeInterval_1\" value=\"\">\r\n                        时开始" +
                         ",每\r\n                        <input type=\"number\" id=\"hourTypeInterval_2\" value=\"" +
                         "\">\r\n                        小时执行一次\r\n                    </label>\r\n              " +
                         "  </div>\r\n\r\n                <div class=\"radio\">\r\n                    <label>\r\n  " +
                         "                      <input type=\"radio\" name=\"hourType\" value=\"Assigned\">\r\n   " +
                         "                     指定\r\n                    </label>\r\n                </div>\r\n " +
                         "               <div style=\"margin-left: 20px;\">\r\n                    <select id=" +
                         "\"hourTypeAssigned_1\" data-placeholder=\"选择指定的小时...\"\r\n                            " +
                         "style=\"width:350px;\" multiple></select>\r\n                </div>\r\n\r\n            <" +
                         "/div>\r\n\r\n\r\n            <!--日-->\r\n            <div role=\"tabpanel\" class=\"tab-pan" +
                         "e\" id=\"day\">\r\n\r\n                <div class=\"radio\">\r\n                    <label>" +
                         "\r\n                        <input type=\"radio\" name=\"dayType\" value=\"All\" checked" +
                         "=\"checked\">\r\n                        每日 允许的通配符[, - * / L W]\r\n                   " +
                         " </label>\r\n                </div>\r\n                <div class=\"radio\">\r\n        " +
                         "            <label>\r\n                        <input type=\"radio\" name=\"dayType\" " +
                         "value=\"Cyclic\">\r\n                        周期从\r\n                        <input typ" +
                         "e=\"number\" id=\"dayTypeCyclic_1\" value=\"\">\r\n                        -\r\n          " +
                         "              <input type=\"number\" id=\"dayTypeCyclic_2\" value=\"\">\r\n             " +
                         "           日\r\n                    </label>\r\n                </div>\r\n\r\n          " +
                         "      <div class=\"radio\">\r\n                    <label>\r\n                        " +
                         "<input type=\"radio\" name=\"dayType\" value=\"Interval\">\r\n                        从\r" +
                         "\n                        <input type=\"number\" id=\"dayTypeInterval_1\" value=\"\">\r\n" +
                         "                        日开始,每\r\n                        <input type=\"number\" id=\"" +
                         "dayTypeInterval_2\" value=\"\">\r\n                        日执行一次\r\n                   " +
                         " </label>\r\n                </div>\r\n\r\n                <div class=\"radio\">\r\n      " +
                         "              <label>\r\n                        <input type=\"radio\" name=\"dayType" +
                         "\" value=\"Assigned\">\r\n                        指定\r\n                    </label>\r\n " +
                         "               </div>\r\n                <div style=\"margin-left: 20px;\">\r\n       " +
                         "             <select id=\"dayTypeAssigned_1\" data-placeholder=\"选择指定的日...\"\r\n      " +
                         "                      style=\"width:350px;\" multiple></select>\r\n                <" +
                         "/div>\r\n\r\n                ");



            WriteLiteral("\r\n            </div>\r\n\r\n\r\n            <!--月-->\r\n            <div role=\"tabpanel\" " +
                         "class=\"tab-pane\" id=\"month\">\r\n                <div class=\"radio\">\r\n             " +
                         "       <label>\r\n                        <input type=\"radio\" name=\"monthType\" val" +
                         "ue=\"All\" checked=\"checked\">\r\n                        每月 允许的通配符[, - * /]\r\n       " +
                         "             </label>\r\n                </div>\r\n                <div class=\"radio" +
                         "\">\r\n                    <label>\r\n                        <input type=\"radio\" nam" +
                         "e=\"monthType\" value=\"Cyclic\">\r\n                        周期从\r\n                    " +
                         "    <input type=\"number\" id=\"monthTypeCyclic_1\" value=\"\">\r\n                     " +
                         "   -\r\n                        <input type=\"number\" id=\"monthTypeCyclic_2\" value=" +
                         "\"\">\r\n                        月\r\n                    </label>\r\n                </" +
                         "div>\r\n\r\n                <div class=\"radio\">\r\n                    <label>\r\n      " +
                         "                  <input type=\"radio\" name=\"monthType\" value=\"Interval\">\r\n      " +
                         "                  从\r\n                        <input type=\"number\" id=\"monthTypeI" +
                         "nterval_1\" value=\"\">\r\n                        月开始,每\r\n                        <in" +
                         "put type=\"number\" id=\"monthTypeInterval_2\" value=\"\">\r\n                        月执" +
                         "行一次\r\n                    </label>\r\n                </div>\r\n\r\n                <di" +
                         "v class=\"radio\">\r\n                    <label>\r\n                        <input ty" +
                         "pe=\"radio\" name=\"monthType\" value=\"Assigned\">\r\n                        指定\r\n     " +
                         "               </label>\r\n                </div>\r\n                <div style=\"mar" +
                         "gin-left: 20px;\">\r\n                    <select id=\"monthTypeAssigned_1\" data-pla" +
                         "ceholder=\"选择指定的月...\"\r\n                            style=\"width:350px;\" multiple>" +
                         "</select>\r\n                </div>\r\n\r\n                ");



            WriteLiteral("\r\n            </div>\r\n\r\n\r\n            <!--周-->\r\n            <div role=\"tabpanel\" " +
                         "class=\"tab-pane\" id=\"week\">\r\n                <div class=\"radio\">\r\n              " +
                         "      <label>\r\n                        <input type=\"radio\" name=\"weekType\" value" +
                         "=\"All\" checked=\"checked\">\r\n                        每周 允许的通配符[, - * / L #]\r\n     " +
                         "               </label>\r\n                </div>\r\n                <div class=\"rad" +
                         "io\">\r\n                    <label>\r\n                        <input type=\"radio\" n" +
                         "ame=\"weekType\" value=\"Cyclic\">\r\n                        周期从\r\n                   " +
                         "     <input type=\"number\" id=\"weekTypeCyclic_1\" value=\"\">\r\n                     " +
                         "   -\r\n                        <input type=\"number\" id=\"weekTypeCyclic_2\" value=\"" +
                         "\">\r\n                        周\r\n                    </label>\r\n                </d" +
                         "iv>\r\n\r\n                <div class=\"radio\">\r\n                    <label>\r\n       " +
                         "                 <input type=\"radio\" name=\"weekType\" value=\"WeeksOfWeek\">\r\n     " +
                         "                   第\r\n                        <input type=\"number\" id=\"weekTypeW" +
                         "eeksOfWeek_1\" value=\"\">\r\n                        周 的星期\r\n                        " +
                         "<input type=\"number\" id=\"weekTypeWeeksOfWeek_2\" value=\"\">\r\n\r\n                   " +
                         " </label>\r\n                </div>\r\n\r\n                <div class=\"radio\">\r\n      " +
                         "              <label>\r\n                        <input type=\"radio\" name=\"weekTyp" +
                         "e\" value=\"Assigned\">\r\n                        指定\r\n                    </label>\r\n" +
                         "                </div>\r\n                <div style=\"margin-left: 20px;\">\r\n      " +
                         "              <select id=\"weekTypeAssigned_1\" data-placeholder=\"选择指定的周...\"\r\n    " +
                         "                        style=\"width:350px;\" multiple></select>\r\n               " +
                         " </div>\r\n\r\n                ");



            WriteLiteral("\r\n            </div>\r\n\r\n\r\n            <!--年-->\r\n            ");



            WriteLiteral(@"

        </div>
    </div>
    <hr>

    <div class=""panel panel-info"">
        <div class=""panel-heading"">
            <h3 class=""panel-title"">结果</h3>
        </div>

        <div class=""panel-body"">

            <form class=""form-inline"">
                <!--<div class=""form-group"">
                    <label class=""sr-only"">结果</label>
                    <p class=""form-control-static"">结果</p>
                </div>-->
                <div class=""form-group"">
                    <label for=""result"" class=""sr-only"">Password</label>
                    <input type=""text"" class=""form-control"" style=""width: 500px;"" id=""result"" placeholder=""结果"">
                </div>
                <button type=""button"" id=""analysis"" class=""btn btn-default"">反解析</button>
            </form>
        </div>
    </div>
</div>");
        }
コード例 #36
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 9 "..\..\Dashboard\Pages\ServersPage.cshtml"

            Layout = new LayoutPage(Strings.ServersPage_Title);

            var monitor = Storage.GetMonitoringApi();
            var servers = monitor.Servers();
            var now     = DateTime.UtcNow;
            var inconclusiveThreshold    = TimeSpan.FromMinutes(1);
            var possiblyAbortedThreshold = TimeSpan.FromMinutes(5);



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-12\">\r\n        <h1 class=\"page-header\"" +
                         ">");



            #line 21 "..\..\Dashboard\Pages\ServersPage.cshtml"
            Write(Strings.ServersPage_Title);


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n");



            #line 23 "..\..\Dashboard\Pages\ServersPage.cshtml"
            if (servers.Count == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-warning\">\r\n                ");



            #line 26 "..\..\Dashboard\Pages\ServersPage.cshtml"
                Write(Strings.ServersPage_NoServers);


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 28 "..\..\Dashboard\Pages\ServersPage.cshtml"
            }
            else
            {
                if (servers.Any(x => x.Heartbeat.HasValue && x.Heartbeat.Value < now.Add(-inconclusiveThreshold)))
                {
            #line default
            #line hidden
                    WriteLiteral("                <div class=\"alert alert-info\">\r\n                    <h4>");



            #line 34 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(Strings.ServersPage_Note_Title);


            #line default
            #line hidden
                    WriteLiteral("</h4>\r\n                    ");



            #line 35 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(Html.Raw(string.Format(Strings.ServersPage_Note_Text, Url.To("/jobs/processing"))));


            #line default
            #line hidden
                    WriteLiteral("\r\n                </div>\r\n");



            #line 37 "..\..\Dashboard\Pages\ServersPage.cshtml"
                }



            #line default
            #line hidden
                WriteLiteral("            <div class=\"table-responsive\">\r\n                <table class=\"table\">" +
                             "\r\n                    <thead>\r\n                        <tr>\r\n                   " +
                             "         <th>");



            #line 43 "..\..\Dashboard\Pages\ServersPage.cshtml"
                Write(Strings.ServersPage_Table_Name);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 44 "..\..\Dashboard\Pages\ServersPage.cshtml"
                Write(Strings.ServersPage_Table_Workers);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 45 "..\..\Dashboard\Pages\ServersPage.cshtml"
                Write(Strings.ServersPage_Table_Queues);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 46 "..\..\Dashboard\Pages\ServersPage.cshtml"
                Write(Strings.ServersPage_Table_Started);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 47 "..\..\Dashboard\Pages\ServersPage.cshtml"
                Write(Strings.ServersPage_Table_Heartbeat);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                        </tr>\r\n                    </thead>\r\n             " +
                             "       <tbody>\r\n");



            #line 51 "..\..\Dashboard\Pages\ServersPage.cshtml"
                foreach (var server in servers)
                {
            #line default
            #line hidden
                    WriteLiteral("                            <tr>\r\n                                <td>\r\n");



            #line 55 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    if (server.Heartbeat < now.Add(-possiblyAbortedThreshold))
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <span class=\"glyphicon glyphicon-alert te" +
                                     "xt-danger\" title=\"");



            #line 57 "..\..\Dashboard\Pages\ServersPage.cshtml"
                        Write(Strings.ServersPage_Possibly_Aborted);


            #line default
            #line hidden
                        WriteLiteral("\"></span>\r\n");



            #line 58 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    }
                    else if (server.Heartbeat < now.Add(-inconclusiveThreshold))
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <span class=\"glyphicon margin-right-14p\">" +
                                     "</span>\r\n");



            #line 62 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <span class=\"glyphicon glyphicon-ok text-" +
                                     "success\" title=\"");



            #line 65 "..\..\Dashboard\Pages\ServersPage.cshtml"
                        Write(Strings.ServersPage_Active);


            #line default
            #line hidden
                        WriteLiteral("\"></span>\r\n");



            #line 66 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    ");



            #line 67 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(Html.ServerId(server.Name));


            #line default
            #line hidden
                    WriteLiteral("\r\n                                </td>\r\n                                <td>");



            #line 69 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(server.WorkersCount);


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                                <td>");



            #line 70 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(Html.Raw(String.Join(", ", server.Queues.Select(Html.QueueLabel))));


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                                <td>");



            #line 71 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(Html.RelativeTime(server.StartedAt));


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                                <td>\r\n");



            #line 73 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    if (server.Heartbeat.HasValue)
                    {
            #line default
            #line hidden

            #line 75 "..\..\Dashboard\Pages\ServersPage.cshtml"
                        Write(Html.RelativeTime(server.Heartbeat.Value));


            #line default
            #line hidden

            #line 75 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                </td>\r\n                            </tr>\r\n");



            #line 79 "..\..\Dashboard\Pages\ServersPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                    </tbody>\r\n                </table>\r\n            </div>\r\n");



            #line 83 "..\..\Dashboard\Pages\ServersPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #37
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 10 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"

            Layout = new LayoutPage(Strings.AwaitingJobsPage_Title);

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            List <string> jobIds = null;
            Pager         pager  = null;

            using (var connection = Storage.GetConnection())
            {
                var storageConnection = connection as JobStorageConnection;

                if (storageConnection != null)
                {
                    pager  = new Pager(from, perPage, storageConnection.GetSetCount("awaiting"));
                    jobIds = storageConnection.GetRangeFromSet("awaiting", pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1);
                }
            }



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 35 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");



            #line 38 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
            Write(Strings.AwaitingJobsPage_Title);


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n");



            #line 40 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
            if (jobIds == null)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-warning\">\r\n                <h4>");



            #line 43 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.AwaitingJobsPage_ContinuationsWarning_Title);


            #line default
            #line hidden
                WriteLiteral("</h4>\r\n                <p>");



            #line 44 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.AwaitingJobsPage_ContinuationsWarning_Text);


            #line default
            #line hidden
                WriteLiteral("</p>\r\n            </div>\r\n");



            #line 46 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
            }
            else if (jobIds.Count > 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
                             "tn-toolbar-top\">\r\n                    <button class=\"js-jobs-list-command btn bt" +
                             "n-sm btn-primary\"\r\n                            data-url=\"");



            #line 52 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Url.To("/jobs/awaiting/enqueue"));


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            data-loading-text=\"");



            #line 53 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.Common_Enqueueing);


            #line default
            #line hidden
                WriteLiteral("\">\r\n                        <span class=\"glyphicon glyphicon-repeat\"></span>\r\n   " +
                             "                     ");



            #line 55 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.Common_EnqueueButton_Text);


            #line default
            #line hidden
                WriteLiteral("\r\n                    </button>\r\n\r\n                    <button class=\"js-jobs-lis" +
                             "t-command btn btn-sm btn-default\"\r\n                            data-url=\"");



            #line 59 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Url.To("/jobs/awaiting/delete"));


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            data-loading-text=\"");



            #line 60 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.Common_Deleting);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            data-confirm=\"");



            #line 61 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.Common_DeleteConfirm);


            #line default
            #line hidden
                WriteLiteral("\">\r\n                        <span class=\"glyphicon glyphicon-remove\"></span>\r\n   " +
                             "                     ");



            #line 63 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.Common_DeleteSelected);


            #line default
            #line hidden
                WriteLiteral("\r\n                    </button>\r\n\r\n                    ");



            #line 66 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Html.PerPageSelector(pager));


            #line default
            #line hidden
                WriteLiteral(@"
                </div>

                <div class=""table-responsive"">
                    <table class=""table table-hover"">
                        <thead>
                            <tr>
                                <th class=""min-width"">
                                    <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                </th>
                                <th class=""min-width"">");



            #line 76 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.Common_Id);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th>");



            #line 77 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.Common_Job);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"min-width\">");



            #line 78 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.AwaitingJobsPage_Table_Options);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"min-width\">");



            #line 79 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.AwaitingJobsPage_Table_Parent);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"align-right\">");



            #line 80 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.Common_Created);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            </tr>\r\n                        </thead>\r\n     " +
                             "                   <tbody>\r\n");



            #line 84 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                foreach (var jobId in jobIds)
                {
                    JobData   jobData;
                    StateData stateData;
                    StateData parentStateData = null;

                    using (var connection = Storage.GetConnection())
                    {
                        jobData   = connection.GetJobData(jobId);
                        stateData = connection.GetStateData(jobId);

                        if (stateData != null && stateData.Name == AwaitingState.StateName)
                        {
                            parentStateData = connection.GetStateData(stateData.Data["ParentId"]);
                        }
                    }



            #line default
            #line hidden
                    WriteLiteral("                                <tr class=\"js-jobs-list-row ");



            #line 101 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                    Write(jobData != null ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                    <td>\r\n                                   " +
                                 "     <input type=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\"");



            #line 103 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                    Write(jobId);


            #line default
            #line hidden
                    WriteLiteral("\" />\r\n                                    </td>\r\n                                " +
                                 "    <td class=\"min-width\">\r\n                                        ");



            #line 106 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                    Write(Html.JobIdLink(jobId));


            #line default
            #line hidden
                    WriteLiteral("\r\n                                    </td>\r\n");



            #line 108 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                    if (jobData == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td colspan=\"2\"><em>");



            #line 110 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        Write(Strings.Common_JobExpired);


            #line default
            #line hidden
                        WriteLiteral("</em></td>\r\n");



            #line 111 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td>\r\n                                   " +
                                     "         ");



            #line 115 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        Write(Html.JobNameLink(jobId, jobData.Job));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                        </td>\r\n");



                        WriteLiteral("                                        <td class=\"min-width\">\r\n");



            #line 118 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        if (stateData != null && stateData.Data.ContainsKey("Options") && !String.IsNullOrWhiteSpace(stateData.Data["Options"]))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <code>");



            #line 120 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                            Write(stateData.Data["Options"]);


            #line default
            #line hidden
                            WriteLiteral("</code>\r\n");



            #line 121 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <em>");



            #line 124 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                            Write(Strings.Common_NotAvailable);


            #line default
            #line hidden
                            WriteLiteral("</em>\r\n");



            #line 125 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                        </td>\r\n");



                        WriteLiteral("                                        <td class=\"min-width\">\r\n");



            #line 128 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        if (parentStateData != null)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <a href=\"");



            #line 130 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                            Write(Url.JobDetails(stateData.Data["ParentId"]));


            #line default
            #line hidden
                            WriteLiteral("\">\r\n                                                    <span class=\"label label-" +
                                         "default label-hover\" style=\"");



            #line 131 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                            Write($"background-color: {JobHistoryRenderer.GetForegroundStateColor(parentStateData.Name)};");


            #line default
            #line hidden
                            WriteLiteral("\">\r\n                                                        ");



            #line 132 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                            Write(parentStateData.Name);


            #line default
            #line hidden
                            WriteLiteral("\r\n                                                    </span>\r\n                  " +
                                         "                              </a>\r\n");



            #line 135 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <em>");



            #line 138 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                            Write(Strings.Common_NotAvailable);


            #line default
            #line hidden
                            WriteLiteral("</em>\r\n");



            #line 139 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                        </td>\r\n");



                        WriteLiteral("                                        <td class=\"min-width align-right\">\r\n     " +
                                     "                                       ");



            #line 142 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                        Write(Html.RelativeTime(jobData.CreatedAt));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                        </td>\r\n");



            #line 144 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                </tr>\r\n");



            #line 146 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                        </tbody>\r\n                    </table>\r\n                <" +
                             "/div>\r\n                ");



            #line 150 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Html.Paginator(pager));


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 152 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");



            #line 156 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
                Write(Strings.AwaitingJobsPage_NoJobs);


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 158 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>\r\n");
        }
コード例 #38
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 9 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"

            Layout = new LayoutPage(Strings.RecurringJobsPage_Title);
            List <RecurringJobDto> recurringJobs;

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            Pager pager = null;

            using (var connection = Storage.GetConnection())
            {
                var storageConnection = connection as JobStorageConnection;
                if (storageConnection != null)
                {
                    pager         = new Pager(from, perPage, storageConnection.GetRecurringJobCount());
                    recurringJobs = storageConnection.GetRecurringJobs(pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1);
                }
                else
                {
                    recurringJobs = connection.GetRecurringJobs();
                }
            }



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-12\">\r\n        <h1 class=\"page-header\"" +
                         ">");



            #line 37 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
            Write(Strings.RecurringJobsPage_Title);


            #line default
            #line hidden
            WriteLiteral(" <button type=\"button\" class=\"btn\" style=\"float: inherit;margin-right: 10px\" id=\"" +
                         "addBackgroundJob\">新增周期性作业</button>\r\n            <a style=\"margin-right: 10px;   " +
                         " font-size: 15px;\" href=\"corn\">Corn在线生成</a></h1>\r\n\r\n");



            #line 40 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
            if (recurringJobs.Count == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");



            #line 43 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.RecurringJobsPage_NoJobs);


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 45 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
                             "tn-toolbar-top\">\r\n                    <button class=\"js-jobs-list-command btn bt" +
                             "n-sm btn-primary\"\r\n                            data-url=\"");



            #line 51 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Url.To("/recurring/trigger"));


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            data-loading-text=\"");



            #line 52 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.RecurringJobsPage_Triggering);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
                             "n class=\"glyphicon glyphicon-play-circle\"></span>\r\n                        ");



            #line 55 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.RecurringJobsPage_TriggerNow);


            #line default
            #line hidden
                WriteLiteral("\r\n                    </button>\r\n\r\n                    <button class=\"js-jobs-lis" +
                             "t-command btn btn-sm btn-default\"\r\n                            data-url=\"");



            #line 59 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Url.To("/recurring/remove"));


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            data-loading-text=\"");



            #line 60 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.Common_Deleting);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            data-confirm=\"");



            #line 61 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.Common_DeleteConfirm);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
                             "n class=\"glyphicon glyphicon-remove\"></span>\r\n                        ");



            #line 64 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.Common_Delete);


            #line default
            #line hidden
                WriteLiteral("\r\n                    </button>\r\n\r\n");



            #line 67 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                if (pager != null)
                {
            #line default
            #line hidden
                    WriteLiteral("                        ");

                    WriteLiteral(" ");



            #line 69 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Html.PerPageSelector(pager));


            #line default
            #line hidden
                    WriteLiteral("\r\n");



            #line 70 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral(@"                </div>

                <div class=""table-responsive"">
                    <table class=""table"">
                        <thead>
                            <tr>
                                <th class=""min-width"">
                                    <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                </th>
                                <th class=""min-width"">");



            #line 80 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.Common_Id);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"min-width\">");



            #line 81 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.RecurringJobsPage_Table_Cron);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"min-width\">");



            #line 82 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.RecurringJobsPage_Table_TimeZone);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th>");



            #line 83 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.Common_Job);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"align-right min-width\">");



            #line 84 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.RecurringJobsPage_Table_NextExecution);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"align-right min-width\">");



            #line 85 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.RecurringJobsPage_Table_LastExecution);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"align-right min-width\">");



            #line 86 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                Write(Strings.Common_Created);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            </tr>\r\n                        </thead>\r\n     " +
                             "                   <tbody>\r\n");



            #line 90 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                foreach (var job in recurringJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                                <tr class=\"js-jobs-list-row hover\">\r\n            " +
                                 "                        <td>\r\n                                        <input typ" +
                                 "e=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\"");



            #line 94 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(job.Id);


            #line default
            #line hidden
                    WriteLiteral("\" />\r\n                                    </td>\r\n                                " +
                                 "    <td class=\"min-width\">");



            #line 96 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(job.Id);


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                                    <td class=\"min-width\">\r\n              " +
                                 "                          ");



                    WriteLiteral("\r\n");



            #line 99 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"

                    string cronDescription = null;
#if NETFULL
                    try
                    {
                        cronDescription = CronExpressionDescriptor.ExpressionDescriptor.GetDescription(job.Cron);
                    }
                    catch (FormatException)
                    {
                    }
#endif



            #line default
            #line hidden
                    WriteLiteral("\r\n");



            #line 112 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (cronDescription != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <code title=\"");



            #line 114 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(cronDescription);


            #line default
            #line hidden
                        WriteLiteral("\">");



            #line 114 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(job.Cron);


            #line default
            #line hidden
                        WriteLiteral("</code>\r\n");



            #line 115 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <code>");



            #line 118 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(job.Cron);


            #line default
            #line hidden
                        WriteLiteral("</code>\r\n");



            #line 119 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                    <t" +
                                 "d class=\"min-width\">\r\n");



            #line 122 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (!String.IsNullOrWhiteSpace(job.TimeZoneId))
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <span title=\"");



            #line 124 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(TimeZoneInfo.FindSystemTimeZoneById(job.TimeZoneId).DisplayName);


            #line default
            #line hidden
                        WriteLiteral("\" data-container=\"body\">");



            #line 124 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(job.TimeZoneId);


            #line default
            #line hidden
                        WriteLiteral("</span>\r\n");



            #line 125 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            ");

                        WriteLiteral(" UTC\r\n");



            #line 129 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                    <t" +
                                 "d class=\"word-break\">\r\n");



            #line 132 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.Job != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            ");

                        WriteLiteral(" ");



            #line 134 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Html.JobName(job.Job));


            #line default
            #line hidden
                        WriteLiteral("\r\n");



            #line 135 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <em>");



            #line 138 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(job.LoadException.InnerException.Message);


            #line default
            #line hidden
                        WriteLiteral("</em>\r\n");



            #line 139 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                    <t" +
                                 "d class=\"align-right min-width\">\r\n");



            #line 142 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.NextExecution != null)
                    {
            #line default
            #line hidden

            #line 144 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Html.RelativeTime(job.NextExecution.Value));


            #line default
            #line hidden

            #line 144 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <em>");



            #line 148 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Strings.Common_NotAvailable);


            #line default
            #line hidden
                        WriteLiteral("</em>\r\n");



            #line 149 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                    <t" +
                                 "d class=\"align-right min-width\">\r\n");



            #line 152 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.LastExecution != null)
                    {
                        if (!String.IsNullOrEmpty(job.LastJobId))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <a href=\"");



            #line 156 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Url.JobDetails(job.LastJobId));


            #line default
            #line hidden
                            WriteLiteral("\">\r\n                                                    <span class=\"label label-" +
                                         "default label-hover\" style=\"");



            #line 157 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write($"background-color: {JobHistoryRenderer.GetForegroundStateColor(job.LastJobState)};");


            #line default
            #line hidden
                            WriteLiteral("\">\r\n                                                        ");



            #line 158 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Html.RelativeTime(job.LastExecution.Value));


            #line default
            #line hidden
                            WriteLiteral("\r\n                                                    </span>\r\n                  " +
                                         "                              </a>\r\n");



            #line 161 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <em>\r\n                           " +
                                         "                         ");



            #line 165 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Strings.RecurringJobsPage_Canceled);


            #line default
            #line hidden
                            WriteLiteral(" ");



            #line 165 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Html.RelativeTime(job.LastExecution.Value));


            #line default
            #line hidden
                            WriteLiteral("\r\n                                                </em>\r\n");



            #line 167 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        }
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <em>");



            #line 171 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Strings.Common_NotAvailable);


            #line default
            #line hidden
                        WriteLiteral("</em>\r\n");



            #line 172 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                    <t" +
                                 "d class=\"align-right min-width\">\r\n");



            #line 175 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.CreatedAt != null)
                    {
            #line default
            #line hidden

            #line 177 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(Html.RelativeTime(job.CreatedAt.Value));


            #line default
            #line hidden

            #line 177 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <em>N/A</em>\r\n");



            #line 182 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                </tr>\r" +
                                 "\n");



            #line 185 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                        </tbody>\r\n                    </table>\r\n                <" +
                             "/div>\r\n\r\n");



            #line 190 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                if (pager != null)
                {
            #line default
            #line hidden
                    WriteLiteral("                    ");

                    WriteLiteral(" ");



            #line 192 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(Html.Paginator(pager));


            #line default
            #line hidden
                    WriteLiteral("\r\n");



            #line 193 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </div>\r\n");



            #line 195 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral(@"        <div class=""modal inmodal"" id=""addBackgroundJobModal"" tabindex=""-1"" role=""dialog"" aria-hidden=""true"">
            <div class=""modal-dialog"">
                <div class=""modal-content"">
                    <div class=""modal-header"">
                        <h4 class=""modal-title"">新增作业</h4>
                    </div>
                    <div class=""modal-body"">
                        <div class=""editor_holder"" style=""height: 250px;""></div>
                    </div>
                    <div class=""modal-footer"">
                        <button type=""button"" class=""btn btn-white"" id=""addBackgroundJob_close-model"">关闭</button>
                        <button type=""button"" class=""btn btn-primary"" id=""addBackgroundJob_save-model"" data-url=""");



            #line 207 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
            Write(Url.WebApiUrl("CreateRecurringJob"));


            #line default
            #line hidden
            WriteLiteral("\">提交</button>\r\n                    </div>\r\n                </div>\r\n            </" +
                         "div>\r\n        </div>\r\n    </div>\r\n</div>    ");
        }
コード例 #39
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 8 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"

            Layout = new LayoutPage {
                Title = "Failed Jobs"
            };

            int from, perPage;

            int.TryParse(Request.Query["from"], out from);
            int.TryParse(Request.Query["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("\r\n");



            #line 26 "..\..\Dashboard\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 31 "..\..\Dashboard\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 37 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                var index = 0;


            #line default
            #line hidden


            #line 67 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                foreach (var job in failedJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <tr class=\"js-jobs-list-row ");



            #line 69 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(!job.Value.InFailedState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral(" ");



            #line 69 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(job.Value.InFailedState ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                        <td rowspan=\"");



            #line 70 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(job.Value.InFailedState ? "2" : "1");


            #line default
            #line hidden
                    WriteLiteral("\">\r\n");



            #line 71 "..\..\Dashboard\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 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        Write(job.Key);


            #line default
            #line hidden
                        WriteLiteral("\" />\r\n");



            #line 74 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"min-width\" rows" +
                                 "pan=\"");



            #line 76 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(job.Value.InFailedState ? "2" : "1");


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                            <a href=\"");



            #line 77 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                ");



            #line 78 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n                            </a>\r\n");



            #line 80 "..\..\Dashboard\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 83 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n");



            #line 86 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    if (job.Value.FailedAt.HasValue)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span data-moment=\"");



            #line 88 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        Write(JobHelper.ToTimestamp(job.Value.FailedAt.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                    ");



            #line 89 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        Write(job.Value.FailedAt);


            #line default
            #line hidden
                        WriteLiteral("\r\n                                </span>\r\n");



            #line 91 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td>\r\n                    " +
                                 "        <div>\r\n                                <a class=\"job-method\" href=\"");



            #line 95 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                    ");



            #line 96 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    Write(HtmlHelper.DisplayMethod(job.Value.Job));


            #line default
            #line hidden
                    WriteLiteral("\r\n                                </a>\r\n                            </div>\r\n");



            #line 99 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    if (!String.IsNullOrEmpty(job.Value.ExceptionMessage))
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <div style=\"color: #888;\">\r\n                     " +
                                     "               ");



            #line 102 "..\..\Dashboard\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 104 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                    </tr>\r\n");



            #line 107 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    if (job.Value.InFailedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                        <tr>\r\n                            <td colspan=\"2\" class=\"" +
                                     "failed-job-details\">\r\n                                <div class=\"expandable\" st" +
                                     "yle=\"");



            #line 111 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        Write(index++ == 0 ? "display: block;" : null);


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                    <h4>");



            #line 112 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        Write(job.Value.ExceptionType);


            #line default
            #line hidden
                        WriteLiteral("</h4>\r\n                                    <p>\r\n                                 " +
                                     "       ");



            #line 114 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        Write(job.Value.ExceptionMessage);


            #line default
            #line hidden
                        WriteLiteral("\r\n                                    </p>\r\n\r\n");



            #line 117 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        if (!String.IsNullOrEmpty(job.Value.ExceptionDetails))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                        <pre class=\"stack-trace\">");



            #line 119 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                            Write(HtmlHelper.MarkupStackTrace(job.Value.ExceptionDetails));


            #line default
            #line hidden
                            WriteLiteral("</pre>\r\n");



            #line 120 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                </div>\r\n                            </td>\r\n      " +
                                     "                  </tr>\r\n");



            #line 124 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                    }
                }


            #line default
            #line hidden
                WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");



            #line 129 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"



            #line default
            #line hidden

            #line 130 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
                Write(RenderPartial(new Paginator(pager)));


            #line default
            #line hidden

            #line 130 "..\..\Dashboard\Pages\FailedJobsPage.cshtml"
            }


            #line default
            #line hidden
        }
コード例 #40
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 7 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"

            Layout = new LayoutPage {
                Title = "Processing Jobs"
            };

            int from, perPage;

            int.TryParse(Request.Query["from"], out from);
            int.TryParse(Request.Query["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("\r\n");



            #line 25 "..\..\Dashboard\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 30 "..\..\Dashboard\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 36 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                foreach (var job in processingJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <tr class=\"js-jobs-list-row ");



            #line 68 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    Write(!job.Value.InProcessingState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral(" ");



            #line 68 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    Write(job.Value.InProcessingState ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                        <td>\r\n");



            #line 70 "..\..\Dashboard\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 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                        Write(job.Key);


            #line default
            #line hidden
                        WriteLiteral("\" />\r\n");



            #line 73 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n  " +
                                 "                          <a href=\"");



            #line 76 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                ");



            #line 77 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n                            </a>\r\n");



            #line 79 "..\..\Dashboard\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 82 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n  " +
                                 "                          ");



            #line 85 "..\..\Dashboard\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 88 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                ");



            #line 89 "..\..\Dashboard\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 93 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    if (job.Value.StartedAt.HasValue)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span data-moment=\"");



            #line 95 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                        Write(JobHelper.ToTimestamp(job.Value.StartedAt.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                    ");



            #line 96 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                        Write(job.Value.StartedAt);


            #line default
            #line hidden
                        WriteLiteral("\r\n                                </span>\r\n");



            #line 98 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                    </tr>\r\n");



            #line 101 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");



            #line 105 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"


            #line default
            #line hidden

            #line 105 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(RenderPartial(new Paginator(pager)));


            #line default
            #line hidden

            #line 105 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
            }


            #line default
            #line hidden
        }
コード例 #41
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 7 "..\..\Dashboard\Pages\QueuesPage.cshtml"

            Layout = new LayoutPage(Strings.QueuesPage_Title);

            var monitor = Storage.GetMonitoringApi();
            var queues  = monitor.Queues();



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 16 "..\..\Dashboard\Pages\QueuesPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");



            #line 19 "..\..\Dashboard\Pages\QueuesPage.cshtml"
            Write(Strings.QueuesPage_Title);


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n");



            #line 21 "..\..\Dashboard\Pages\QueuesPage.cshtml"
            if (queues.Count == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-warning\">\r\n                ");



            #line 24 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                Write(Strings.QueuesPage_NoQueues);


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 26 "..\..\Dashboard\Pages\QueuesPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"table-responsive\">\r\n                <table class=\"table t" +
                             "able-striped\">\r\n                    <thead>\r\n                        <tr>\r\n     " +
                             "                       <th style=\"min-width: 200px;\">");



            #line 33 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                Write(Strings.QueuesPage_Table_Queue);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 34 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                Write(Strings.QueuesPage_Table_Length);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 35 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                Write(Strings.Common_Fetched);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 36 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                Write(Strings.QueuesPage_Table_NextsJobs);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                        </tr>\r\n                    </thead>\r\n             " +
                             "       <tbody>\r\n");



            #line 40 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                foreach (var queue in queues)
                {
            #line default
            #line hidden
                    WriteLiteral("                            <tr>\r\n                                <td>");



            #line 43 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    Write(Html.QueueLabel(queue.Name));


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                                <td>");



            #line 44 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    Write(queue.Length);


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                                <td>\r\n");



            #line 46 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    if (queue.Fetched.HasValue)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <a href=\"");



            #line 48 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        Write(Url.To("/jobs/enqueued/fetched/" + queue.Name));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                            ");



            #line 49 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        Write(queue.Fetched);


            #line default
            #line hidden
                        WriteLiteral("\r\n                                        </a>\r\n");



            #line 51 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <em>");



            #line 54 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        Write(Strings.Common_NotAvailable);


            #line default
            #line hidden
                        WriteLiteral("</em>\r\n");



            #line 55 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                </td>\r\n                                <td>\r\n");



            #line 58 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    if (queue.FirstJobs.Count == 0)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <em>\r\n                                   " +
                                     "         ");



            #line 61 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        Write(Strings.QueuesPage_NoJobs);


            #line default
            #line hidden
                        WriteLiteral("\r\n                                        </em>\r\n");



            #line 63 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral(@"                                        <table class=""table table-condensed table-inner"">
                                            <thead>
                                                <tr>
                                                    <th class=""min-width"">");



            #line 69 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        Write(Strings.Common_Id);


            #line default
            #line hidden
                        WriteLiteral("</th>\r\n                                                    <th class=\"min-width\">" +
                                     "");



            #line 70 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        Write(Strings.Common_State);


            #line default
            #line hidden
                        WriteLiteral("</th>\r\n                                                    <th>");



            #line 71 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        Write(Strings.Common_Job);


            #line default
            #line hidden
                        WriteLiteral("</th>\r\n                                                    <th class=\"align-right" +
                                     " min-width\">");



            #line 72 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        Write(Strings.Common_Enqueued);


            #line default
            #line hidden
                        WriteLiteral("</th>\r\n                                                </tr>\r\n                   " +
                                     "                         </thead>\r\n                                            <" +
                                     "tbody>\r\n");



            #line 76 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        foreach (var job in queue.FirstJobs)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                    <tr class=\"");



            #line 78 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            Write(job.Value == null || !job.Value.InEnqueuedState ? "obsolete-data" : null);


            #line default
            #line hidden
                            WriteLiteral("\">\r\n                                                        <td class=\"min-width\"" +
                                         ">\r\n                                                            ");



            #line 80 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            Write(Html.JobIdLink(job.Key));


            #line default
            #line hidden
                            WriteLiteral("\r\n");



            #line 81 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            if (job.Value != null && !job.Value.InEnqueuedState)
                            {
            #line default
            #line hidden
                                WriteLiteral("                                                                <span title=\"");



            #line 83 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                Write(Strings.Common_JobStateChanged_Text);


            #line default
            #line hidden
                                WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");



            #line 84 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            }


            #line default
            #line hidden
                            WriteLiteral("                                                        </td>\r\n");



            #line 86 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            if (job.Value == null)
                            {
            #line default
            #line hidden
                                WriteLiteral("                                                            <td colspan=\"3\"><em>");



            #line 88 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                Write(Strings.Common_JobExpired);


            #line default
            #line hidden
                                WriteLiteral("</em></td>\r\n");



            #line 89 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            }
                            else
                            {
            #line default
            #line hidden
                                WriteLiteral("                                                            <td class=\"min-width\"" +
                                             ">\r\n                                                                ");



            #line 93 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                Write(Html.StateLabel(job.Value.State));


            #line default
            #line hidden
                                WriteLiteral("\r\n                                                            </td>\r\n");



                                WriteLiteral("                                                            <td class=\"word-break" +
                                             "\">\r\n                                                                ");



            #line 96 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                Write(Html.JobNameLink(job.Key, job.Value.Job));


            #line default
            #line hidden
                                WriteLiteral("\r\n                                                            </td>\r\n");



                                WriteLiteral("                                                            <td class=\"align-righ" +
                                             "t min-width\">\r\n");



            #line 99 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                if (job.Value.EnqueuedAt.HasValue)
                                {
            #line default
            #line hidden

            #line 101 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                    Write(Html.RelativeTime(job.Value.EnqueuedAt.Value));


            #line default
            #line hidden

            #line 101 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                }
                                else
                                {
            #line default
            #line hidden
                                    WriteLiteral("                                                                    <em>");



            #line 105 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                    Write(Strings.Common_NotAvailable);


            #line default
            #line hidden
                                    WriteLiteral("</em>\r\n");



            #line 106 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                                }


            #line default
            #line hidden
                                WriteLiteral("                                                            </td>\r\n");



            #line 108 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                            }


            #line default
            #line hidden
                            WriteLiteral("                                                    </tr>\r\n");



            #line 110 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                            </tbody>\r\n                           " +
                                     "             </table>\r\n");



            #line 113 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                </td>\r\n                            </tr>\r\n");



            #line 116 "..\..\Dashboard\Pages\QueuesPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                    </tbody>\r\n                </table>\r\n            </div>\r\n");



            #line 120 "..\..\Dashboard\Pages\QueuesPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #42
0
        public override void Execute()
        {


WriteLiteral("\r\n");





            
            #line 5 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
  
    Layout = new LayoutPage("Deleted Jobs");

    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    var monitor = Storage.GetMonitoringApi();
    var pager = new Pager(from, perPage, monitor.DeletedListCount());
    var jobs = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 20 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">Deleted" +
" Jobs</h1>\r\n\r\n");


            
            #line 25 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
         if (pager.TotalPageCount == 0)
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-info\">\r\n                No deleted jobs found" +
".\r\n            </div>\r\n");


            
            #line 30 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
        }
        else
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
"tn-toolbar-top\">\r\n                    <button class=\"js-jobs-list-command btn bt" +
"n-sm btn-primary\"\r\n                            data-url=\"");


            
            #line 36 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                 Write(Url.To("/jobs/deleted/requeue"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                            data-loading-text=""Enqueueing...""
                            disabled=""disabled"">
                        <span class=""glyphicon glyphicon-repeat""></span>
                        Requeue jobs
                    </button>
                    ");


            
            #line 42 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
               Write(Html.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 56 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                     foreach (var job in jobs)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <tr class=\"js-jobs-list-row ");


            
            #line 58 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                                Write(job.Value != null && !job.Value.InDeletedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 58 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                                                                                                           Write(job.Value != null && job.Value.InDeletedState && job.Value != null ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            <td>\r\n");


            
            #line 60 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                 if (job.Value != null && job.Value.InDeletedState)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <input type=\"checkbox\" class=\"js-jobs-list-ch" +
"eckbox\" name=\"jobs[]\" value=\"");


            
            #line 62 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                                                                                         Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\"/>\r\n");


            
            #line 63 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                            <td class=\"min-wid" +
"th\">\r\n                                ");


            
            #line 66 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                           Write(Html.JobIdLink(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 67 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                 if (job.Value != null && !job.Value.InDeletedState)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span title=\"Job\'s state has been changed whi" +
"le fetching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 70 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n\r\n");


            
            #line 73 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                             if (job.Value == null)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <td colspan=\"2\"><em>Job has expired.</em></td>\r\n");


            
            #line 76 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <td>\r\n                                    ");


            
            #line 80 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                               Write(Html.JobNameLink(job.Key, job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </td>\r\n");



WriteLiteral("                                <td class=\"align-right\">\r\n");


            
            #line 83 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                     if (job.Value.DeletedAt.HasValue)
                                    {
                                        
            
            #line default
            #line hidden
            
            #line 85 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                   Write(Html.RelativeTime(job.Value.DeletedAt.Value));

            
            #line default
            #line hidden
            
            #line 85 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                                                                     
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                </td>\r\n");


            
            #line 88 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </tr>\r\n");


            
            #line 90 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                    </tbody>\r\n                </table>\r\n\r\n                ");


            
            #line 94 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
           Write(Html.Paginator(pager));

            
            #line default
            #line hidden
WriteLiteral("\r\n            </div>\r\n");


            
            #line 96 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </div>\r\n</div>\r\n\r\n");


        }
コード例 #43
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 8 "..\..\Dashboard\Pages\ServersPage.cshtml"

            Layout = new LayoutPage("Servers");

            var monitor = Storage.GetMonitoringApi();
            var servers = monitor.Servers();



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-12\">\r\n        <h1 class=\"page-header\"" +
                         ">Servers</h1>\r\n\r\n");



            #line 19 "..\..\Dashboard\Pages\ServersPage.cshtml"
            if (servers.Count == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-warning\">\r\n                There are no activ" +
                             "e servers. Background tasks will not be processed.\r\n            </div>\r\n");



            #line 24 "..\..\Dashboard\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 38 "..\..\Dashboard\Pages\ServersPage.cshtml"
                foreach (var server in servers)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <tr>\r\n                        <td>");



            #line 41 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(server.Name.ToUpperInvariant());


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                        <td>");



            #line 42 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(server.WorkersCount);


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                        <td>");



            #line 43 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(Html.Raw(String.Join(" ", server.Queues.Select(Html.QueueLabel))));


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                        <td data-moment=\"");



            #line 44 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(JobHelper.ToTimestamp(server.StartedAt));


            #line default
            #line hidden
                    WriteLiteral("\">");



            #line 44 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(server.StartedAt);


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                        <td>\r\n");



            #line 46 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    if (server.Heartbeat.HasValue)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span data-moment=\"");



            #line 48 "..\..\Dashboard\Pages\ServersPage.cshtml"
                        Write(JobHelper.ToTimestamp(server.Heartbeat.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                        ");



            #line 49 "..\..\Dashboard\Pages\ServersPage.cshtml"
                        Write(server.Heartbeat);


            #line default
            #line hidden
                        WriteLiteral("\r\n                                    </span>\r\n");



            #line 51 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                    </tr>\r\n");



            #line 54 "..\..\Dashboard\Pages\ServersPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                </tbody>\r\n            </table>\r\n");



            #line 57 "..\..\Dashboard\Pages\ServersPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #44
0
        public override void Execute()
        {


WriteLiteral("\r\n");









            
            #line 9 "..\..\Dashboard\Pages\ServersPage.cshtml"
  
    Layout = new LayoutPage { Title = "Servers" };
    
    var monitor = Storage.GetMonitoringApi();
    IList<ServerDto> servers = monitor.Servers();    


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 16 "..\..\Dashboard\Pages\ServersPage.cshtml"
 if (servers.Count == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-warning\">\r\n        There are no active servers. Backg" +
"round tasks will not be processed.\r\n    </div>\r\n");


            
            #line 21 "..\..\Dashboard\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 "..\..\Dashboard\Pages\ServersPage.cshtml"
             foreach (var server in servers)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr>\r\n                    <td>");


            
            #line 38 "..\..\Dashboard\Pages\ServersPage.cshtml"
                   Write(server.Name.ToUpperInvariant());

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                    <td>");


            
            #line 39 "..\..\Dashboard\Pages\ServersPage.cshtml"
                   Write(server.WorkersCount);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                    <td>");


            
            #line 40 "..\..\Dashboard\Pages\ServersPage.cshtml"
                   Write(HtmlHelper.Raw(String.Join(" ", server.Queues.Select(HtmlHelper.QueueLabel))));

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                    <td data-moment=\"");


            
            #line 41 "..\..\Dashboard\Pages\ServersPage.cshtml"
                                Write(JobHelper.ToTimestamp(server.StartedAt));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 41 "..\..\Dashboard\Pages\ServersPage.cshtml"
                                                                          Write(server.StartedAt);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                    <td>\r\n");


            
            #line 43 "..\..\Dashboard\Pages\ServersPage.cshtml"
                         if (server.Heartbeat.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 45 "..\..\Dashboard\Pages\ServersPage.cshtml"
                                          Write(JobHelper.ToTimestamp(server.Heartbeat.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 46 "..\..\Dashboard\Pages\ServersPage.cshtml"
                           Write(server.Heartbeat);

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </span>\r\n");


            
            #line 48 "..\..\Dashboard\Pages\ServersPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 51 "..\..\Dashboard\Pages\ServersPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 54 "..\..\Dashboard\Pages\ServersPage.cshtml"
}
            
            #line default
            #line hidden

        }
コード例 #45
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 9 "..\..\Dashboard\Pages\ServersPage.cshtml"

            Layout = new LayoutPage(Strings.ServersPage_Title);

            var monitor = Storage.GetMonitoringApi();
            var servers = monitor.Servers();
            var now     = DateTime.UtcNow;
            var inconclusiveThreshold    = TimeSpan.FromMinutes(1);
            var possiblyAbortedThreshold = TimeSpan.FromMinutes(5);



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-12\">\r\n        <h1 class=\"page-header\"" +
                         ">");



            #line 21 "..\..\Dashboard\Pages\ServersPage.cshtml"
            Write(Strings.ServersPage_Title);


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n");



            #line 23 "..\..\Dashboard\Pages\ServersPage.cshtml"
            if (servers.Count == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-warning\">\r\n                ");



            #line 26 "..\..\Dashboard\Pages\ServersPage.cshtml"
                Write(Strings.ServersPage_NoServers);


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 28 "..\..\Dashboard\Pages\ServersPage.cshtml"
            }
            else
            {
                if (servers.Any(x => x.Heartbeat.HasValue && x.Heartbeat.Value < now.Add(-inconclusiveThreshold)))
                {
            #line default
            #line hidden
                    WriteLiteral(@"                <div class=""alert alert-info"">
                    <h4>Aborted servers will be removed automatically</h4>
                    Some of the servers don't have heartbeat reported within the last minute and may be aborted. If they don't report heartbeat in the near future, they will be removed automatically after timeout is exceeded, no manual action is required.
                    Incomplete background jobs running on those servers will be re-queued automatically, but you can speed up the process by checking the <a href=""");



            #line 36 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(Url.To("/jobs/processing"));


            #line default
            #line hidden
                    WriteLiteral("\">Processing Jobs</a> page.\r\n                </div>\r\n");



            #line 38 "..\..\Dashboard\Pages\ServersPage.cshtml"
                }



            #line default
            #line hidden
                WriteLiteral("            <div class=\"table-responsive\">\r\n                <table class=\"table\">" +
                             "\r\n                    <thead>\r\n                        <tr>\r\n                   " +
                             "         <th>");



            #line 44 "..\..\Dashboard\Pages\ServersPage.cshtml"
                Write(Strings.ServersPage_Table_Name);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 45 "..\..\Dashboard\Pages\ServersPage.cshtml"
                Write(Strings.ServersPage_Table_Workers);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 46 "..\..\Dashboard\Pages\ServersPage.cshtml"
                Write(Strings.ServersPage_Table_Queues);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 47 "..\..\Dashboard\Pages\ServersPage.cshtml"
                Write(Strings.ServersPage_Table_Started);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 48 "..\..\Dashboard\Pages\ServersPage.cshtml"
                Write(Strings.ServersPage_Table_Heartbeat);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                        </tr>\r\n                    </thead>\r\n             " +
                             "       <tbody>\r\n");



            #line 52 "..\..\Dashboard\Pages\ServersPage.cshtml"
                foreach (var server in servers)
                {
            #line default
            #line hidden
                    WriteLiteral("                            <tr>\r\n                                <td>\r\n");



            #line 56 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    if (server.Heartbeat < now.Add(-possiblyAbortedThreshold))
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <span class=\"glyphicon glyphicon-alert te" +
                                     "xt-danger\" title=\"Possibly aborted\"></span>\r\n");



            #line 59 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    }
                    else if (server.Heartbeat < now.Add(-inconclusiveThreshold))
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <span class=\"glyphicon\" style=\"margin-rig" +
                                     "ht: 14px;\"></span>\r\n");



            #line 63 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <span class=\"glyphicon glyphicon-ok text-" +
                                     "success\" title=\"Active\"></span>\r\n");



            #line 67 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    ");



            #line 68 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(Html.ServerId(server.Name));


            #line default
            #line hidden
                    WriteLiteral("\r\n                                </td>\r\n                                <td>");



            #line 70 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(server.WorkersCount);


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                                <td>");



            #line 71 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(Html.Raw(String.Join(", ", server.Queues.Select(Html.QueueLabel))));


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                                <td>");



            #line 72 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    Write(Html.RelativeTime(server.StartedAt));


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                                <td>\r\n");



            #line 74 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    if (server.Heartbeat.HasValue)
                    {
            #line default
            #line hidden

            #line 76 "..\..\Dashboard\Pages\ServersPage.cshtml"
                        Write(Html.RelativeTime(server.Heartbeat.Value));


            #line default
            #line hidden

            #line 76 "..\..\Dashboard\Pages\ServersPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                </td>\r\n                            </tr>\r\n");



            #line 80 "..\..\Dashboard\Pages\ServersPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                    </tbody>\r\n                </table>\r\n            </div>\r\n");



            #line 84 "..\..\Dashboard\Pages\ServersPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #46
0
        public override void Execute()
        {


WriteLiteral("\r\n");










            
            #line 10 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Recurring jobs" };


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 14 "..\..\Dashboard\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 19 "..\..\Dashboard\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 25 "..\..\Dashboard\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 32 "..\..\Dashboard\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 54 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                 foreach (var job in RecurringJobs)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr class=\"js-jobs-list-row hover\">\r\n                        " +
"<td>\r\n                            <input type=\"checkbox\" class=\"js-jobs-list-che" +
"ckbox\" name=\"jobs[]\" value=\"");


            
            #line 58 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                                                                 Write(job.Id);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n                        </td>\r\n                        <td class=\"min-width" +
"\">");


            
            #line 60 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                         Write(job.Id);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                        <td class=\"min-width\">");


            
            #line 61 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                          Write(CronExpressionDescriptor.ExpressionDescriptor.GetDescription(job.Cron));

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                        <td>\r\n");


            
            #line 63 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                             if (job.Job != null)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                ");

WriteLiteral(" ");


            
            #line 65 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                              Write(HtmlHelper.DisplayMethod(job.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 66 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <em>");


            
            #line 69 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                               Write(job.LoadException.InnerException.Message);

            
            #line default
            #line hidden
WriteLiteral("</em>\r\n");


            
            #line 70 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td class=\"align-right min" +
"-width\">\r\n");


            
            #line 73 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                             if (job.NextExecution != null)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span data-moment=\"");


            
            #line 75 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                               Write(JobHelper.ToTimestamp(job.NextExecution.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 76 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                               Write(job.NextExecution.Value);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </span>\r\n");


            
            #line 78 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <em>N/A</em>\r\n");


            
            #line 82 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td class=\"align-right min" +
"-width\">\r\n");


            
            #line 85 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                             if (job.LastExecution != null)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <a href=\"");


            
            #line 87 "..\..\Dashboard\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 88 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                                                                           Write(JobHelper.ToTimestamp(job.LastExecution.Value));

            
            #line default
            #line hidden
WriteLiteral("\" style=\"");


            
            #line 88 "..\..\Dashboard\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 89 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                                   Write(job.LastExecution.Value);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                    </span>\r\n                                </" +
"a>\r\n");


            
            #line 92 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <em>N/A</em>\r\n");


            
            #line 96 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                    </tr>\r\n");


            
            #line 99 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");


            
            #line 103 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
}

            
            #line default
            #line hidden
WriteLiteral("    ");


        }
コード例 #47
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 8 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"

            Layout = new LayoutPage(Strings.ProcessingJobsPage_Title);

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            var monitor        = Storage.GetMonitoringApi();
            var pager          = new Pager(from, perPage, monitor.ProcessingCount());
            var processingJobs = monitor.ProcessingJobs(pager.FromRecord, pager.RecordsPerPage);
            var servers        = monitor.Servers();



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 24 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");



            #line 27 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
            Write(Strings.ProcessingJobsPage_Title);


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n");



            #line 29 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");



            #line 32 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Strings.ProcessingJobsPage_NoJobs);


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 34 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
                             "tn-toolbar-top\">\r\n                    <button class=\"js-jobs-list-command btn bt" +
                             "n-sm btn-primary\"\r\n                            data-url=\"");



            #line 40 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Url.To("/jobs/processing/requeue"));


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            data-loading-text=\"");



            #line 41 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Strings.Common_Enqueueing);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
                             "n class=\"glyphicon glyphicon-repeat\"></span>\r\n                        ");



            #line 44 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Strings.Common_RequeueJobs);


            #line default
            #line hidden
                WriteLiteral("\r\n                    </button>\r\n\r\n                    <button class=\"js-jobs-lis" +
                             "t-command btn btn-sm btn-default\"\r\n                            data-url=\"");



            #line 48 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Url.To("/jobs/processing/delete"));


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            data-loading-text=\"");



            #line 49 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Strings.Common_Deleting);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            data-confirm=\"");



            #line 50 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Strings.Common_DeleteConfirm);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
                             "n class=\"glyphicon glyphicon-remove\"></span>\r\n                        ");



            #line 53 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Strings.Common_DeleteSelected);


            #line default
            #line hidden
                WriteLiteral("\r\n                    </button>\r\n\r\n                    ");



            #line 56 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Html.PerPageSelector(pager));


            #line default
            #line hidden
                WriteLiteral(@"
                </div>

                <div class=""table-responsive"">
                    <table class=""table"">
                        <thead>
                            <tr>
                                <th class=""min-width"">
                                    <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                </th>
                                <th class=""min-width"">");



            #line 66 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Strings.Common_Id);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"min-width\">");



            #line 67 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Strings.Common_Server);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th>");



            #line 68 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Strings.Common_Job);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"align-right\">");



            #line 69 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Strings.ProcessingJobsPage_Table_Started);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            </tr>\r\n                        </thead>\r\n     " +
                             "                   <tbody>\r\n");



            #line 73 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                foreach (var job in processingJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                                <tr class=\"js-jobs-list-row ");



            #line 75 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    Write(!job.Value.InProcessingState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral(" ");



            #line 75 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    Write(job.Value.InProcessingState ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                    <td>\r\n");



            #line 77 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    if (job.Value.InProcessingState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <input type=\"checkbox\" class=\"js-jobs" +
                                     "-list-checkbox\" name=\"jobs[]\" value=\"");



            #line 79 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                        Write(job.Key);


            #line default
            #line hidden
                        WriteLiteral("\" />\r\n");



            #line 80 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                    <t" +
                                 "d class=\"min-width\">\r\n                                        ");



            #line 83 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    Write(Html.JobIdLink(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n");



            #line 84 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    if (!job.Value.InProcessingState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <span title=\"");



            #line 86 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                        Write(Strings.Common_JobStateChanged_Text);


            #line default
            #line hidden
                        WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");



            #line 87 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n");



            #line 89 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    if (!job.Value.InProcessingState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td colspan=\"3\">");



            #line 91 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                        Write(Strings.Common_JobStateChanged_Text);


            #line default
            #line hidden
                        WriteLiteral("</td>\r\n");



            #line 92 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td class=\"min-width\">\r\n                 " +
                                     "                           ");



            #line 96 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                        Write(Html.ServerId(job.Value.ServerId));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                        </td>\r\n");



                        WriteLiteral("                                        <td class=\"word-break\">\r\n");



            #line 99 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                        if (servers.All(x => x.Name != job.Value.ServerId || x.Heartbeat < DateTime.UtcNow.AddMinutes(-1)))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                                <span title=\"");



            #line 101 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                            Write(Strings.ProcessingJobsPage_Aborted);


            #line default
            #line hidden
                            WriteLiteral("\" class=\"glyphicon glyphicon-warning-sign\" style=\"font-size: 10px;\"></span>\r\n");



            #line 102 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("\r\n                                            ");



            #line 104 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                        Write(Html.JobNameLink(job.Key, job.Value.Job));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                        </td>\r\n");



                        WriteLiteral("                                        <td class=\"align-right\">\r\n");



            #line 107 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                        if (job.Value.StartedAt.HasValue)
                        {
            #line default
            #line hidden

            #line 109 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                            Write(Html.RelativeTime(job.Value.StartedAt.Value));


            #line default
            #line hidden

            #line 109 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                        </td>\r\n");



            #line 112 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                </tr>\r\n");



            #line 114 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                        </tbody>\r\n                    </table>\r\n                <" +
                             "/div>\r\n\r\n                ");



            #line 119 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                Write(Html.Paginator(pager));


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 121 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #48
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 9 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"

            Layout = new LayoutPage(Queue.ToUpperInvariant());

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            var monitor      = Storage.GetMonitoringApi();
            var pager        = new Pager(from, perPage, monitor.EnqueuedCount(Queue));
            var enqueuedJobs = monitor.EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 24 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        ");



            #line 27 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
            Write(Html.Breadcrumbs(Queue.ToUpperInvariant(), new Dictionary <string, string>
            {
                { "Queues", Url.LinkToQueues() }
            }));


            #line default
            #line hidden
            WriteLiteral("\r\n\r\n        <h1 class=\"page-header\">");



            #line 32 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
            Write(Queue.ToUpperInvariant());


            #line default
            #line hidden
            WriteLiteral(" <small>");



            #line 32 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
            Write(Strings.EnqueuedJobsPage_Title);


            #line default
            #line hidden
            WriteLiteral("</small></h1>\r\n\r\n");



            #line 34 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");



            #line 37 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                Write(Strings.EnqueuedJobsPage_NoJobs);


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 39 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
                             "tn-toolbar-top\">\r\n");



            #line 44 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                if (!IsReadOnly)
                {
            #line default
            #line hidden
                    WriteLiteral("                        <button class=\"js-jobs-list-command btn btn-sm btn-defaul" +
                                 "t\"\r\n                                data-url=\"");



            #line 47 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    Write(Url.To("/jobs/enqueued/delete"));


            #line default
            #line hidden
                    WriteLiteral("\"\r\n                                data-loading-text=\"");



            #line 48 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    Write(Strings.Common_Deleting);


            #line default
            #line hidden
                    WriteLiteral("\"\r\n                                data-confirm=\"");



            #line 49 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    Write(Strings.Common_DeleteConfirm);


            #line default
            #line hidden
                    WriteLiteral("\"\r\n                                disabled=\"disabled\">\r\n                        " +
                                 "    <span class=\"glyphicon glyphicon-remove\"></span>\r\n                          " +
                                 "  ");



            #line 52 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    Write(Strings.Common_DeleteSelected);


            #line default
            #line hidden
                    WriteLiteral("\r\n                        </button>\r\n");



            #line 54 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                    ");



            #line 55 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                Write(Html.PerPageSelector(pager));


            #line default
            #line hidden
                WriteLiteral("\r\n                </div>\r\n\r\n                <div class=\"table-responsive\">\r\n     " +
                             "               <table class=\"table\">\r\n                        <thead>\r\n         " +
                             "               <tr>\r\n");



            #line 62 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                if (!IsReadOnly)
                {
            #line default
            #line hidden
                    WriteLiteral("                                <th class=\"min-width\">\r\n                         " +
                                 "           <input type=\"checkbox\" class=\"js-jobs-list-select-all\"/>\r\n           " +
                                 "                     </th>\r\n");



            #line 67 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                            <th class=\"min-width\">");



            #line 68 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                Write(Strings.Common_Id);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th class=\"min-width\">");



            #line 69 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                Write(Strings.Common_State);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 70 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                Write(Strings.Common_Job);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th class=\"align-right\">");



            #line 71 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                Write(Strings.Common_Enqueued);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                        </tr>\r\n                        </thead>\r\n         " +
                             "               <tbody>\r\n");



            #line 75 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                foreach (var job in enqueuedJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                            <tr class=\"js-jobs-list-row hover ");



            #line 77 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    Write(job.Value == null || !job.Value.InEnqueuedState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n");



            #line 78 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    if (!IsReadOnly)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <td>\r\n");



            #line 81 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                        if (job.Value != null)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                            <input type=\"checkbox\" class=\"js-jobs" +
                                         "-list-checkbox\" name=\"jobs[]\" value=\"");



            #line 83 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                            Write(job.Key);


            #line default
            #line hidden
                            WriteLiteral("\"/>\r\n");



            #line 84 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                    </td>\r\n");



            #line 86 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                <td class=\"min-width\">\r\n                         " +
                                 "           ");



            #line 88 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    Write(Html.JobIdLink(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n");



            #line 89 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    if (job.Value != null && !job.Value.InEnqueuedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <span title=\"");



            #line 91 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                        Write(Strings.Common_JobStateChanged_Text);


            #line default
            #line hidden
                        WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");



            #line 92 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                </td>\r\n");



            #line 94 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    if (job.Value == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <td colspan=\"3\"><em>");



            #line 96 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                        Write(Strings.Common_JobExpired);


            #line default
            #line hidden
                        WriteLiteral("</em></td>\r\n");



            #line 97 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <td class=\"min-width\">\r\n                     " +
                                     "                   ");



            #line 101 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                        Write(Html.StateLabel(job.Value.State));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                    </td>\r\n");



                        WriteLiteral("                                    <td class=\"word-break\">\r\n                    " +
                                     "                    ");



            #line 104 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                        Write(Html.JobNameLink(job.Key, job.Value.Job));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                    </td>\r\n");



                        WriteLiteral("                                    <td class=\"align-right\">\r\n");



            #line 107 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                        if (job.Value.EnqueuedAt.HasValue)
                        {
            #line default
            #line hidden

            #line 109 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                            Write(Html.RelativeTime(job.Value.EnqueuedAt.Value));


            #line default
            #line hidden

            #line 109 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                            <em>");



            #line 113 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                            Write(Strings.Common_NotAvailable);


            #line default
            #line hidden
                            WriteLiteral("</em>\r\n");



            #line 114 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                    </td>\r\n");



            #line 116 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                            </tr>\r\n");



            #line 118 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                        </tbody>\r\n                    </table>\r\n                <" +
                             "/div>\r\n\r\n                ");



            #line 123 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                Write(Html.Paginator(pager));


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 125 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #49
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 9 "..\..\Dashboard\Pages\SucceededJobs.cshtml"

            Layout = new LayoutPage {
                Title = "Succeeded Jobs"
            };

            int from, perPage;

            int.TryParse(Request.Query["from"], out from);
            int.TryParse(Request.Query["count"], out perPage);

            var   monitor = Storage.GetMonitoringApi();
            Pager pager   = new Pager(from, perPage, monitor.SucceededListCount())
            {
                BasePageUrl = Request.LinkTo("/succeeded")
            };

            JobList <SucceededJobDto> succeededJobs = monitor
                                                      .SucceededJobs(pager.FromRecord, pager.RecordsPerPage);



            #line default
            #line hidden
            WriteLiteral("\r\n");



            #line 27 "..\..\Dashboard\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 32 "..\..\Dashboard\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 38 "..\..\Dashboard\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 44 "..\..\Dashboard\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 60 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                foreach (var job in succeededJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <tr class=\"js-jobs-list-row ");



            #line 62 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    Write(job.Value != null && !job.Value.InSucceededState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral(" ");



            #line 62 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    Write(job.Value != null && job.Value.InSucceededState ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                        <td>\r\n");



            #line 64 "..\..\Dashboard\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 66 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        Write(job.Key);


            #line default
            #line hidden
                        WriteLiteral("\" />\r\n");



            #line 67 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n  " +
                                 "                          <a href=\"");



            #line 70 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                ");



            #line 71 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n                            </a>\r\n");



            #line 73 "..\..\Dashboard\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 76 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n\r\n");



            #line 79 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    if (job.Value == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <td colspan=\"3\">\r\n                                <em" +
                                     ">Job has expired.</em>\r\n                            </td>\r\n");



            #line 84 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <td>\r\n                                <a class=\"job-m" +
                                     "ethod\" href=\"");



            #line 88 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                    ");



            #line 89 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        Write(HtmlHelper.DisplayJob(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 93 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        if (job.Value.TotalDuration.HasValue)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                    ");

                            WriteLiteral(" ");



            #line 95 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                            Write(HtmlHelper.ToHumanDuration(TimeSpan.FromMilliseconds(job.Value.TotalDuration.Value), false));


            #line default
            #line hidden
                            WriteLiteral("\r\n");



            #line 96 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                            </td>\r\n");



                        WriteLiteral("                            <td class=\"min-width align-right\">\r\n");



            #line 99 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        if (job.Value.SucceededAt.HasValue)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                    <span data-moment=\"");



            #line 101 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                            Write(JobHelper.ToTimestamp(job.Value.SucceededAt.Value));


            #line default
            #line hidden
                            WriteLiteral("\">\r\n                                        ");



            #line 102 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                            Write(job.Value.SucceededAt);


            #line default
            #line hidden
                            WriteLiteral("\r\n                                    </span>\r\n");



            #line 104 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                            </td>\r\n");



            #line 106 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </tr>\r\n");



            #line 108 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");



            #line 112 "..\..\Dashboard\Pages\SucceededJobs.cshtml"


            #line default
            #line hidden

            #line 112 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
                Write(RenderPartial(new Paginator(pager)));


            #line default
            #line hidden

            #line 112 "..\..\Dashboard\Pages\SucceededJobs.cshtml"
            }


            #line default
            #line hidden
        }
コード例 #50
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 7 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"

            Layout = new LayoutPage {
                Title = "Scheduled Jobs"
            };

            int from, perPage;

            int.TryParse(Request.Query["from"], out from);
            int.TryParse(Request.Query["count"], out perPage);

            var   monitor = Storage.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("\r\n");



            #line 24 "..\..\Dashboard\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 29 "..\..\Dashboard\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 35 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                foreach (var job in scheduledJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                <tr class=\"js-jobs-list-row ");



            #line 66 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    Write(!job.Value.InScheduledState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral(" ");



            #line 66 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    Write(job.Value.InScheduledState ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                    <td>\r\n");



            #line 68 "..\..\Dashboard\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 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                        Write(job.Key);


            #line default
            #line hidden
                        WriteLiteral("\" />\r\n");



            #line 71 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </td>\r\n                    <td class=\"min-width\">\r\n          " +
                                 "              <a href=\"");



            #line 74 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                            ");



            #line 75 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n                        </a>\r\n");



            #line 77 "..\..\Dashboard\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 80 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </td>\r\n                    <td class=\"min-width\">\r\n          " +
                                 "              <span data-moment=\"");



            #line 83 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    Write(JobHelper.ToTimestamp(job.Value.EnqueueAt));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                            ");



            #line 84 "..\..\Dashboard\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 88 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                            ");



            #line 89 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    Write(HtmlHelper.DisplayJob(job.Value.Job));


            #line default
            #line hidden
                    WriteLiteral("\r\n                        </a>\r\n                    </td>\r\n                    <t" +
                                 "d class=\"align-right\">\r\n");



            #line 93 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    if (job.Value.ScheduledAt != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <span data-moment=\"");



            #line 95 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                        Write(JobHelper.ToTimestamp(job.Value.ScheduledAt.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                ");



            #line 96 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                        Write(job.Value.ScheduledAt);


            #line default
            #line hidden
                        WriteLiteral("\r\n                            </span>\r\n");



            #line 98 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </td>\r\n                </tr>\r\n");



            #line 101 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("        </table>\r\n    </div>\r\n");



            #line 104 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"



            #line default
            #line hidden

            #line 105 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                Write(RenderPartial(new Paginator(pager)));


            #line default
            #line hidden

            #line 105 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
            }


            #line default
            #line hidden
        }
コード例 #51
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 10 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"

            Layout = new LayoutPage {
                Title = "Recurring jobs"
            };
            List <RecurringJobDto> recurringJobs;

            using (var connection = Storage.GetConnection())
            {
                recurringJobs = connection.GetRecurringJobs();
            }



            #line default
            #line hidden
            WriteLiteral("\r\n");



            #line 20 "..\..\Dashboard\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 25 "..\..\Dashboard\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 31 "..\..\Dashboard\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 38 "..\..\Dashboard\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 (UTC)</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 60 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                foreach (var job in recurringJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <tr class=\"js-jobs-list-row hover\">\r\n                        " +
                                 "<td>\r\n                            <input type=\"checkbox\" class=\"js-jobs-list-che" +
                                 "ckbox\" name=\"jobs[]\" value=\"");



            #line 64 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(job.Id);


            #line default
            #line hidden
                    WriteLiteral("\" />\r\n                        </td>\r\n                        <td class=\"min-width" +
                                 "\">");



            #line 66 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(job.Id);


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                        <td class=\"min-width\">");



            #line 67 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    Write(ExpressionDescriptor.GetDescription(job.Cron));


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                        <td>\r\n");



            #line 69 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.Job != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                ");

                        WriteLiteral(" ");



            #line 71 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(HtmlHelper.DisplayJob(job.Job));


            #line default
            #line hidden
                        WriteLiteral("\r\n");



            #line 72 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <em>");



            #line 75 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(job.LoadException.InnerException.Message);


            #line default
            #line hidden
                        WriteLiteral("</em>\r\n");



            #line 76 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"align-right min" +
                                 "-width\">\r\n");



            #line 79 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.NextExecution != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span data-moment=\"");



            #line 81 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(JobHelper.ToTimestamp(job.NextExecution.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                    ");



            #line 82 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        Write(job.NextExecution.Value);


            #line default
            #line hidden
                        WriteLiteral("\r\n                                </span>\r\n");



            #line 84 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <em>N/A</em>\r\n");



            #line 88 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"align-right min" +
                                 "-width\">\r\n");



            #line 91 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    if (job.LastExecution != null)
                    {
                        if (!String.IsNullOrEmpty(job.LastJobId))
                        {
            #line default
            #line hidden
                            WriteLiteral("                                    <a href=\"");



            #line 95 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.LastJobId));


            #line default
            #line hidden
                            WriteLiteral("\">\r\n                                        <span class=\"label label-default labe" +
                                         "l-hover\" data-moment=\"");



            #line 96 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(JobHelper.ToTimestamp(job.LastExecution.Value));


            #line default
            #line hidden
                            WriteLiteral("\" style=\"");



            #line 96 "..\..\Dashboard\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 97 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(job.LastExecution.Value);


            #line default
            #line hidden
                            WriteLiteral("\r\n                                        </span>\r\n                              " +
                                         "      </a>\r\n");



            #line 100 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                    <em>\r\n                                       " +
                                         " Canceled\r\n                                        <span data-moment=\"");



            #line 105 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(JobHelper.ToTimestamp(job.LastExecution.Value));


            #line default
            #line hidden
                            WriteLiteral("\">\r\n                                            ");



            #line 106 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                            Write(job.LastExecution.Value);


            #line default
            #line hidden
                            WriteLiteral("\r\n                                        </span>\r\n                              " +
                                         "      </em>\r\n");



            #line 109 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                        }
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <em>N/A</em>\r\n");



            #line 114 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                    </tr>\r\n");



            #line 117 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");



            #line 121 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    ");
        }
コード例 #52
0
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
  
    Layout = new LayoutPage("Processing Jobs");

    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    var monitor = Storage.GetMonitoringApi();
    var pager = new Pager(from, perPage, monitor.ProcessingCount());
    var processingJobs = monitor.ProcessingJobs(pager.FromRecord, pager.RecordsPerPage);
    var servers = monitor.Servers();


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 23 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">Process" +
"ing Jobs</h1>\r\n\r\n");


            
            #line 28 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
         if (pager.TotalPageCount == 0)
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"alert alert-info\">\r\n                No jobs are being pro" +
"cessed right now.\r\n            </div>\r\n");


            
            #line 33 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
        }
        else
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
"tn-toolbar-top\">\r\n                    <button class=\"js-jobs-list-command btn bt" +
"n-sm btn-primary\"\r\n                            data-url=\"");


            
            #line 39 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                 Write(Url.To("/jobs/processing/requeue"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                            data-loading-text=""Enqueueing...""
                            disabled=""disabled"">
                        <span class=""glyphicon glyphicon-repeat""></span>
                        Requeue jobs
                    </button>

                    <button class=""js-jobs-list-command btn btn-sm btn-default""
                            data-url=""");


            
            #line 47 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                 Write(Url.To("/jobs/processing/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                            data-loading-text=""Deleting...""
                            data-confirm=""Do you really want to DELETE ALL selected jobs?""
                            disabled=""disabled"">
                        <span class=""glyphicon glyphicon-remove""></span>
                        Delete selected
                    </button>

                    ");


            
            #line 55 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
               Write(Html.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 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                     foreach (var job in processingJobs)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <tr class=\"js-jobs-list-row ");


            
            #line 73 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                                Write(!job.Value.InProcessingState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 73 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                                                                                         Write(job.Value.InProcessingState ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            <td>\r\n");


            
            #line 75 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                 if (job.Value.InProcessingState)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <input type=\"checkbox\" class=\"js-jobs-list-ch" +
"eckbox\" name=\"jobs[]\" value=\"");


            
            #line 77 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                                                                                         Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\"/>\r\n");


            
            #line 78 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                            <td class=\"min-wid" +
"th\">\r\n                                ");


            
            #line 81 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                           Write(Html.JobIdLink(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 82 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                 if (!job.Value.InProcessingState)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span title=\"Job\'s state has been changed whi" +
"le fetching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 85 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                            <td class=\"min-wid" +
"th\">\r\n                                ");


            
            #line 88 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                           Write(job.Value.ServerId.ToUpperInvariant());

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </td>\r\n                            <td>\r\n");


            
            #line 91 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                 if (servers.All(x => x.Name != job.Value.ServerId || x.Heartbeat < DateTime.UtcNow.AddMinutes(-1)))
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span title=\"Looks like the job was aborted\" " +
"class=\"glyphicon glyphicon-warning-sign\" style=\"font-size: 10px;\"></span>\r\n");


            
            #line 94 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                                \r\n                                ");


            
            #line 96 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                           Write(Html.JobNameLink(job.Key, job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </td>\r\n                            <td class=\"align" +
"-right\">\r\n");


            
            #line 99 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                 if (job.Value.StartedAt.HasValue)
                                {
                                    
            
            #line default
            #line hidden
            
            #line 101 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                               Write(Html.RelativeTime(job.Value.StartedAt.Value));

            
            #line default
            #line hidden
            
            #line 101 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                                                                                 
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                        </tr>\r\n");


            
            #line 105 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                    </tbody>\r\n                </table>\r\n\r\n                ");


            
            #line 109 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
           Write(Html.Paginator(pager));

            
            #line default
            #line hidden
WriteLiteral("\r\n            </div>\r\n");


            
            #line 111 "..\..\Dashboard\Pages\ProcessingJobsPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </div>\r\n</div>");


        }
コード例 #53
0
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
  
    Layout = new LayoutPage(Queue.ToUpperInvariant());

    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    var monitor = Storage.GetMonitoringApi();
    var pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue));
    var enqueuedJobs = monitor.EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");


            
            #line 22 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
   Write(Html.JobsSidebar());

            
            #line default
            #line hidden
WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        ");


            
            #line 25 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
   Write(Html.Breadcrumbs(Queue.ToUpperInvariant(), new Dictionary<string, string>
        {
            { "Queues", Url.LinkToQueues() }
        }));

            
            #line default
            #line hidden
WriteLiteral("\r\n\r\n        <h1 class=\"page-header\">");


            
            #line 30 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                           Write(Queue.ToUpperInvariant());

            
            #line default
            #line hidden
WriteLiteral(" <small>Enqueued jobs</small></h1>\r\n\r\n");


            
            #line 32 "..\..\Dashboard\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 37 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
        }
        else
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
"tn-toolbar-top\">\r\n                    <button class=\"js-jobs-list-command btn bt" +
"n-sm btn-default\"\r\n                            data-url=\"");


            
            #line 43 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                 Write(Url.To("/jobs/enqueued/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                            data-loading-text=""Deleting...""
                            data-confirm=""Do you really want to DELETE ALL selected jobs?""
                            disabled=""disabled"">
                        <span class=""glyphicon glyphicon-remove""></span>
                        Delete selected
                    </button>

                    ");


            
            #line 51 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
               Write(Html.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 67 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                     foreach (var job in enqueuedJobs)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <tr class=\"js-jobs-list-row hover ");


            
            #line 69 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                                      Write(!job.Value.InEnqueuedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            <td>\r\n                                <input type" +
"=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\"");


            
            #line 71 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                                                                                     Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\"/>\r\n                            </td>\r\n                            <td class=\"mi" +
"n-width\">\r\n                                ");


            
            #line 74 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                           Write(Html.JobIdLink(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 75 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                 if (!job.Value.InEnqueuedState)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span title=\"Job\'s state has been changed whi" +
"le fetching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 78 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                            <td class=\"min-wid" +
"th\">\r\n                                ");


            
            #line 81 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                           Write(Html.StateLabel(job.Value.State));

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </td>\r\n                            <td>\r\n          " +
"                      ");


            
            #line 84 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                           Write(Html.JobNameLink(job.Key, job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </td>\r\n                            <td class=\"align" +
"-right\">\r\n");


            
            #line 87 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                 if (job.Value.EnqueuedAt.HasValue)
                                {
                                    
            
            #line default
            #line hidden
            
            #line 89 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                               Write(Html.RelativeTime(job.Value.EnqueuedAt.Value));

            
            #line default
            #line hidden
            
            #line 89 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                                                                  
                                }
                                else
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <em>n/a</em>\r\n");


            
            #line 94 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                        </tr>\r\n");


            
            #line 97 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                    </tbody>\r\n                </table>\r\n\r\n                ");


            
            #line 101 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
           Write(Html.Paginator(pager));

            
            #line default
            #line hidden
WriteLiteral("\r\n            </div>\r\n");


            
            #line 103 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </div>\r\n</div>");


        }
コード例 #54
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 14 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

            var monitor = Storage.GetMonitoringApi();
            var job     = monitor.JobDetails(JobId);

            string title = null;

            if (job != null)
            {
                title = job.Job != null?Html.JobName(job.Job) : null;

                job.History.Add(new StateHistoryDto {
                    StateName = "Created", CreatedAt = job.CreatedAt ?? default(DateTime)
                });
            }

            title  = title ?? Strings.Common_Job;
            Layout = new LayoutPage(title);



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 32 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");



            #line 35 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            Write(title);


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n");



            #line 37 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            if (job == null)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-warning\">\r\n                ");



            #line 40 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                Write(String.Format(Strings.JobDetailsPage_JobExpired, JobId));


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 42 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            }
            else
            {
                var currentState = job.History[0];
                if (currentState.StateName == ProcessingState.StateName)
                {
                    var server = monitor.Servers().FirstOrDefault(x => x.Name == currentState.Data["ServerId"]);
                    if (server == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <div class=\"alert alert-danger\">\r\n                        ");



            #line 52 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Html.Raw(String.Format(Strings.JobDetailsPage_JobAbortedNotActive_Warning_Html, currentState.Data["ServerId"], Url.To("/servers"))));


            #line default
            #line hidden
                        WriteLiteral("\r\n                    </div>\r\n");



            #line 54 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }
                    else if (server.Heartbeat.HasValue && server.Heartbeat < DateTime.UtcNow.AddMinutes(-1))
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <div class=\"alert alert-warning\">\r\n                        ");



            #line 58 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Html.Raw(String.Format(Strings.JobDetailsPage_JobAbortedWithHeartbeat_Warning_Html, server.Name)));


            #line default
            #line hidden
                        WriteLiteral("\r\n                    </div>\r\n");



            #line 60 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }
                }

                if (job.ExpireAt.HasValue)
                {
            #line default
            #line hidden
                    WriteLiteral("                <div class=\"alert alert-info\">\r\n                    ");



            #line 66 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Html.Raw(String.Format(Strings.JobDetailsPage_JobFinished_Warning_Html, JobHelper.ToTimestamp(job.ExpireAt.Value), job.ExpireAt)));


            #line default
            #line hidden
                    WriteLiteral("\r\n                </div>\r\n");



            #line 68 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }

                if (job.Job != null)
                {
            #line default
            #line hidden
                    WriteLiteral("                <div class=\"job-snippet\">\r\n                    <div class=\"job-sn" +
                                 "ippet-code\">\r\n                        <pre><code><span class=\"comment\">// ");



            #line 74 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Strings.JobDetailsPage_JobId);


            #line default
            #line hidden
                    WriteLiteral(": ");



            #line 74 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Html.JobId(JobId.ToString(), false));


            #line default
            #line hidden
                    WriteLiteral("</span>\r\n");



            #line 75 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(JobMethodCallRenderer.Render(job.Job));


            #line default
            #line hidden
                    WriteLiteral("\r\n</code></pre>\r\n                    </div>\r\n                </div>\r\n");



            #line 79 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }
                else
                {
                    var dbgProperties = job.Properties.Where(x => x.Key.StartsWith("DBG_")).ToArray();



            #line default
            #line hidden
                    WriteLiteral("                <div class=\"alert alert-warning\">\r\n                    <h4>");



            #line 85 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Strings.Common_CannotFindTargetMethod);


            #line default
            #line hidden
                    WriteLiteral("</h4>\r\n                    <table class=\"table table-condensed job-snippet-proper" +
                                 "ties\" style=\"margin-bottom: 0;\">\r\n                        <tr>\r\n                " +
                                 "            <td>");



            #line 88 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Strings.JobDetailsPage_JobId);


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                            <td><pre><code>");



            #line 89 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(Html.JobId(JobId, false));


            #line default
            #line hidden
                    WriteLiteral("</code></pre></td>\r\n                        </tr>\r\n");



            #line 91 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    foreach (var property in dbgProperties)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <tr>\r\n                                <td style=\"widt" +
                                     "h: 15%;\">");



            #line 94 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(property.Key.Substring(4));


            #line default
            #line hidden
                        WriteLiteral("</td>\r\n                                <td><pre><code>");



            #line 95 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(property.Value);


            #line default
            #line hidden
                        WriteLiteral("</code></pre></td>\r\n                            </tr>\r\n");



            #line 97 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </table>\r\n                </div>\r\n");



            #line 100 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }

                var displayProperties = job.Properties.Where(x => !x.Key.StartsWith("DBG_") && x.Key != "Continuations").ToArray();

                if (displayProperties.Length > 0)
                {
            #line default
            #line hidden
                    WriteLiteral("                <h3>Properties</h3>\r\n");



                    WriteLiteral("                <table class=\"table table-condensed job-snippet-properties\">\r\n");



            #line 108 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    foreach (var property in displayProperties)
                    {
            #line default
            #line hidden
                        WriteLiteral("                        <tr>\r\n                            <td style=\"width: 20%; " +
                                     "word-break: break-all;\">");



            #line 111 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(property.Key);


            #line default
            #line hidden
                        WriteLiteral("</td>\r\n                            <td><pre><code>");



            #line 112 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(property.Value);


            #line default
            #line hidden
                        WriteLiteral("</code></pre></td>\r\n                        </tr>\r\n");



            #line 114 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                </table>\r\n");



            #line 116 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }

                if (job.Properties.TryGetValue("Continuations", out var serializedContinuations))
                {
                    var continuations = ContinuationsSupportAttribute.DeserializeContinuations(serializedContinuations);

                    if (continuations.Count > 0)
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <h3>");



            #line 124 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Continuations);


            #line default
            #line hidden
                        WriteLiteral("</h3>\r\n");



                        WriteLiteral("                    <div class=\"table-responsive\">\r\n                        <tabl" +
                                     "e class=\"table\">\r\n                            <thead>\r\n                         " +
                                     "   <tr>\r\n                                <th class=\"min-width\">");



            #line 129 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Id);


            #line default
            #line hidden
                        WriteLiteral("</th>\r\n                                <th class=\"min-width\">");



            #line 130 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Condition);


            #line default
            #line hidden
                        WriteLiteral("</th>\r\n                                <th class=\"min-width\">");



            #line 131 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_State);


            #line default
            #line hidden
                        WriteLiteral("</th>\r\n                                <th>");



            #line 132 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Job);


            #line default
            #line hidden
                        WriteLiteral("</th>\r\n                                <th class=\"align-right\">");



            #line 133 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Created);


            #line default
            #line hidden
                        WriteLiteral("</th>\r\n                            </tr>\r\n                            </thead>\r\n " +
                                     "                           <tbody>\r\n");



            #line 137 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        foreach (var continuation in continuations)
                        {
                            JobData jobData;

                            using (var connection = Storage.GetConnection())
                            {
                                jobData = connection.GetJobData(continuation.JobId);
                            }



            #line default
            #line hidden
                            WriteLiteral("                                <tr>\r\n");



            #line 147 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            if (jobData == null)
                            {
            #line default
            #line hidden
                                WriteLiteral("                                        <td colspan=\"5\"><em>");



            #line 149 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(String.Format(Strings.JobDetailsPage_JobExpired, continuation.JobId));


            #line default
            #line hidden
                                WriteLiteral("</em></td>\r\n");



            #line 150 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            }
                            else
                            {
            #line default
            #line hidden
                                WriteLiteral("                                        <td class=\"min-width\">");



            #line 153 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(Html.JobIdLink(continuation.JobId));


            #line default
            #line hidden
                                WriteLiteral("</td>\r\n");



                                WriteLiteral("                                        <td class=\"min-width\"><code>");



            #line 154 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(continuation.Options.ToString("G"));


            #line default
            #line hidden
                                WriteLiteral("</code></td>\r\n");



                                WriteLiteral("                                        <td class=\"min-width\">");



            #line 155 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(Html.StateLabel(jobData.State));


            #line default
            #line hidden
                                WriteLiteral("</td>\r\n");



                                WriteLiteral("                                        <td class=\"word-break\">");



            #line 156 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(Html.JobNameLink(continuation.JobId, jobData.Job));


            #line default
            #line hidden
                                WriteLiteral("</td>\r\n");



                                WriteLiteral("                                        <td class=\"align-right\">");



            #line 157 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(Html.RelativeTime(jobData.CreatedAt));


            #line default
            #line hidden
                                WriteLiteral("</td>\r\n");



            #line 158 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            }


            #line default
            #line hidden
                            WriteLiteral("                                </tr>\r\n");



            #line 160 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                            </tbody>\r\n                        </table>\r\n         " +
                                     "           </div>\r\n");



            #line 164 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }
                }



            #line default
            #line hidden
                WriteLiteral("            <h3>\r\n");



            #line 168 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                if (job.History.Count > 1)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <span class=\"job-snippet-buttons pull-right\">\r\n");



            #line 171 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    if (!IsReadOnly)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <button class=\"btn btn-sm btn-default\"\r\n             " +
                                     "                       data-ajax=\"");



            #line 174 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Url.To("/jobs/actions/requeue/" + JobId));


            #line default
            #line hidden
                        WriteLiteral("\"\r\n                                    data-loading-text=\"");



            #line 175 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Enqueueing);


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                ");



            #line 176 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.JobDetailsPage_Requeue);


            #line default
            #line hidden
                        WriteLiteral("\r\n                            </button>\r\n");



            #line 178 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }


            #line default
            #line hidden


            #line 179 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    if (!IsReadOnly)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <button class=\"btn btn-sm btn-death\"\r\n               " +
                                     "                     data-ajax=\"");



            #line 182 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Url.To("/jobs/actions/delete/" + JobId));


            #line default
            #line hidden
                        WriteLiteral("\"\r\n                                    data-loading-text=\"");



            #line 183 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Deleting);


            #line default
            #line hidden
                        WriteLiteral("\"\r\n                                    data-confirm=\"");



            #line 184 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.JobDetailsPage_DeleteConfirm);


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                ");



            #line 185 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Strings.Common_Delete);


            #line default
            #line hidden
                        WriteLiteral("\r\n                            </button>\r\n");



            #line 187 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </span>\r\n");



            #line 189 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("\r\n                ");



            #line 191 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                Write(Strings.JobDetailsPage_State);


            #line default
            #line hidden
                WriteLiteral("\r\n            </h3>\r\n");



            #line 193 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

                var index = 0;

                foreach (var entry in job.History)
                {
                    var accentColor     = JobHistoryRenderer.GetForegroundStateColor(entry.StateName);
                    var backgroundColor = JobHistoryRenderer.GetBackgroundStateColor(entry.StateName);



            #line default
            #line hidden
                    WriteLiteral("                <div class=\"state-card\" style=\"");



            #line 201 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(index == 0 ? $"border-color: {accentColor}" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                    <h4 class=\"state-card-title\" style=\"");



            #line 202 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(index == 0 ? $"color: {accentColor}" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                        <small class=\"pull-right text-muted\">\r\n");



            #line 204 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    if (index == job.History.Count - 1)
                    {
            #line default
            #line hidden

            #line 206 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(Html.RelativeTime(entry.CreatedAt));


            #line default
            #line hidden

            #line 206 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }
                    else
                    {
                        var duration = Html.ToHumanDuration(entry.CreatedAt - job.History[index + 1].CreatedAt);

                        if (index == 0)
                        {
            #line default
            #line hidden
                            WriteLiteral("                                    ");

                            WriteLiteral(" ");



            #line 214 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            Write(Html.RelativeTime(entry.CreatedAt));


            #line default
            #line hidden
                            WriteLiteral(" (");



            #line 214 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            Write(duration);


            #line default
            #line hidden
                            WriteLiteral(")\r\n");



            #line 215 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                                    ");

                            WriteLiteral(" ");



            #line 218 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            Write(Html.MomentTitle(entry.CreatedAt, duration));


            #line default
            #line hidden
                            WriteLiteral("\r\n");



            #line 219 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        }
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </small>\r\n\r\n                        ");



            #line 223 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    Write(entry.StateName);


            #line default
            #line hidden
                    WriteLiteral("\r\n                    </h4>\r\n\r\n");



            #line 226 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    if (!String.IsNullOrWhiteSpace(entry.Reason))
                    {
            #line default
            #line hidden
                        WriteLiteral("                        <p class=\"state-card-text text-muted\">");



            #line 228 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(entry.Reason);


            #line default
            #line hidden
                        WriteLiteral("</p>\r\n");



            #line 229 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("\r\n");



            #line 231 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

                    var rendered = Html.RenderHistory(entry.StateName, entry.Data);



            #line default
            #line hidden
                    WriteLiteral("\r\n");



            #line 235 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    if (rendered != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                        <div class=\"state-card-body\" style=\"");



            #line 237 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(index == 0 ? $"background-color: {backgroundColor}" : null);


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                            ");



            #line 238 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        Write(rendered);


            #line default
            #line hidden
                        WriteLiteral("\r\n                        </div>\r\n");



            #line 240 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                </div>\r\n");



            #line 242 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

                    index++;
                }
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #55
0
        public override void Execute()
        {


WriteLiteral("\r\n");











            
            #line 11 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
  
    var monitor = JobStorage.Current.GetMonitoringApi();
    JobDetailsDto job = monitor.JobDetails(JobId.ToString());

    string title = null;

    if (job != null)
    {
        title = job.Job != null ? HtmlHelper.DisplayJob(job.Job) : null;
    }

    title = title ?? "Job";

    Layout = new LayoutPage { Title = title };


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 27 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
 if (job == null)
{

            
            #line default
            #line hidden
WriteLiteral("    ");

WriteLiteral(" The job with id \'");


            
            #line 29 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                   Write(JobId);

            
            #line default
            #line hidden
WriteLiteral("\' has expired or could not be found on the server.\r\n");


            
            #line 30 "..\..\Dashboard\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 35 "..\..\Dashboard\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 39 "..\..\Dashboard\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 40 "..\..\Dashboard\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 47 "..\..\Dashboard\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 51 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                  Write(JobHelper.ToTimestamp(job.CreatedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\"></span>\r\n                </div>\r\n");


            
            #line 53 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            }

            
            #line default
            #line hidden

            
            #line 54 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
             if (job != null)
            {

            
            #line default
            #line hidden
WriteLiteral("                <pre><code>");


            
            #line 56 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                      Write(JobMethodCallRenderer.Render(job.Job));

            
            #line default
            #line hidden
WriteLiteral("</code></pre>\r\n");


            
            #line 57 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"clearfix\"></div>\r\n        </div>\r\n\r\n");


            
            #line 61 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
         if (job.Properties.Count > 0)
        {

            
            #line default
            #line hidden
WriteLiteral("            <div class=\"job-snippet-properties\">\r\n                <dl>\r\n");


            
            #line 65 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                     foreach (var property in job.Properties)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <dt>");


            
            #line 67 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                       Write(property.Key);

            
            #line default
            #line hidden
WriteLiteral("</dt>\r\n");



WriteLiteral("                        <dd>\r\n                            <pre>");


            
            #line 69 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            Write(property.Value);

            
            #line default
            #line hidden
WriteLiteral("</pre>\r\n                        </dd>\r\n");


            
            #line 71 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </dl>\r\n            </div>\r\n");


            
            #line 74 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </div>\r\n");


            
            #line 76 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

    if (job.History.Count > 0)
    {

            
            #line default
            #line hidden
WriteLiteral("        <h3>History</h3>\r\n");


            
            #line 80 "..\..\Dashboard\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 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                Write(index == 0 ? "job-history-current" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                <div class=\"job-history-heading\" style=\"");


            
            #line 99 "..\..\Dashboard\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 100 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                                                            Write(JobHelper.ToTimestamp(entry.CreatedAt));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        ");


            
            #line 101 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                   Write(HtmlHelper.ToHumanDuration(entry.CreatedAt - (nextEntry < entriesCreationTime.Length ? entriesCreationTime[nextEntry] : job.CreatedAt)));

            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 102 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                           nextEntry++; 

            
            #line default
            #line hidden
WriteLiteral("                    </span>\r\n                    <h4 class=\"job-history-title\">\r\n" +
"                        ");


            
            #line 105 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                   Write(entry.StateName);

            
            #line default
            #line hidden
WriteLiteral("\r\n\r\n");


            
            #line 107 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                         if (!String.IsNullOrWhiteSpace(entry.Reason))
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <small>");


            
            #line 109 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                              Write(entry.Reason);

            
            #line default
            #line hidden
WriteLiteral("</small>\r\n");


            
            #line 110 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </h4>\r\n                </div>\r\n\r\n");


            
            #line 114 "..\..\Dashboard\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 120 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                       Write(rendered);

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </div>\r\n");


            
            #line 122 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                    }
                }
                else
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div class=\"job-history-body\">\r\n                        <dl c" +
"lass=\"dl-horizontal\">\r\n");


            
            #line 128 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                             foreach (var item in entry.Data)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <dt>");


            
            #line 130 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                               Write(item.Key);

            
            #line default
            #line hidden
WriteLiteral(":</dt>\r\n");



WriteLiteral("                                <dd>");


            
            #line 131 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                               Write(item.Value);

            
            #line default
            #line hidden
WriteLiteral("</dd>\r\n");


            
            #line 132 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </dl>\r\n                    </div>\r\n");


            
            #line 135 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </div>\r\n");


            
            #line 137 "..\..\Dashboard\Pages\JobDetailsPage.cshtml"

                index++;
        }
    }
}
            
            #line default
            #line hidden

        }
コード例 #56
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 10 "..\..\Dashboard\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.Query["from"], out from);
            int.TryParse(Request.Query["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("\r\n");



            #line 36 "..\..\Dashboard\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 41 "..\..\Dashboard\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 47 "..\..\Dashboard\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 "..\..\Dashboard\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 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                foreach (var job in enqueuedJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <tr class=\"js-jobs-list-row hover ");



            #line 72 "..\..\Dashboard\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 74 "..\..\Dashboard\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 77 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                ");



            #line 78 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    Write(HtmlHelper.JobId(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n                            </a>\r\n");



            #line 80 "..\..\Dashboard\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 83 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n  " +
                                 "                          <span class=\"label label-default\" style=\"");



            #line 86 "..\..\Dashboard\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 87 "..\..\Dashboard\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 91 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    Write(Request.LinkTo("/job/" + job.Key));


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                ");



            #line 92 "..\..\Dashboard\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 96 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    if (job.Value.EnqueuedAt.HasValue)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <span data-moment=\"");



            #line 98 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                        Write(JobHelper.ToTimestamp(job.Value.EnqueuedAt.Value));


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                    ");



            #line 99 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                        Write(job.Value.EnqueuedAt);


            #line default
            #line hidden
                        WriteLiteral("\r\n                                </span>\r\n");



            #line 101 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                <em>n/a</em>\r\n");



            #line 105 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                        </td>\r\n                    </tr>\r\n");



            #line 108 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");



            #line 112 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"


            #line default
            #line hidden

            #line 112 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
                Write(RenderPartial(new Paginator(pager)));


            #line default
            #line hidden

            #line 112 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml"
            }


            #line default
            #line hidden
        }
コード例 #57
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 8 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"

            Layout = new LayoutPage(Queue.ToUpperInvariant());

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            var monitor     = Storage.GetMonitoringApi();
            var pager       = new Pager(from, perPage, monitor.FetchedCount(Queue));
            var fetchedJobs = monitor.FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 23 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        ");



            #line 26 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
            Write(Html.Breadcrumbs(Strings.FetchedJobsPage_Title, new Dictionary <string, string>
            {
                { "Queues", Url.LinkToQueues() },
                { Queue.ToUpperInvariant(), Url.Queue(Queue) }
            }));


            #line default
            #line hidden
            WriteLiteral("\r\n\r\n        <h1 class=\"page-header\">\r\n            ");



            #line 33 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
            Write(Queue.ToUpperInvariant());


            #line default
            #line hidden
            WriteLiteral(" <small>");



            #line 33 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
            Write(Strings.FetchedJobsPage_Title);


            #line default
            #line hidden
            WriteLiteral("</small>\r\n        </h1>\r\n\r\n");



            #line 36 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("        <div class=\"alert alert-info\">\r\n            ");



            #line 39 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Strings.FetchedJobsPage_NoJobs);


            #line default
            #line hidden
                WriteLiteral("\r\n        </div>\r\n");



            #line 41 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("        <div class=\"js-jobs-list\">\r\n            <div class=\"btn-toolbar btn-toolb" +
                             "ar-top\">\r\n                <button class=\"js-jobs-list-command btn btn-sm btn-pri" +
                             "mary\"\r\n                        data-url=\"");



            #line 47 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Url.To("/jobs/enqueued/requeue"));


            #line default
            #line hidden
                WriteLiteral("\"\r\n                        data-loading-text=\"");



            #line 48 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Strings.Common_Enqueueing);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                        disabled=\"disabled\">\r\n                    <span class=" +
                             "\"glyphicon glyphicon-repeat\"></span>\r\n                    ");



            #line 51 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Strings.Common_RequeueJobs);


            #line default
            #line hidden
                WriteLiteral("\r\n                </button>\r\n\r\n                <button class=\"js-jobs-list-comman" +
                             "d btn btn-sm btn-default\"\r\n                        data-url=\"");



            #line 55 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Url.To("/jobs/enqueued/delete"));


            #line default
            #line hidden
                WriteLiteral("\"\r\n                        data-loading-text=\"");



            #line 56 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Strings.Common_Deleting);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                        data-confirm=\"");



            #line 57 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Strings.Common_DeleteConfirm);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                        disabled=\"disabled\">\r\n                    <span class=" +
                             "\"glyphicon glyphicon-remove\"></span>\r\n                    ");



            #line 60 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Strings.Common_DeleteSelected);


            #line default
            #line hidden
                WriteLiteral("\r\n                </button>\r\n\r\n                ");



            #line 63 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Html.PerPageSelector(pager));


            #line default
            #line hidden
                WriteLiteral(@"
            </div>

            <div class=""table-responsive"">
                <table class=""table"">
                    <thead>
                        <tr>
                            <th class=""min-width"">
                                <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                            </th>
                            <th class=""min-width"">");



            #line 73 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Strings.Common_Id);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th class=\"min-width\">");



            #line 74 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Strings.Common_State);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th>");



            #line 75 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Strings.Common_Job);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            <th class=\"align-right\">");



            #line 76 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Strings.Common_Fetched);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                        </tr>\r\n                    </thead>\r\n             " +
                             "       <tbody>\r\n");



            #line 80 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                foreach (var job in fetchedJobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                            <tr class=\"js-jobs-list-row hover ");



            #line 82 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                    Write(job.Value == null ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                <td>\r\n");



            #line 84 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                    if (job.Value != null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <input type=\"checkbox\" class=\"js-jobs-lis" +
                                     "t-checkbox\" name=\"jobs[]\" value=\"");



            #line 86 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                        Write(job.Key);


            #line default
            #line hidden
                        WriteLiteral("\" />\r\n");



            #line 87 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                </td>\r\n                                <td class=" +
                                 "\"min-width\">\r\n                                    ");



            #line 90 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                    Write(Html.JobIdLink(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n                                </td>\r\n");



            #line 92 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                    if (job.Value == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <td colspan=\"3\"><em>");



            #line 94 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                        Write(Strings.Common_JobExpired);


            #line default
            #line hidden
                        WriteLiteral("</em></td>\r\n");



            #line 95 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                    <td class=\"min-width\">\r\n                     " +
                                     "                   ");



            #line 99 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                        Write(Html.StateLabel(job.Value.State));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                    </td>\r\n");



                        WriteLiteral("                                    <td class=\"word-break\">\r\n                    " +
                                     "                    ");



            #line 102 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                        Write(Html.JobNameLink(job.Key, job.Value.Job));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                    </td>\r\n");



                        WriteLiteral("                                    <td class=\"align-right\">\r\n");



            #line 105 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                        if (job.Value.FetchedAt.HasValue)
                        {
            #line default
            #line hidden

            #line 107 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                            Write(Html.RelativeTime(job.Value.FetchedAt.Value));


            #line default
            #line hidden

            #line 107 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                    </td>\r\n");



            #line 110 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                            </tr>\r\n");



            #line 112 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                    </tbody>\r\n                </table>\r\n            </div>\r\n\r\n   " +
                             "         ");



            #line 117 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
                Write(Html.Paginator(pager));


            #line default
            #line hidden
                WriteLiteral("\r\n        </div>\r\n");



            #line 119 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #58
0
ファイル: HomePage.generated.cs プロジェクト: zqb971/Hangfire
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 8 "..\..\Dashboard\Pages\HomePage.cshtml"

            Layout = new LayoutPage("Dashboard");
            IDictionary <DateTime, long> succeeded = null;
            IDictionary <DateTime, long> failed    = null;

            var period = Query("period") ?? "day";

            var monitor = Storage.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<div class=\"row\">\r\n    <div class=\"col-md-12\">\r\n        <h1 class=\"page-header\"" +
                         ">Dashboard</h1>\r\n");



            #line 31 "..\..\Dashboard\Pages\HomePage.cshtml"
            if (Metrics.Count > 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"row\">\r\n");



            #line 34 "..\..\Dashboard\Pages\HomePage.cshtml"
                foreach (var metric in Metrics)
                {
            #line default
            #line hidden
                    WriteLiteral("                    <div class=\"col-md-2\">\r\n                        ");



            #line 37 "..\..\Dashboard\Pages\HomePage.cshtml"
                    Write(Html.BlockMetric(metric));


            #line default
            #line hidden
                    WriteLiteral("\r\n                    </div>\r\n");



            #line 39 "..\..\Dashboard\Pages\HomePage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </div>\r\n");



            #line 41 "..\..\Dashboard\Pages\HomePage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("        <h3>Realtime graph</h3>\r\n        <div id=\"realtimeGraph\" data-succeeded=\"" +
                         "");



            #line 43 "..\..\Dashboard\Pages\HomePage.cshtml"
            Write(Statistics.Succeeded);


            #line default
            #line hidden
            WriteLiteral("\" data-failed=\"");



            #line 43 "..\..\Dashboard\Pages\HomePage.cshtml"
            Write(Statistics.Failed);


            #line default
            #line hidden
            WriteLiteral(@"""></div>
        <div style=""display: none;"">
            <span data-metric=""succeeded:count""></span>
            <span data-metric=""failed:count""></span>
        </div>

        <h3>
            <div class=""btn-group pull-right"" style=""margin-top: 2px;"">
                <a href=""?period=day"" class=""btn btn-sm btn-default ");



            #line 51 "..\..\Dashboard\Pages\HomePage.cshtml"
            Write("day".Equals(period, StringComparison.OrdinalIgnoreCase) ? "active" : null);


            #line default
            #line hidden
            WriteLiteral("\">\r\n                    Day\r\n                </a>\r\n                <a href=\"?peri" +
                         "od=week\" class=\"btn btn-sm btn-default ");



            #line 54 "..\..\Dashboard\Pages\HomePage.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 59 "..\..\Dashboard\Pages\HomePage.cshtml"
            if (succeeded != null && failed != null)
            {
            #line default
            #line hidden
                WriteLiteral("            <div id=\"historyGraph\"\r\n                 data-succeeded=\"");



            #line 62 "..\..\Dashboard\Pages\HomePage.cshtml"
                Write(JsonConvert.SerializeObject(succeeded));


            #line default
            #line hidden
                WriteLiteral("\"\r\n                 data-failed=\"");



            #line 63 "..\..\Dashboard\Pages\HomePage.cshtml"
                Write(JsonConvert.SerializeObject(failed));


            #line default
            #line hidden
                WriteLiteral("\">\r\n            </div>\r\n");



            #line 65 "..\..\Dashboard\Pages\HomePage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>");
        }
コード例 #59
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 6 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"

            Layout = new LayoutPage(Strings.DeletedJobsPage_Title);

            int from, perPage;

            int.TryParse(Query("from"), out from);
            int.TryParse(Query("count"), out perPage);

            var monitor = Storage.GetMonitoringApi();
            var pager   = new Pager(from, perPage, monitor.DeletedListCount());
            var jobs    = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage);



            #line default
            #line hidden
            WriteLiteral("\r\n<div class=\"row\">\r\n    <div class=\"col-md-3\">\r\n        ");



            #line 21 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
            Write(Html.JobsSidebar());


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"col-md-9\">\r\n        <h1 class=\"page-header\">");



            #line 24 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
            Write(Strings.DeletedJobsPage_Title);


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n");



            #line 26 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
            if (pager.TotalPageCount == 0)
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"alert alert-info\">\r\n                ");



            #line 29 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                Write(Strings.DeletedJobsPage_NoJobs);


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 31 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("            <div class=\"js-jobs-list\">\r\n                <div class=\"btn-toolbar b" +
                             "tn-toolbar-top\">\r\n                    <button class=\"js-jobs-list-command btn bt" +
                             "n-sm btn-primary\"\r\n                            data-url=\"");



            #line 37 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                Write(Url.To("/jobs/deleted/requeue"));


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            data-loading-text=\"");



            #line 38 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                Write(Strings.Common_Enqueueing);


            #line default
            #line hidden
                WriteLiteral("\"\r\n                            disabled=\"disabled\">\r\n                        <spa" +
                             "n class=\"glyphicon glyphicon-repeat\"></span>\r\n                        ");



            #line 41 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                Write(Strings.Common_RequeueJobs);


            #line default
            #line hidden
                WriteLiteral("\r\n                    </button>\r\n                    ");



            #line 43 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                Write(Html.PerPageSelector(pager));


            #line default
            #line hidden
                WriteLiteral(@"
                </div>
                <div class=""table-responsive"">
                    <table class=""table"">
                        <thead>
                            <tr>
                                <th class=""min-width"">
                                    <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                </th>
                                <th class=""min-width"">");



            #line 52 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                Write(Strings.Common_Id);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th>");



            #line 53 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                Write(Strings.Common_Job);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                                <th class=\"align-right\">");



            #line 54 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                Write(Strings.DeletedJobsPage_Table_Deleted);


            #line default
            #line hidden
                WriteLiteral("</th>\r\n                            </tr>\r\n                        </thead>\r\n     " +
                             "                   <tbody>\r\n");



            #line 58 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                foreach (var job in jobs)
                {
            #line default
            #line hidden
                    WriteLiteral("                                <tr class=\"js-jobs-list-row ");



            #line 60 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    Write(job.Value == null || !job.Value.InDeletedState ? "obsolete-data" : null);


            #line default
            #line hidden
                    WriteLiteral(" ");



            #line 60 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    Write(job.Value != null && job.Value.InDeletedState && job.Value != null ? "hover" : null);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                                    <td>\r\n");



            #line 62 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    if (job.Value == null || job.Value.InDeletedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <input type=\"checkbox\" class=\"js-jobs" +
                                     "-list-checkbox\" name=\"jobs[]\" value=\"");



            #line 64 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                        Write(job.Key);


            #line default
            #line hidden
                        WriteLiteral("\" />\r\n");



            #line 65 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n                                    <t" +
                                 "d class=\"min-width\">\r\n                                        ");



            #line 68 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    Write(Html.JobIdLink(job.Key));


            #line default
            #line hidden
                    WriteLiteral("\r\n");



            #line 69 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    if (job.Value != null && !job.Value.InDeletedState)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                            <span title=\"");



            #line 71 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                        Write(Strings.Common_JobStateChanged_Text);


            #line default
            #line hidden
                        WriteLiteral("\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");



            #line 72 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                    </td>\r\n\r\n");



            #line 75 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    if (job.Value == null)
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td colspan=\"2\"><em>");



            #line 77 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                        Write(Strings.Common_JobExpired);


            #line default
            #line hidden
                        WriteLiteral("</em></td>\r\n");



            #line 78 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                                        <td>\r\n                                   " +
                                     "         ");



            #line 82 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                        Write(Html.JobNameLink(job.Key, job.Value.Job));


            #line default
            #line hidden
                        WriteLiteral("\r\n                                        </td>\r\n");



                        WriteLiteral("                                        <td class=\"align-right\">\r\n");



            #line 85 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                        if (job.Value.DeletedAt.HasValue)
                        {
            #line default
            #line hidden

            #line 87 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                            Write(Html.RelativeTime(job.Value.DeletedAt.Value));


            #line default
            #line hidden

            #line 87 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                        }


            #line default
            #line hidden
                        WriteLiteral("                                        </td>\r\n");



            #line 90 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                                </tr>\r\n");



            #line 92 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                        </tbody>\r\n                    </table>\r\n                <" +
                             "/div>\r\n\r\n                ");



            #line 97 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                Write(Html.Paginator(pager));


            #line default
            #line hidden
                WriteLiteral("\r\n            </div>\r\n");



            #line 99 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n</div>\r\n\r\n");
        }
コード例 #60
0
        public override void Execute()
        {


WriteLiteral("\r\n");








            
            #line 8 "..\..\Dashboard\Pages\RetriesPage.cshtml"
  
    Layout = new LayoutPage("Retries");
    
    int from, perPage;

    int.TryParse(Query("from"), out from);
    int.TryParse(Query("count"), out perPage);

    Pager pager = null;
    List<string> jobIds = null;

    using (var connection = Storage.GetConnection())
    {
        var storageConnection = connection as JobStorageConnection;

        if (storageConnection != null)
        {
            pager = new Pager(@from, perPage, storageConnection.GetSetCount("retries"));
            jobIds = storageConnection.GetRangeFromSet("retries", pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1);
        }
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 31 "..\..\Dashboard\Pages\RetriesPage.cshtml"
 if (pager == null)
{

            
            #line default
            #line hidden
WriteLiteral(@"    <div class=""alert alert-warning"">
        <h4>Retries are working, but this page can't be displayed</h4>
        <p>
            Don't worry, retries are fully supported. Your current job storage does not fully support
            some queries required to show this page. Please try to update your storage or wait until
            the full command set is implemented.
        </p>
        <p>
            Please go to the <a href=""");


            
            #line 41 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                 Write(Url.To("/jobs/scheduled"));

            
            #line default
            #line hidden
WriteLiteral("\">Scheduled jobs</a> page to see all the\r\n            scheduled jobs including re" +
"tries.\r\n        </p>\r\n    </div>\r\n");


            
            #line 45 "..\..\Dashboard\Pages\RetriesPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"row\">\r\n        <div class=\"col-md-12\">\r\n            <h1 class=\"pa" +
"ge-header\">Retries</h1>\r\n");


            
            #line 51 "..\..\Dashboard\Pages\RetriesPage.cshtml"
             if (jobIds.Count == 0)
            {

            
            #line default
            #line hidden
WriteLiteral("                <div class=\"alert alert-success\">\r\n                    All is OK " +
"– you have no retries.\r\n                </div>\r\n");


            
            #line 56 "..\..\Dashboard\Pages\RetriesPage.cshtml"
            }
            else
            {

            
            #line default
            #line hidden
WriteLiteral("                <div class=\"js-jobs-list\">\r\n                    <div class=\"btn-t" +
"oolbar btn-toolbar-top\">\r\n                        <button class=\"js-jobs-list-co" +
"mmand btn btn-sm btn-primary\"\r\n                                data-url=\"");


            
            #line 62 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                     Write(Url.To("/jobs/scheduled/enqueue"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                                data-loading-text=""Enqueueing...""
                                disabled=""disabled"">
                            <span class=""glyphicon glyphicon-repeat""></span>
                            Enqueue jobs
                        </button>

                        <button class=""js-jobs-list-command btn btn-sm btn-default""
                                data-url=""");


            
            #line 70 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                     Write(Url.To("/jobs/scheduled/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                                data-loading-text=""Deleting...""
                                data-confirm=""Do you really want to DELETE ALL selected jobs?""
                                disabled=""disabled"">
                            <span class=""glyphicon glyphicon-remove""></span>
                            Delete selected
                        </button>

                        ");


            
            #line 78 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                   Write(Html.PerPageSelector(pager));

            
            #line default
            #line hidden
WriteLiteral(@"
                    </div>

                    <table class=""table table-hover"">
                        <thead>
                            <tr>
                                <th class=""min-width"">
                                    <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                                </th>
                                <th class=""min-width"">Id</th>
                                <th class=""min-width"">State</th>
                                <th>Job</th>
                                <th>Reason</th>
                                <th class=""align-right"">Retry</th>
                                <th class=""align-right"">Created</th>
                            </tr>
                        </thead>
                        <tbody>
");


            
            #line 96 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                             foreach (var jobId in jobIds)
                            {
                                JobData jobData;
                                StateData stateData;

                                using (var connection = Storage.GetConnection())
                                {
                                    jobData = connection.GetJobData(jobId);
                                    stateData = connection.GetStateData(jobId);
                                }


            
            #line default
            #line hidden
WriteLiteral("                                <tr class=\"js-jobs-list-row ");


            
            #line 107 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                                        Write(jobData != null ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    <td>\r\n                                   " +
"     <input type=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\"");


            
            #line 109 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                                                                                             Write(jobId);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n                                    </td>\r\n                                " +
"    <td class=\"min-width\">\r\n                                        ");


            
            #line 112 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                   Write(Html.JobIdLink(jobId));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                    </td>\r\n");


            
            #line 114 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                     if (jobData == null)
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <td colspan=\"5\"><em>Job expired.</em></td" +
">\r\n");


            
            #line 117 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                    }
                                    else
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <td class=\"min-width\">\r\n                 " +
"                           ");


            
            #line 121 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                       Write(Html.StateLabel(jobData.State));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                        </td>\r\n");



WriteLiteral("                                        <td>\r\n                                   " +
"         ");


            
            #line 124 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                       Write(Html.JobNameLink(jobId, jobData.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                        </td>\r\n");



WriteLiteral("                                        <td>\r\n                                   " +
"         ");


            
            #line 127 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                        Write(stateData != null ? stateData.Reason : null);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                        </td>\r\n");



WriteLiteral("                                        <td class=\"align-right\">\r\n");


            
            #line 130 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                             if (stateData != null && stateData.Data.ContainsKey("EnqueueAt"))
                                            {
                                                
            
            #line default
            #line hidden
            
            #line 132 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                           Write(Html.RelativeTime(JobHelper.DeserializeDateTime(stateData.Data["EnqueueAt"])));

            
            #line default
            #line hidden
            
            #line 132 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                                                                                                              
                                            }

            
            #line default
            #line hidden
WriteLiteral("                                        </td>\r\n");



WriteLiteral("                                        <td class=\"align-right\">\r\n               " +
"                             ");


            
            #line 136 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                       Write(Html.RelativeTime(jobData.CreatedAt));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                        </td>\r\n");


            
            #line 138 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                </tr>\r\n");


            
            #line 140 "..\..\Dashboard\Pages\RetriesPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </tbody>\r\n                    </table>\r\n\r\n               " +
"     ");


            
            #line 144 "..\..\Dashboard\Pages\RetriesPage.cshtml"
               Write(Html.Paginator(pager));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </div>\r\n");


            
            #line 146 "..\..\Dashboard\Pages\RetriesPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </div>\r\n    </div>\r\n");


            
            #line 149 "..\..\Dashboard\Pages\RetriesPage.cshtml"
}
            
            #line default
            #line hidden

        }