added JNLP link. JNLP support is now live.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2174 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke 2007-02-12 01:10:14 +00:00
parent a0572f02ac
commit 62f9ea8ff2
4 changed files with 70 additions and 12 deletions

View File

@ -100,6 +100,13 @@ public abstract class Computer implements ModelObject {
return temporarilyOffline || getChannel()==null;
}
/**
* Returns true if this computer is supposed to be launched via JNLP.
*/
public boolean isJnlpAgent() {
return false;
}
/**
* Returns true if this node is marked temporarily offline by the user.
*

View File

@ -206,6 +206,15 @@ public final class Slave implements Node, Serializable {
super(slave);
}
public Slave getNode() {
return (Slave)super.getNode();
}
@Override
public boolean isJnlpAgent() {
return getNode().getCommand().length()==0;
}
/**
* Launches a remote agent.
*/

View File

@ -19,17 +19,43 @@
Slave ${it.displayName}
</h1>
<j:if test="${it.offline &amp;&amp; !it.temporarilyOffline}">
<p class="error">
This node is offline because Hudson failed to launch the slave agent on it.
<a href="log">See log for more details</a>
</p>
<l:isAdmin>
<form method="get" action="launchSlaveAgent">
<input type="submit" value="Launch slave agent" />
</form>
</l:isAdmin>
</j:if>
<j:choose>
<j:when test="${it.jnlpAgent}">
<j:choose>
<j:when test="${it.offline &amp;&amp; !it.temporarilyOffline}">
<l:isAdmin>
<p>
<a href="slave-agent.jnlp">
<img src="${rootURL}/images/webstart.gif" alt="launch agent" />
Launch slave agent
</a>
</p>
<p>
(Click the above link from this slave computer to launch the slave agent via JNLP)
</p>
</l:isAdmin>
</j:when>
<j:otherwise>
<p>
Connected via JNLP agent.
</p>
</j:otherwise>
</j:choose>
</j:when>
<j:otherwise>
<j:if test="${it.offline &amp;&amp; !it.temporarilyOffline}">
<p class="error">
This node is offline because Hudson failed to launch the slave agent on it.
<a href="log">See log for more details</a>
</p>
<l:isAdmin>
<form method="get" action="launchSlaveAgent">
<input type="submit" value="Launch slave agent" />
</form>
</l:isAdmin>
</j:if>
</j:otherwise>
</j:choose>
<h2>Projects tied on ${it.displayName}</h2>
<j:set var="jobs" value="${it.tiedJobs}" />

View File

@ -1,9 +1,25 @@
<div>
Command to be used to launch a slave agent program, which controls the slave
computer and communicates with the master. This command is executed on the
computer and communicates with the master.
<h3>JNLP slave agents</h3>
<p>
Leave this field to empty if you'd like to launch slave agents via JNLP.
With this setting, the slave information page (hudson/computer/***/) will
have a JNLP launch icon, and you can click that link from the correct slave
machine to launch a slave agent via JNLP.
<p>
This mode is convenient for Windows slaves that often do not have remote execution
mechanism.
<h3>ssh/rsh slave agents</h3>
<p>
When actual command is specified in this field,
this command is executed on the
master, and Hudson assumes that the executed program launches <tt>slave.jar</tt>
program on the correct slave machine.
<p>
A copy of <tt>slave.jar</tt> can be found on <tt>WEB-INF/slave.jar</tt> inside
<tt>hudson.war</tt>.