提交 ab399bee 编写于 作者: K kohsuke

added slaves to the search index.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4143 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f3391fc1
......@@ -46,7 +46,7 @@ import java.util.logging.LogRecord;
*
* @author Kohsuke Kawaguchi
*/
public abstract class Computer implements ModelObject {
public abstract class Computer extends AbstractModelObject {
private final CopyOnWriteArrayList<Executor> executors = new CopyOnWriteArrayList<Executor>();
private int numExecutors;
......@@ -244,6 +244,10 @@ public abstract class Computer implements ModelObject {
}
}
public String getSearchUrl() {
return "computer/"+nodeName;
}
/**
* Gets the system properties of the JVM on this computer.
* If this is the master, it returns the system property of the master computer.
......
......@@ -29,6 +29,7 @@ import hudson.scm.SCM;
import hudson.scm.SCMDescriptor;
import hudson.scm.SCMS;
import hudson.search.SearchIndexBuilder;
import hudson.search.CollectionSearchIndex;
import hudson.tasks.BuildStep;
import hudson.tasks.BuildWrapper;
import hudson.tasks.BuildWrappers;
......@@ -682,7 +683,11 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node
public SearchIndexBuilder makeSearchIndex() {
return super.makeSearchIndex()
.add("configure", "config","configure")
.add("log");
.add("log")
.add(new CollectionSearchIndex() {// for computers
protected Computer get(String key) { return getComputer(key); }
protected Collection<Computer> all() { return computers.values(); }
});
}
public String getUrlChildPrefix() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册