提交 41bc77f7 编写于 作者: K kohsuke

improved the rendering of the place holder

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@34630 71c3de6d-444a-0410-be80-ed276b4c234a
上级 745fbe79
......@@ -24,7 +24,9 @@
package hudson.model.queue;
import hudson.Extension;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Executor;
import hudson.model.JobProperty;
import hudson.model.JobPropertyDescriptor;
import hudson.model.Queue.Executable;
......@@ -91,8 +93,9 @@ public class WideJobProperty extends JobProperty<AbstractProject<?,?>> {
}
}
private static class ExecutableImpl implements Executable {
public static class ExecutableImpl implements Executable {
private final SubTask parent;
private final Executor executor = Executor.currentExecutor();
private ExecutableImpl(SubTask parent) {
this.parent = parent;
......@@ -102,6 +105,10 @@ public class WideJobProperty extends JobProperty<AbstractProject<?,?>> {
return parent;
}
public AbstractBuild<?,?> getBuild() {
return (AbstractBuild<?,?>)executor.getCurrentWorkUnit().context.getPrimaryWorkUnit().getExecutable();
}
public void run() {
// nothing. we just waste time
}
......
......@@ -24,6 +24,16 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<td class="pane">
Occupied
<div style="white-space: normal">${%Occupied by}
<j:set var="build" value="${it.build}" />
<j:choose>
<j:when test="${h.hasPermission(build.parent,build.parent.READ)}">
<a href="${rootURL}/${build.parent.url}">${build.parent.fullDisplayName}</a>&#160;<a href="${rootURL}/${build.url}">#${build.number}</a>
</j:when>
<j:otherwise>
<span>${%Unknown Task}</span>
</j:otherwise>
</j:choose>
</div>
</td>
</j:jelly>
TODO:
x If a subtask is interrupted, all the executors should be aborted.
- handle AbstractMethodError on methods newly added.
- LoadBalancer backward compatibility story.
- Document the new abstraction
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册