/// <summary>
        /// returns JobStatus for given job id,
        /// returns the current status if the jobid found in this workflow.
        /// </summary>
        /// <param name="workflowId">JobId</param>
        /// <returns></returns>
        public JobStatus GetStatus(JobId workflowId)
        {
            if (workflowId.Equals(Current.Id))
            {
                return(_workflowThread.GetStatus(workflowId.ToString()));
            }

            if (_currentJobId != null && workflowId.Equals(_currentJobId))
            {
                return(JobStatus.Running);
            }

            var key = workflowId.ToString();

            if (_jobStatus.ContainsKey(key))
            {
                return(_jobStatus[key]);
            }

            if (!_workflow.Exists(j => j.Id.Equals(workflowId)))
            {
                throw new KeyNotFoundException("job id : " + workflowId.Id);
            }

            return(JobStatus.NotStarted);
        }
예제 #2
0
        private void AddDestination(int jobId)
        {
            DateTime lastUpdateDate = DateTime.Parse(Request.QueryString["LastUpdateDate"]);

            Facade.IJob facJob = new Facade.Job();

            // Define the trunk instruction.
            DateTime bookedDateTime = new DateTime(rdiArrivalDate.SelectedDate.Value.Year, rdiArrivalDate.SelectedDate.Value.Month, rdiArrivalDate.SelectedDate.Value.Day, rdiArrivalTime.SelectedDate.Value.Hour, rdiArrivalTime.SelectedDate.Value.Minute, 0);
            TimeSpan travellingTime = bookedDateTime.Subtract(CurrentJob.Instructions[CurrentJob.Instructions.Count - 1].PlannedDepartureDateTime);

            Entities.CustomPrincipal user   = (Entities.CustomPrincipal)Page.User;
            Entities.FacadeResult    result = facJob.AttachDestination(CurrentJob, ucPoint.PointID, chkDriver.Checked, chkVehicle.Checked, chkTrailer.Checked, travellingTime, true, user.IdentityId, user.UserName);

            if (result.Success)
            {
                Cache.Remove(jobEntityForJobId + JobId.ToString());
                this.ReturnValue = "refresh";
                this.Close();
            }
            else
            {
                infrigementDisplay.Infringements = result.Infringements;
                infrigementDisplay.DisplayInfringments();
            }
        }
예제 #3
0
 public override void Run()
 {
     try
     {
         var           jobStatus             = StoreWorker.GetJobStatus(JobId.ToString());
         var           predicateTripleCounts = new Dictionary <string, ulong>();
         ulong         totalTripleCount      = 0;
         List <string> predicates            = StoreWorker.ReadStore.GetPredicates().ToList();
         for (int i = 0; i < predicates.Count; i++)
         {
             var tripleCount = StoreWorker.ReadStore.GetTripleCount(predicates[i]);
             totalTripleCount += tripleCount;
             predicateTripleCounts[predicates[i]] = tripleCount;
             jobStatus.Information =
                 String.Format("Count completed for {0}/{1} predicates. Approximately {2:P1} percent complete",
                               i + 1, predicates.Count, (i + 1) * 100.0 / predicates.Count);
         }
         var currentCommitPoint = StoreWorker.ReadStore.GetCommitPoints().First();
         StoreWorker.StoreStatistics.AppendStatistics(
             new StoreStatistics(
                 currentCommitPoint.LocationOffset,
                 currentCommitPoint.CommitTime, totalTripleCount,
                 predicateTripleCounts));
     }
     catch (Exception ex)
     {
         ErrorMessage = "Error reading store triple statistics. Cause: " + ex.Message;
         Logging.LogError(BrightstarEventId.StatsUpdateError, "Error reading store triple statistics for store. Cause: {0}",
                          ex);
     }
 }
예제 #4
0
        public static Path GetStartJobCommitFile(Configuration conf, string user, JobId jobId
                                                 )
        {
            Path startCommitFile = new Path(MRApps.GetStagingAreaDir(conf, user), jobId.ToString
                                                () + Path.Separator + "COMMIT_STARTED");

            return(startCommitFile);
        }
예제 #5
0
        public static Path GetEndJobCommitFailureFile(Configuration conf, string user, JobId
                                                      jobId)
        {
            Path endCommitFile = new Path(MRApps.GetStagingAreaDir(conf, user), jobId.ToString
                                              () + Path.Separator + "COMMIT_FAIL");

            return(endCommitFile);
        }
예제 #6
0
        /// <summary>
        /// get JobResult for given jobid.
        /// </summary>
        /// <param name="workflowId">JobId</param>
        /// <returns></returns>
        public JobResult GetResult(JobId workflowId)
        {
            if (workflowId.Equals(Current.Id))
            {
                if (_workflowThread.WaitForAll())
                {
                    _result = new JobResult(_workflowThread.GetStatus());
                }

                return(_result);
            }
            if (_jobStatus.ContainsKey(workflowId.ToString()))
            {
                return(_jobStatus[workflowId.ToString()]);
            }

            return(null);
        }
        /// <summary>
        /// get JobResult for given jobid.
        /// </summary>
        /// <param name="workflowId">JobId</param>
        /// <returns></returns>
        public JobResult GetResult(JobId workflowId)
        {
            if (workflowId.Equals(Current.Id))
            {
                return(_workflowThread.GetResult(workflowId.ToString()));
            }

            throw new KeyNotFoundException("job id : " + workflowId.Id);
        }
예제 #8
0
        /// <summary>
        /// returns JobStatus for given job id,
        /// returns the current status if the jobid found in this workflow.
        /// </summary>
        /// <param name="workflowId">JobId</param>
        /// <returns></returns>
        public JobStatus GetStatus(JobId workflowId)
        {
            if (workflowId.Equals(Current.Id))
            {
                return(_workflowThread.GetStatus());
            }

            if (_jobStatus.ContainsKey(workflowId.ToString()))
            {
                return(_jobStatus[workflowId.ToString()].Status);
            }

            if (!_workflow.Exists(j => j.Id.Equals(workflowId)))
            {
                throw new KeyNotFoundException("JobId");
            }

            return(JobStatus.NotStarted);
        }
예제 #9
0
        public virtual void TestAttemptsWithJobView()
        {
            Log.Info("HsAttemptsPage with data");
            MockAppContext ctx = new MockAppContext(0, 1, 1, 1);
            JobId          id  = ctx.GetAllJobs().Keys.GetEnumerator().Next();
            IDictionary <string, string> @params = new Dictionary <string, string>();

            @params[AMParams.JobId]        = id.ToString();
            @params[AMParams.TaskType]     = "m";
            @params[AMParams.AttemptState] = "SUCCESSFUL";
            WebAppTests.TestPage <AppContext>(typeof(HsAttemptsPage), ctx, @params);
        }
예제 #10
0
        protected override void ProcessRecord()
        {
            ConfirmAction(
                Force.IsPresent,
                string.Format(Resources.StoppingDataLakeAnalyticsJob, JobId),
                string.Format(Resources.StopDataLakeAnalyticsJob, JobId),
                JobId.ToString(),
                () => DataLakeAnalyticsClient.CancelJob(ResourceGroupName, Account, JobId));

            if (PassThru)
            {
                WriteObject(true);
            }
        }
        public override void ExecuteCmdlet()
        {
            ConfirmAction(
                Force.IsPresent,
                string.Format(Resources.StoppingDataLakeAnalyticsJob, JobId),
                string.Format(Resources.StopDataLakeAnalyticsJob, JobId),
                JobId.ToString(),
                () => DataLakeAnalyticsClient.CancelJob(Account, JobId));

            if (PassThru)
            {
                WriteObject(true);
            }
        }
예제 #12
0
 /// <summary>
 /// Handler method for an individual RDF statement
 /// </summary>
 /// <param name="subject">The statement subject resource URI</param>
 /// <param name="subjectIsBNode">True if the value of <paramref name="subject"/> is a BNode identifier</param>
 /// <param name="predicate">The predicate resource URI</param>
 /// <param name="predicateIsBNode">True if the value of <paramref name="predicate"/> is a BNode identifier.</param>
 /// <param name="obj">The object of the statement</param>
 /// <param name="objIsBNode">True if the value of <paramref name="obj"/> is a BNode identifier.</param>
 /// <param name="objIsLiteral">True if the value of <paramref name="obj"/> is a literal string</param>
 /// <param name="dataType">The datatype URI for the object literal or null if the object is not a literal</param>
 /// <param name="langCode">The language code for the object literal or null if the object is not a literal</param>
 /// <param name="graphUri">The graph URI for the statement</param>
 public void Triple(string subject, bool subjectIsBNode, string predicate, bool predicateIsBNode, string obj, bool objIsBNode, bool objIsLiteral, string dataType, string langCode, string graphUri)
 {
     _importTripleSink.Triple(subject, subjectIsBNode, predicate, predicateIsBNode, obj, objIsBNode, objIsLiteral, dataType, langCode, graphUri);
     _tripleCount++;
     if (_tripleCount % 1000 == 0)
     {
         var percentComplete = ((double)_fileStream.Position / (_fileStream.Length));
         var jobStatus       = StoreWorker.GetJobStatus(JobId.ToString());
         if (jobStatus != null)
         {
             jobStatus.Information = String.Format("Imported {0:N0} triples. Approximately {1:P1} complete",
                                                   _tripleCount, percentComplete);
         }
     }
 }
예제 #13
0
        public void WriteSourceFileInfo(Data data, string section)
        {
            data.SetValue(section + "DocumentTitle", DocumentTitle);
            data.SetValue(section + "WinStation", WinStation);
            data.SetValue(section + "Username", Author);
            data.SetValue(section + "ClientComputer", ClientComputer);
            data.SetValue(section + "SpoolFileName", Filename);
            data.SetValue(section + "PrinterName", PrinterName);
            data.SetValue(section + "SessionId", SessionId.ToString(CultureInfo.InvariantCulture));
            data.SetValue(section + "JobCounter", JobCounter.ToString(CultureInfo.InvariantCulture));
            data.SetValue(section + "JobId", JobId.ToString(CultureInfo.InvariantCulture));

            var type = Type == JobType.XpsJob ? "xps" : "ps";

            data.SetValue(section + "SourceFileType", type);

            data.SetValue(section + "Copies", Copies.ToString(CultureInfo.InvariantCulture));
            data.SetValue(section + "TotalPages", TotalPages.ToString(CultureInfo.InvariantCulture));
        }
예제 #14
0
        private void DisplayControls()
        {
            var PalletTypes        = Facade.PalletType.GetAllPalletTypes().Tables[0].Rows.Cast <DataRow>().AsEnumerable();
            var selectedPalletType = PalletTypes.FirstOrDefault(pts => pts.Field <int>("PalletTypeId") == PalletTypeId);

            lblRunID.Text      = JobId.ToString();
            lblPalletType.Text = selectedPalletType.Field <string>("Description");

            rcbDehireRecieptType.DataSource = Utilities.UnCamelCase(Enum.GetNames(typeof(eDehiringReceiptType)));
            rcbDehireRecieptType.DataBind();

            // Setting currency culture
            CultureInfo systemCulture = new CultureInfo(Orchestrator.Globals.Configuration.NativeCulture);

            rntPalletDeliveryCharge.Culture = systemCulture;

            ResetControls();

            divNoDetails.Style.Add("display", "none");
            divPalletHandling.Style.Add("display", "");
        }
예제 #15
0
        public virtual void Before()
        {
            JobId mockJobId = Org.Mockito.Mockito.Mock <JobId>();

            Org.Mockito.Mockito.When(mockJobId.ToString()).ThenReturn("testJobId");
            summary.SetJobId(mockJobId);
            summary.SetJobSubmitTime(2);
            summary.SetJobLaunchTime(3);
            summary.SetFirstMapTaskLaunchTime(4);
            summary.SetFirstReduceTaskLaunchTime(5);
            summary.SetJobFinishTime(6);
            summary.SetNumFinishedMaps(1);
            summary.SetNumFailedMaps(0);
            summary.SetNumFinishedReduces(1);
            summary.SetNumFailedReduces(0);
            summary.SetUser("testUser");
            summary.SetQueue("testQueue");
            summary.SetJobStatus("testJobStatus");
            summary.SetMapSlotSeconds(7);
            summary.SetReduceSlotSeconds(8);
            summary.SetJobName("testName");
        }
예제 #16
0
        protected override void AutomationProcessRecord()
        {
            if (this.ParameterSetName == AutomationCmdletParameterSets.ByInputObject)
            {
                if (this.ShouldProcess(JobId.ToString(), VerbsLifecycle.Stop))
                {
                    if (Force ||
                        ShouldContinue(Resources.StopAzureAutomationNodeConfigurationWarning, Resources.StopAzureAutomationNodeConfigurationDescription))
                    {
                        this.AutomationClient.StopNodeConfigurationDeployment(this.InputObject.ResourceGroupName,
                                                                              this.InputObject.AutomationAccountName,
                                                                              this.InputObject.JobId);

                        if (PassThru.IsPresent)
                        {
                            WriteObject(true);
                        }
                    }
                }
            }
            else
            {
                if (this.ShouldProcess(JobId.ToString(), VerbsLifecycle.Stop))
                {
                    if (Force ||
                        ShouldContinue(Resources.StopAzureAutomationNodeConfigurationWarning, Resources.StopAzureAutomationNodeConfigurationDescription))
                    {
                        this.AutomationClient.StopNodeConfigurationDeployment(this.ResourceGroupName, this.AutomationAccountName, this.JobId);

                        if (PassThru.IsPresent)
                        {
                            WriteObject(true);
                        }
                    }
                }
            }
        }
예제 #17
0
 public override string ToString()
 {
     return(JobId.ToString());
 }
예제 #18
0
        /// <exception cref="System.Exception"/>
        private void CheckHistoryParsing(int numMaps, int numReduces, int numSuccessfulMaps
                                         )
        {
            Configuration conf = new Configuration();

            conf.Set(MRJobConfig.UserName, Runtime.GetProperty("user.name"));
            long amStartTimeEst = Runtime.CurrentTimeMillis();

            conf.SetClass(CommonConfigurationKeysPublic.NetTopologyNodeSwitchMappingImplKey,
                          typeof(TestJobHistoryParsing.MyResolver), typeof(DNSToSwitchMapping));
            RackResolver.Init(conf);
            MRApp app = new TestJobHistoryEvents.MRAppWithHistory(numMaps, numReduces, true,
                                                                  this.GetType().FullName, true);

            app.Submit(conf);
            Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = app.GetContext().GetAllJobs().Values
                                                             .GetEnumerator().Next();
            JobId jobId = job.GetID();

            Log.Info("JOBID is " + TypeConverter.FromYarn(jobId).ToString());
            app.WaitForState(job, JobState.Succeeded);
            // make sure all events are flushed
            app.WaitForState(Service.STATE.Stopped);
            string      jobhistoryDir = JobHistoryUtils.GetHistoryIntermediateDoneDirForUser(conf);
            FileContext fc            = null;

            try
            {
                fc = FileContext.GetFileContext(conf);
            }
            catch (IOException ioe)
            {
                Log.Info("Can not get FileContext", ioe);
                throw (new Exception("Can not get File Context"));
            }
            if (numMaps == numSuccessfulMaps)
            {
                string summaryFileName  = JobHistoryUtils.GetIntermediateSummaryFileName(jobId);
                Path   summaryFile      = new Path(jobhistoryDir, summaryFileName);
                string jobSummaryString = GetJobSummary(fc, summaryFile);
                NUnit.Framework.Assert.IsNotNull(jobSummaryString);
                NUnit.Framework.Assert.IsTrue(jobSummaryString.Contains("resourcesPerMap=100"));
                NUnit.Framework.Assert.IsTrue(jobSummaryString.Contains("resourcesPerReduce=100")
                                              );
                IDictionary <string, string> jobSummaryElements = new Dictionary <string, string>();
                StringTokenizer strToken = new StringTokenizer(jobSummaryString, ",");
                while (strToken.HasMoreTokens())
                {
                    string keypair = strToken.NextToken();
                    jobSummaryElements[keypair.Split("=")[0]] = keypair.Split("=")[1];
                }
                NUnit.Framework.Assert.AreEqual("JobId does not match", jobId.ToString(), jobSummaryElements
                                                ["jobId"]);
                NUnit.Framework.Assert.AreEqual("JobName does not match", "test", jobSummaryElements
                                                ["jobName"]);
                NUnit.Framework.Assert.IsTrue("submitTime should not be 0", long.Parse(jobSummaryElements
                                                                                       ["submitTime"]) != 0);
                NUnit.Framework.Assert.IsTrue("launchTime should not be 0", long.Parse(jobSummaryElements
                                                                                       ["launchTime"]) != 0);
                NUnit.Framework.Assert.IsTrue("firstMapTaskLaunchTime should not be 0", long.Parse
                                                  (jobSummaryElements["firstMapTaskLaunchTime"]) != 0);
                NUnit.Framework.Assert.IsTrue("firstReduceTaskLaunchTime should not be 0", long.Parse
                                                  (jobSummaryElements["firstReduceTaskLaunchTime"]) != 0);
                NUnit.Framework.Assert.IsTrue("finishTime should not be 0", long.Parse(jobSummaryElements
                                                                                       ["finishTime"]) != 0);
                NUnit.Framework.Assert.AreEqual("Mismatch in num map slots", numSuccessfulMaps, System.Convert.ToInt32
                                                    (jobSummaryElements["numMaps"]));
                NUnit.Framework.Assert.AreEqual("Mismatch in num reduce slots", numReduces, System.Convert.ToInt32
                                                    (jobSummaryElements["numReduces"]));
                NUnit.Framework.Assert.AreEqual("User does not match", Runtime.GetProperty("user.name"
                                                                                           ), jobSummaryElements["user"]);
                NUnit.Framework.Assert.AreEqual("Queue does not match", "default", jobSummaryElements
                                                ["queue"]);
                NUnit.Framework.Assert.AreEqual("Status does not match", "SUCCEEDED", jobSummaryElements
                                                ["status"]);
            }
            JobHistory jobHistory = new JobHistory();

            jobHistory.Init(conf);
            HistoryFileManager.HistoryFileInfo fileInfo = jobHistory.GetJobFileInfo(jobId);
            JobHistoryParser.JobInfo           jobInfo;
            long numFinishedMaps;

            lock (fileInfo)
            {
                Path historyFilePath  = fileInfo.GetHistoryFile();
                FSDataInputStream @in = null;
                Log.Info("JobHistoryFile is: " + historyFilePath);
                try
                {
                    @in = fc.Open(fc.MakeQualified(historyFilePath));
                }
                catch (IOException ioe)
                {
                    Log.Info("Can not open history file: " + historyFilePath, ioe);
                    throw (new Exception("Can not open History File"));
                }
                JobHistoryParser parser     = new JobHistoryParser(@in);
                EventReader      realReader = new EventReader(@in);
                EventReader      reader     = Org.Mockito.Mockito.Mock <EventReader>();
                if (numMaps == numSuccessfulMaps)
                {
                    reader = realReader;
                }
                else
                {
                    AtomicInteger numFinishedEvents = new AtomicInteger(0);
                    // Hack!
                    Org.Mockito.Mockito.When(reader.GetNextEvent()).ThenAnswer(new _Answer_257(realReader
                                                                                               , numFinishedEvents, numSuccessfulMaps));
                }
                jobInfo         = parser.Parse(reader);
                numFinishedMaps = ComputeFinishedMaps(jobInfo, numMaps, numSuccessfulMaps);
                if (numFinishedMaps != numMaps)
                {
                    Exception parseException = parser.GetParseException();
                    NUnit.Framework.Assert.IsNotNull("Didn't get expected parse exception", parseException
                                                     );
                }
            }
            NUnit.Framework.Assert.AreEqual("Incorrect username ", Runtime.GetProperty("user.name"
                                                                                       ), jobInfo.GetUsername());
            NUnit.Framework.Assert.AreEqual("Incorrect jobName ", "test", jobInfo.GetJobname(
                                                ));
            NUnit.Framework.Assert.AreEqual("Incorrect queuename ", "default", jobInfo.GetJobQueueName
                                                ());
            NUnit.Framework.Assert.AreEqual("incorrect conf path", "test", jobInfo.GetJobConfPath
                                                ());
            NUnit.Framework.Assert.AreEqual("incorrect finishedMap ", numSuccessfulMaps, numFinishedMaps
                                            );
            NUnit.Framework.Assert.AreEqual("incorrect finishedReduces ", numReduces, jobInfo
                                            .GetFinishedReduces());
            NUnit.Framework.Assert.AreEqual("incorrect uberized ", job.IsUber(), jobInfo.GetUberized
                                                ());
            IDictionary <TaskID, JobHistoryParser.TaskInfo> allTasks = jobInfo.GetAllTasks();
            int totalTasks = allTasks.Count;

            NUnit.Framework.Assert.AreEqual("total number of tasks is incorrect  ", (numMaps
                                                                                     + numReduces), totalTasks);
            // Verify aminfo
            NUnit.Framework.Assert.AreEqual(1, jobInfo.GetAMInfos().Count);
            NUnit.Framework.Assert.AreEqual(MRApp.NmHost, jobInfo.GetAMInfos()[0].GetNodeManagerHost
                                                ());
            JobHistoryParser.AMInfo amInfo = jobInfo.GetAMInfos()[0];
            NUnit.Framework.Assert.AreEqual(MRApp.NmPort, amInfo.GetNodeManagerPort());
            NUnit.Framework.Assert.AreEqual(MRApp.NmHttpPort, amInfo.GetNodeManagerHttpPort()
                                            );
            NUnit.Framework.Assert.AreEqual(1, amInfo.GetAppAttemptId().GetAttemptId());
            NUnit.Framework.Assert.AreEqual(amInfo.GetAppAttemptId(), amInfo.GetContainerId()
                                            .GetApplicationAttemptId());
            NUnit.Framework.Assert.IsTrue(amInfo.GetStartTime() <= Runtime.CurrentTimeMillis(
                                              ) && amInfo.GetStartTime() >= amStartTimeEst);
            ContainerId fakeCid = MRApp.NewContainerId(-1, -1, -1, -1);

            // Assert at taskAttempt level
            foreach (JobHistoryParser.TaskInfo taskInfo in allTasks.Values)
            {
                int taskAttemptCount = taskInfo.GetAllTaskAttempts().Count;
                NUnit.Framework.Assert.AreEqual("total number of task attempts ", 1, taskAttemptCount
                                                );
                JobHistoryParser.TaskAttemptInfo taInfo = taskInfo.GetAllTaskAttempts().Values.GetEnumerator
                                                              ().Next();
                NUnit.Framework.Assert.IsNotNull(taInfo.GetContainerId());
                // Verify the wrong ctor is not being used. Remove after mrv1 is removed.
                NUnit.Framework.Assert.IsFalse(taInfo.GetContainerId().Equals(fakeCid));
            }
            // Deep compare Job and JobInfo
            foreach (Task task in job.GetTasks().Values)
            {
                JobHistoryParser.TaskInfo taskInfo_1 = allTasks[TypeConverter.FromYarn(task.GetID
                                                                                           ())];
                NUnit.Framework.Assert.IsNotNull("TaskInfo not found", taskInfo_1);
                foreach (TaskAttempt taskAttempt in task.GetAttempts().Values)
                {
                    JobHistoryParser.TaskAttemptInfo taskAttemptInfo = taskInfo_1.GetAllTaskAttempts(
                        )[TypeConverter.FromYarn((taskAttempt.GetID()))];
                    NUnit.Framework.Assert.IsNotNull("TaskAttemptInfo not found", taskAttemptInfo);
                    NUnit.Framework.Assert.AreEqual("Incorrect shuffle port for task attempt", taskAttempt
                                                    .GetShufflePort(), taskAttemptInfo.GetShufflePort());
                    if (numMaps == numSuccessfulMaps)
                    {
                        NUnit.Framework.Assert.AreEqual(MRApp.NmHost, taskAttemptInfo.GetHostname());
                        NUnit.Framework.Assert.AreEqual(MRApp.NmPort, taskAttemptInfo.GetPort());
                        // Verify rack-name
                        NUnit.Framework.Assert.AreEqual("rack-name is incorrect", taskAttemptInfo.GetRackname
                                                            (), RackName);
                    }
                }
            }
            // test output for HistoryViewer
            TextWriter stdps = System.Console.Out;

            try
            {
                Runtime.SetOut(new TextWriter(outContent));
                HistoryViewer viewer;
                lock (fileInfo)
                {
                    viewer = new HistoryViewer(fc.MakeQualified(fileInfo.GetHistoryFile()).ToString()
                                               , conf, true);
                }
                viewer.Print();
                foreach (JobHistoryParser.TaskInfo taskInfo_1 in allTasks.Values)
                {
                    string test = (taskInfo_1.GetTaskStatus() == null ? string.Empty : taskInfo_1.GetTaskStatus
                                       ()) + " " + taskInfo_1.GetTaskType() + " task list for " + taskInfo_1.GetTaskId(
                        ).GetJobID();
                    NUnit.Framework.Assert.IsTrue(outContent.ToString().IndexOf(test) > 0);
                    NUnit.Framework.Assert.IsTrue(outContent.ToString().IndexOf(taskInfo_1.GetTaskId(
                                                                                    ).ToString()) > 0);
                }
            }
            finally
            {
                Runtime.SetOut(stdps);
            }
        }
예제 #19
0
 IReadOnlyList <string> IParameterSet.GetUrlParameters()
 => Enabled.HasValue
            ? new[] { JobId.ToString(), Enabled.Value ? "1" : "0" }
            : new[] { JobId.ToString() };
예제 #20
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>");
        }
예제 #21
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>");
        }
        public override void Execute()
        {
            WriteLiteral("\n");



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

            var           monitor = JobStorage.Current.GetMonitoringApi();
            JobDetailsDto job     = monitor.JobDetails(JobId.ToString());

            string title = null;

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

            title = title ?? "Job";

            Layout = new LayoutPage {
                Title = title
            };



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



            #line 27 "..\..\Pages\JobDetailsPage.cshtml"
            if (job == null)
            {
            #line default
            #line hidden
                WriteLiteral("    ");

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



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


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



            #line 30 "..\..\Pages\JobDetailsPage.cshtml"
            }
            else
            {
            #line default
            #line hidden
                WriteLiteral("    <div class=\"job-snippet-header\">\n        <span class=\"job-snippet-tab\">\n     " +
                             "       Job ID: <span class=\"job-snippet-id\">");



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


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



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


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



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


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



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



            #line 47 "..\..\Pages\JobDetailsPage.cshtml"
                if (job.CreatedAt.HasValue)
                {
            #line default
            #line hidden
                    WriteLiteral("                <div class=\"pull-right job-creation-date\">\n                    Cr" +
                                 "eated\n                    <span data-moment=\"");



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


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



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


            #line default
            #line hidden


            #line 54 "..\..\Pages\JobDetailsPage.cshtml"
                if (job != null)
                {
            #line default
            #line hidden
                    WriteLiteral("                <pre><code>");



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


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



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


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



            #line 61 "..\..\Pages\JobDetailsPage.cshtml"
                if (job.Properties.Count > 0)
                {
            #line default
            #line hidden
                    WriteLiteral("            <div class=\"job-snippet-properties\">\n                <dl>\n");



            #line 65 "..\..\Pages\JobDetailsPage.cshtml"
                    foreach (var property in job.Properties)
                    {
            #line default
            #line hidden
                        WriteLiteral("                        <dt>");



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


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



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



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


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



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


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



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


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



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

                if (job.History.Count > 0)
                {
            #line default
            #line hidden
                    WriteLiteral("        <h3>History</h3>\n");



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

                    DateTime[] entriesCreationTime = job.History.Select(x => x.CreatedAt).ToArray();
                    var        nextEntry           = 1;

                    foreach (var entry in job.History)
                    {
                        var background = JobHistoryRenderer.BackgroundStateColors.ContainsKey(entry.StateName)
               ? JobHistoryRenderer.BackgroundStateColors[entry.StateName]
               : null;

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



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



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


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



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


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



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


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



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


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



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


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



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


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



            #line 107 "..\..\Pages\JobDetailsPage.cshtml"
                        if (!String.IsNullOrWhiteSpace(entry.Reason))
                        {
            #line default
            #line hidden
                            WriteLiteral("                            <small>");



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


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



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


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



            #line 114 "..\..\Pages\JobDetailsPage.cshtml"
                        if (JobHistoryRenderer.Exists(entry.StateName))
                        {
                            var rendered = JobHistoryRenderer.Render(entry.StateName, entry.Data);
                            if (rendered != null)
                            {
            #line default
            #line hidden
                                WriteLiteral("                        <div class=\"job-history-body\">\n                          " +
                                             "  ");



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


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



            #line 122 "..\..\Pages\JobDetailsPage.cshtml"
                            }
                        }
                        else
                        {
            #line default
            #line hidden
                            WriteLiteral("                    <div class=\"job-history-body\">\n                        <dl cl" +
                                         "ass=\"dl-horizontal\">\n");



            #line 128 "..\..\Pages\JobDetailsPage.cshtml"
                            foreach (var item in entry.Data)
                            {
            #line default
            #line hidden
                                WriteLiteral("                                <dt>");



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


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



                                WriteLiteral("                                <dd>");



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


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



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


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



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


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



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

                        index++;
                    }
                }
            }

            #line default
            #line hidden
        }
예제 #23
0
 public static string ToString(JobId jid)
 {
     return(jid.ToString());
 }
예제 #24
0
 void btnCancel_Click(object sender, EventArgs e)
 {
     Cache.Remove(jobEntityForJobId + JobId.ToString());
     this.Close();
 }
예제 #25
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>");
        }