diff --git a/src/main/java/hudson/matrix/LabelAxis.java b/src/main/java/hudson/matrix/LabelAxis.java index de8b6d10..4720ebed 100644 --- a/src/main/java/hudson/matrix/LabelAxis.java +++ b/src/main/java/hudson/matrix/LabelAxis.java @@ -26,11 +26,15 @@ import hudson.Extension; import hudson.Functions; import hudson.Util; +import hudson.model.Node; import jenkins.model.Jenkins; import hudson.model.labels.LabelAtom; + +import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; import java.util.List; +import java.util.Set; /** * {@link Axis} that selects label expressions. @@ -75,11 +79,26 @@ private String jsstr(String body, Object... args) { } public String buildLabelCheckBox(LabelAtom la, LabelAxis instance) { + String desc = ""; + Set nodes = la.getNodes(); + if (la.isSelfLabel()) { // if true this is Individual nodes + for (Node node : nodes) {// maybe only one? + desc = node.getNodeDescription(); + } + } else { // false this is Labels + if(la.getDescription() != null){ + desc += la.getDescription()+": "; + } + for (Node node : nodes) { + desc += node.getDisplayName() + ", "; + } + desc = StringUtils.strip(desc, ", "); + } return jsstr("", - la.getName(),la.getDescription()); + la.getName(),desc); // '${h.jsStringEscape('')}' } }