Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: b94b8b000c932d99056b4ce71ae4762f8ef51330 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!-- **************************************************************************
#
# Copyright  (c) 2004-2010 Oracle Corporation.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors: 
#
#    Kohsuke Kawaguchi,
#        
#
#************************************************************************** --> 

<?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}</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>&#160;<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.png" 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="&lt;a href='${rootURL}/computer/'>${%Build Executor Status}&lt;/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>

Back to the top