Changeset 7317
- Timestamp:
- Apr 3, 2017, 1:44:30 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/Job.java
r7270 r7317 1014 1014 1015 1015 /** 1016 The command to send to the plug-in when starting to 1017 execute it. If null, a default values is used. See 1018 Request.COMMAND_EXECUTE. This is usually only used when 1019 automatically restarting a failed job. 1020 @since 3.11 1021 */ 1022 public String getExecuteCommand() 1023 { 1024 return getData().getExecuteCommand(); 1025 } 1026 1027 /** 1028 Reset th currently stored execution command to force a 1029 plug-in to restart from the beginning instead of at the 1030 stored breakpoint. 1031 @since 3.11 1032 */ 1033 public void clearExecuteCommand() 1034 { 1035 checkPermission(Permission.WRITE); 1036 getData().setExecuteCommand(null); 1037 } 1038 1039 /** 1016 1040 Set the job's status to {@link Status#WAITING}. This status is 1017 1041 used to signal that a job has been fully configured and is ready -
trunk/www/common/plugin/finish_job.jsp
r6200 r7317 117 117 </tr> 118 118 <% 119 if (job.getExecuteCommand() != null) 120 { 121 %> 122 <tr> 123 <th class="subprompt"></th> 124 <td> 125 <input type="checkbox" name="resume_from_breakpoint" id="resumeFromBreakPoint" value="1"> 126 <label for="resumeFromBreakPoint">Resume from breakpoint: <%=HTML.encodeTags(job.getExecuteCommand()) %></label> 127 </td> 128 </tr> 129 <% 130 } 131 %> 132 <% 119 133 if (agents != null && agents.size() > 0) 120 134 { -
trunk/www/common/plugin/index.jsp
r6319 r7317 559 559 job.setSendMessage(Values.getBoolean(request.getParameter("send_message"))); 560 560 job.setRemoveJobWhenFinished(Values.getBoolean(request.getParameter("remove_job"))); 561 561 if (!Values.getBoolean(request.getParameter("resume_from_breakpoint"))) 562 { 563 job.clearExecuteCommand(); 564 } 562 565 if (!executeImmediately) 563 566 { -
trunk/www/views/jobs/index.jsp
r7307 r7317 308 308 boolean useLatestConfiguration = Values.getBoolean(request.getParameter("useLatestConfiguration"), false); 309 309 boolean clearDryRun = Values.getBoolean(request.getParameter("clearDryRun"), false); 310 boolean resumeFromBreakPoint = Values.getBoolean(request.getParameter("resumeFromBreakPoint"), false); 310 311 dc = sc.newDbControl(); 311 312 Job job = Job.getById(dc, cc.getId()); 313 if (!resumeFromBreakPoint) job.clearExecuteCommand(); 312 314 job.retry(useLatestConfiguration, clearDryRun); 313 315 dc.commit(); -
trunk/www/views/jobs/jobs.js
r7270 r7317 122 122 123 123 124 jobs.restartJob = function(event )124 jobs.restartJob = function(event, options) 125 125 { 126 126 var parameterVersion = Data.int('page-data', 'job-parameter-version'); 127 127 var latestVersion = Data.int('page-data', 'latest-parameter-version'); 128 var jobId = Data.get('page-data', 'item-id'); 129 var clearDryRun = Data.int(event.currentTarget, 'clear-dry-run', 0); 128 var breakPoint = Data.get('page-data', 'breakpoint'); 129 var jobId = Data.get('page-data', 'item-id'); 130 var clearDryRun = event ? Data.int(event.currentTarget, 'clear-dry-run', 0) : 0; 130 131 131 132 var useLatestConfiguration = 0; 132 if (parameterVersion != latestVersion) 133 { 134 var msg = 'The configuration parameters for the plugin has changed since\n'; 135 msg += 'the job was added to the job queue. Do you want to use the new\n'; 136 msg += 'configuration parameters?\n\n'; 137 msg += 'Ok / Yes = Use the new parameters (version = '+latestVersion + ')\n'; 138 msg += 'Cancel / No = Use the current parameters (version = ' + parameterVersion + ')'; 139 if (confirm(msg)) 140 { 141 useLatestConfiguration = 1; 133 var resumeFromBreakPoint = 0; 134 if (parameterVersion != latestVersion || breakPoint) 135 { 136 if (!options) 137 { 138 var url = 'restart_job_options.jsp?'; 139 Dialogs.openPopup(url, 'RestartJobOptions', 500, 300); 140 return; 141 } 142 else 143 { 144 useLatestConfiguration = options.useLatestConfiguration || 0; 145 resumeFromBreakPoint = options.resumeFromBreakPoint || 0; 142 146 } 143 147 } … … 145 149 url += '&cmd=RestartJob&item_id='+jobId; 146 150 url += '&useLatestConfiguration='+useLatestConfiguration; 151 url += '&resumeFromBreakPoint='+resumeFromBreakPoint; 147 152 if (clearDryRun) url += '&clearDryRun=' + clearDryRun; 148 153 location.replace(url); -
trunk/www/views/jobs/view_job.jsp
r7307 r7317 227 227 data-job-parameter-version="<%=parameterVersion %>" 228 228 data-latest-parameter-version="<%=latestParameterVersion %>" 229 data-breakpoint="<%=HTML.encodeTags(job.getExecuteCommand()) %>" 229 230 data-job-status="<%=status.name()%>" 230 231 data-auto-update="<%=autoUpdate ? 1 : 0 %>" … … 317 318 <div class="<%=job.getStatus() == Job.Status.ERROR ? "error messagecontainer" : ""%>" style="margin: 1px 0px;"> 318 319 <%=job.getStatus()%><%=job.isDryRun() ? " (dry-run)" : "" %>: 319 <span id="message" ><%=HTML.niceFormat(job.getStatusMessage())%></span> 320 <span id="message"> 321 <%=job.getStatus() == Job.Status.WAITING && job.getExecuteCommand() != null ? 322 "(Resume from " + job.getExecuteCommand() + ")" : ""%> 323 <%=HTML.niceFormat(job.getStatusMessage())%></span> 320 324 </div> 321 325 </td>
Note: See TracChangeset
for help on using the changeset viewer.