提交 d863742d 编写于 作者: S Stephen Connolly

simplify displaying the executors as follow-up to comment by @jglick to #1596

上级 1d818a16
......@@ -62,6 +62,7 @@ import hudson.util.RunList;
import hudson.util.Futures;
import hudson.util.NamingThreadFactory;
import jenkins.model.Jenkins;
import jenkins.model.queue.AsynchronousExecution;
import jenkins.util.ContextResettingExecutorService;
import jenkins.security.MasterToSlaveCallable;
import org.kohsuke.accmod.Restricted;
......@@ -898,12 +899,18 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
List<DisplayExecutor> result = new ArrayList<DisplayExecutor>(executors.size()+oneOffExecutors.size());
int index = 0;
for (Executor e: executors) {
result.add(new DisplayExecutor(Integer.toString(index+1), String.format("executors/%d", index), e));
final AsynchronousExecution ae = e.getAsynchronousExecution();
if (ae == null || ae.displayCell()) {
result.add(new DisplayExecutor(Integer.toString(index + 1), String.format("executors/%d", index), e));
}
index++;
}
index = 0;
for (OneOffExecutor e: oneOffExecutors) {
result.add(new DisplayExecutor("", String.format("oneOffExecutors/%d", index), e));
final AsynchronousExecution ae = e.getAsynchronousExecution();
if (ae == null || ae.displayCell()) {
result.add(new DisplayExecutor("", String.format("oneOffExecutors/%d", index), e));
}
index++;
}
return result;
......
......@@ -39,8 +39,7 @@ THE SOFTWARE.
<j:if test="${!c.acceptingTasks}"> <st:nbsp/> (${%suspended})</j:if>
</d:tag>
<d:tag name="executor">
<j:set var="ae" value="${e.asynchronousExecution}"/>
<j:if test="${(!c.offline or (c.offline and !e.idle)) and (ae == null || ae.displayCell())}">
<j:if test="${!c.offline or (c.offline and !e.idle)}">
<tr>
<td class="pane" align="right" style="vertical-align: top">
${name}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册