From d863742dd14ad2c9591ab453bd3a5754e24e01b3 Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Thu, 26 Mar 2015 15:52:42 +0000 Subject: [PATCH] simplify displaying the executors as follow-up to comment by @jglick to #1596 --- core/src/main/java/hudson/model/Computer.java | 11 +++++++++-- core/src/main/resources/lib/hudson/executors.jelly | 3 +-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/model/Computer.java b/core/src/main/java/hudson/model/Computer.java index 0d564dd83b..a652d862b9 100644 --- a/core/src/main/java/hudson/model/Computer.java +++ b/core/src/main/java/hudson/model/Computer.java @@ -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 result = new ArrayList(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; diff --git a/core/src/main/resources/lib/hudson/executors.jelly b/core/src/main/resources/lib/hudson/executors.jelly index 30194b0175..532720cd85 100644 --- a/core/src/main/resources/lib/hudson/executors.jelly +++ b/core/src/main/resources/lib/hudson/executors.jelly @@ -39,8 +39,7 @@ THE SOFTWARE. (${%suspended}) - - + ${name} -- GitLab