提交 427dd0fd 编写于 作者: P pgweiss

Expand the tooltip of a queued item to include the parameters if it is for a parameterized build.

This is very useful when you are using the parameterized trigger plugin and have dozens of queued
jobs -- you can now know which jobs to kill.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21175 71c3de6d-444a-0410-be80-ed276b4c234a
上级 21369d99
......@@ -105,5 +105,10 @@ public class FileParameterValue extends ParameterValue {
return false;
return true;
}
@Override
public String toString() {
return "(FileParameterValue) " + getName() + "='" + file.getName() + "'";
}
}
......@@ -30,6 +30,7 @@ import hudson.Util;
import hudson.XmlFile;
import hudson.remoting.AsyncFutureImpl;
import hudson.model.Node.Mode;
import hudson.model.ParametersAction;
import hudson.triggers.SafeTimerTask;
import hudson.triggers.Trigger;
import hudson.util.OneShotEvent;
......@@ -1145,7 +1146,25 @@ public class Queue extends ResourceController implements Saveable {
*/
@Exported
public abstract String getWhy();
/**
* Gets a human-readable message about the parameters of this item
* @return String
*/
@Exported
public String getParams() {
String s = "";
for(Action action : getActions()) {
if(action instanceof ParametersAction) {
ParametersAction pa = (ParametersAction)action;
for (ParameterValue p : pa.getParameters()) {
s = s + "<br>" + p.toString();
}
}
}
return s;
}
public boolean hasCancelPermission() {
return task.hasAbortPermission();
}
......
......@@ -64,5 +64,10 @@ public class RunParameterValue extends ParameterValue {
public void buildEnvVars(AbstractBuild<?,?> build, Map<String,String> env) {
env.put(name.toUpperCase(), Hudson.getInstance().getRootUrl() + getRun().getUrl());
}
@Override
public String toString() {
return "(RunParameterValue) " + getName() + "='" + getRunId() + "'";
}
}
......@@ -57,7 +57,7 @@ THE SOFTWARE.
<j:otherwise>
<j:forEach var="item" items="${items}">
<tr>
<td class="pane" width="100%" tooltip="${item.why}" style="white-space: normal;">
<td class="pane" width="100%" tooltip="${item.why}${item.params}" style="white-space: normal;">
<j:set var="stuck" value="${item.isStuck()}"/>
<j:choose>
<j:when test="${h.hasPermission(item.task,item.task.READ)}">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册