提交 e0971a53 编写于 作者: K kohsuke

[FIXED HUDSON-3152]

    In 1.288. Builds blocked by the shut-down process now reports its status accordingly.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15916 71c3de6d-444a-0410-be80-ed276b4c234a
上级 712ebaec
......@@ -1074,6 +1074,15 @@ public class Functions {
}
}
/**
* Prepend a prefix only when there's the specified body.
*/
public String prepend(String prefix, String body) {
if(body!=null && body.length()>0)
return prefix+body;
return body;
}
private static final Pattern SCHEME = Pattern.compile("[a-z]+://.+");
/**
......
......@@ -1063,8 +1063,11 @@ public class Queue extends ResourceController implements Saveable {
@Override
public String getWhy() {
Label label = task.getAssignedLabel();
Hudson hudson = Hudson.getInstance();
if(hudson.isQuietingDown())
return Messages.Queue_HudsonIsAboutToShutDown();
Label label = task.getAssignedLabel();
if (hudson.getNodes().isEmpty())
label = null; // no master/slave. pointless to talk about nodes
......
......@@ -113,6 +113,7 @@ Job.minutes=mins
Queue.AllNodesOffline=All nodes of label ''{0}'' are offline
Queue.BlockedBy=Blocked by {0}
Queue.HudsonIsAboutToShutDown=Hudson is about to shut down
Queue.InProgress=A build is already in progress
Queue.InQuietPeriod=In the quiet period. Expires in {0}
Queue.NodeOffline={0} is offline
......
......@@ -29,23 +29,26 @@ THE SOFTWARE.
<!-- pending build -->
<j:set var="queuedItems" value="${it.queuedItems}" />
<j:if test="${!pending.isEmpty()}">
<j:forEach var="item" items="${queuedItems}" indexVar="i">
<j:set var="id" value="${h.generateId()}"/>
<tr class="build-row transitive" id="${id}">
<td nowrap="nowrap">
<img width="16" height="16" src="${imagesURL}/16x16/grey.gif" alt="${%pending}" /><st:nbsp/>
#${it.owner.nextBuildNumber+queuedItems.size()-i-1}
</td>
<td nowrap="nowrap" tooltip="${item.task.why}">
<div style="float:right">
<j:if test="${item.hasCancelPermission()}">
<a href="${rootURL}/queue/item/${item.id}/cancelQueue"><img src="${imagesURL}/16x16/stop.gif" alt="cancel this build" /></a>
</j:if>
</div>
(${%pending})
</td>
</tr>
</j:forEach>
<j:forEach var="item" items="${queuedItems}" indexVar="i">
<j:set var="id" value="${h.generateId()}"/>
<tr class="build-row transitive" id="${id}">
<td nowrap="nowrap">
<img width="16" height="16" src="${imagesURL}/16x16/grey.gif" alt="${%pending}"/>
<st:nbsp/>
#${it.owner.nextBuildNumber+queuedItems.size()-i-1}
</td>
<td style="white-space:normal;">
<div style="float:right">
<j:if test="${item.hasCancelPermission()}">
<a href="${rootURL}/queue/item/${item.id}/cancelQueue">
<img src="${imagesURL}/16x16/stop.gif" alt="cancel this build"/>
</a>
</j:if>
</div>
(${%pending}${h.prepend(' - ',item.why)})
</td>
</tr>
</j:forEach>
</j:if>
<st:include page="/hudson/widgets/HistoryWidget/entries.jelly" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册