提交 e97c4943 编写于 作者: P petehayes

HUDSON-3386 Added method to return total number of configured executors for a...

HUDSON-3386 Added method to return total number of configured executors for a Label and modified the Item configuration UI to check if a label has any configured executors.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16765 71c3de6d-444a-0410-be80-ed276b4c234a
上级 00185505
......@@ -132,6 +132,21 @@ public class Label implements Comparable<Label>, ModelObject {
}
return clouds;
}
/**
* Number of total {@link Executor}s that belong to this label.
* <p>
* This includes executors that belong to offline nodes.
*/
public int getTotalConfiguredExecutors() {
int r=0;
for (Node n : getNodes()) {
Computer c = n.toComputer();
if(c!=null)
r += c.countExecutors();
}
return r;
}
/**
* Number of total {@link Executor}s that belong to this label that are functioning.
......
......@@ -49,8 +49,10 @@ THE SOFTWARE.
<f:entry title="${%Node}">
<select class="setting-input" name="slave">
<j:forEach var="s" items="${app.labels}">
<f:option selected="${s==it.assignedLabel}" value="${s.name}"
>${s.name} <j:if test="${!empty(s.description)}">(${s.description})</j:if></f:option>
<j:if test="${s.totalConfiguredExecutors &gt; 0}">
<f:option selected="${s==it.assignedLabel}" value="${s.name}"
>${s.name} <j:if test="${!empty(s.description)}">(${s.description})</j:if></f:option>
</j:if>
</j:forEach>
</select>
</f:entry>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册