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
This commit is contained in:
pgweiss committed 2009-08-28 22:16:22 +00:00
1 parent 21369d995c
commit 427dd0fdb1
4 files changed
+31 -2

No files matched your search

@@ -105,5 +105,10 @@ public class FileParameterValue extends ParameterValue {
return false;
return true;
}
@Override
public String toString() {
return "(FileParameterValue) " + getName() + "='" + file.getName() + "'";
}
}
+20 -1
View File
@@ -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() + "'";
}
}