/hudson-core/src/main/resources/lib/hudson/executors.jelly
http://github.com/hudson/hudson · Unknown · 171 lines · 163 code · 8 blank · 0 comment · 0 complexity · 88d1639619ed7e5fdc9c3d32084b0074 MD5 · raw file
- <!--
- The MIT License
- Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi,
- Stephen Connolly, id:cactusman, Yahoo! Inc., Alan Harder
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- -->
- <?jelly escape-by-default='true'?>
- <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:local="local">
- <st:documentation>
- Displays the status of executors.
- <st:attribute name="computers">
- If specified, this is the list of computers whose executors are rendered. If omitted, all the computers
- in the system will be rendered.
- </st:attribute>
- </st:documentation>
- <d:taglib uri="local">
- <d:tag name="computerCaption">
- <a href="${rootURL}/${c.url}" title="${c.node!=null? c.node.nodeDescription : ''}">${title}</a><st:nbsp/>
- <j:choose>
- <j:when test="${c.offline}">
- ${%offline}
- </j:when>
- <j:when test="${!c.acceptingTasks}">
- ${%suspended}
- </j:when>
- <j:when test="${c.oneOffExecutorsCount != 0}">
- ${c.busyCount}/${c.executorsCount}+${c.oneOffExecutorsCount}
- </j:when>
- <j:otherwise>
- ${c.busyCount}/${c.executorsCount}
- </j:otherwise>
- </j:choose>
- </d:tag>
- <d:tag name="executor">
- <j:if test="${!e.idle}">
- <tr>
- <j:choose>
- <j:when test="${!e.alive}">
- <td class="pane">
- <a href="${rootURL}/${c.url}${url}/causeOfDeath">
- <div class="error">${%Dead} (!)</div>
- </a>
- </td>
- <td class="pane"/>
- </j:when>
- <j:otherwise>
- <!-- not actually optional, but it helps with backward compatibility -->
- <j:set var="executor" value="${e}"/>
- <st:include it="${e.currentExecutable}" page="executorCell.jelly" optional="true">
- <td class="pane">
- <div style="white-space: normal">${%Building}
- <j:set var="exe" value="${e.currentExecutable}" />
- <j:invokeStatic var="exeparent"
- className="hudson.model.queue.Executables" method="getParentOf">
- <j:arg type="hudson.model.Queue$Executable" value="${exe}" />
- </j:invokeStatic>
- <j:choose>
- <j:when test="${h.hasPermission(exeparent,exeparent.READ)}">
- <a href="${rootURL}/${exeparent.url}">${exeparent.fullDisplayName}</a> <a href="${rootURL}/${exe.url}">#${exe.number}</a>
- <t:buildProgressBar build="${exe}" executor="${executor}"/>
- </j:when>
- <j:otherwise>
- <span>${%Unknown Task}</span>
- </j:otherwise>
- </j:choose>
- </div>
- </td>
- </st:include>
- <td class="pane" width="16" align="center" valign="middle">
- <j:if test="${e.hasStopPermission()}">
- <a href="${rootURL}/${c.url}${url}/stop">
- <img src="${imagesURL}/16x16/stop.gif" alt="${%terminate this build}"/>
- </a>
- </j:if>
- </td>
- </j:otherwise>
- </j:choose>
- </tr>
- </j:if>
- </d:tag>
- </d:taglib>
- <j:set var="computers" value="${attrs.computers?:app.computers}"/>
- <l:pane width="2" id="executors" title="<a href='${rootURL}/computer/'>${%Build Executor Status}</a>">
- <colgroup>
- <col width="200*"/>
- <col width="24"/>
- </colgroup>
- <j:forEach var="c" items="${computers}">
- <tr>
- <j:choose>
- <j:when test="${c.node==app or computers.size()==1}">
- <th class="pane" colspan="2">
- <j:choose>
- <j:when test="${empty(app.slaves) or computers.size()==1}">
- <local:computerCaption title="Status"/>
- </j:when>
- <j:otherwise>
- <local:computerCaption title="Master"/>
- </j:otherwise>
- </j:choose>
- </th>
- </j:when>
- <j:otherwise>
- <th class="pane" colspan="2">
- <local:computerCaption title="${c.displayName}"/>
- </th>
- </j:otherwise>
- </j:choose>
- </tr>
- <j:choose>
- <j:when test="${c.connecting}">
- <tr>
- <td class="pane" colspan="2">
- Connecting
- </td>
- </tr>
- </j:when>
- <j:when test="${c.offline}">
- <tr>
- <td class="pane" colspan="2">
- Offline
- </td>
- </tr>
- </j:when>
- <j:when test="${c.idle}">
- <tr>
- <td class="pane" colspan="2">
- Idle
- </td>
- </tr>
- </j:when>
- <j:otherwise>
- <j:forEach var="e" items="${c.executors}" varStatus="eloop">
- <local:executor name="${eloop.index+1}" url="executors/${eloop.index}"/>
- </j:forEach>
- <j:forEach var="e" items="${c.oneOffExecutors}" varStatus="eloop">
- <local:executor name="" url="oneOffExecutors/${eloop.index}"/>
- </j:forEach>
- </j:otherwise>
- </j:choose>
- </j:forEach>
- </l:pane>
- <!-- schedule updates only for the full page reload -->
- <j:if test="${ajax==null and !h.isAutoRefresh(request) and h.hasPermission(app.READ)}">
- <script defer="defer">
- refreshPart('executors',"${h.hasView(it,'ajaxExecutors')?'.':rootURL}/ajaxExecutors");
- </script>
- </j:if>
- </j:jelly>