提交 b1520376 编写于 作者: D Daniel Beck

Merge pull request #1245 from daniel-beck/JENKINS-19250

[FIX JENKINS-19250] Add causes to queue item tool tip
......@@ -114,6 +114,9 @@ import org.kohsuke.stapler.HttpResponses;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.DoNotUse;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;
import javax.annotation.CheckForNull;
......@@ -1403,6 +1406,16 @@ public class Queue extends ResourceController implements Saveable {
return Collections.emptyList();
}
@Restricted(DoNotUse.class) // used from Jelly
public String getCausesDescription() {
List<Cause> causes = getCauses();
StringBuilder s = new StringBuilder();
for (Cause c : causes) {
s.append(c.getShortDescription()).append('\n');
}
return s.toString();
}
protected Item(Task task, List<Action> actions, int id, FutureImpl future) {
this.task = task;
this.id = id;
......
......@@ -73,7 +73,7 @@ THE SOFTWARE.
<j:set var="stuck" value="${item.isStuck()}"/>
<j:choose>
<j:when test="${h.hasPermission(item.task,item.task.READ)}">
<a href="${rootURL}/${item.task.url}" class="model-link inside tl-tr" tooltip="${item.why}${h.escape(item.params)}&lt;br&gt;${%WaitingFor(item.inQueueForString)}">
<a href="${rootURL}/${item.task.url}" class="model-link inside tl-tr" tooltip="${h.escape(item.causesDescription)}${item.why}${h.escape(item.params)}&lt;br&gt;${%WaitingFor(item.inQueueForString)}">
<l:breakable value="${item.task.fullDisplayName}"/>
</a>
<!-- TODO include estimated number as in BuildHistoryWidget/entries.jelly if possible -->
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册