aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/status/web/templates/console.html
blob: a51c946edfa29686353aedcd1e78c4551b7ba584 (plain)
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
{% extends "layout.html" %}

{% block head %}
{{ super() }}
<script type='text/javascript'>
// <![CDATA[
//

//
// Functions used to display the build status bubble on box click.
//

// show the build status box. This is called when the user clicks on a block.
function showBuildBox(url, event) {
    //  Find the current curson position.
    var cursorPosTop = (window.event ? window.event.clientY : event.pageY)
    var cursorPosLeft = (window.event ? window.event.clientX : event.pageX)

    // Offset the position by 5, to make the window appears under the cursor.
    cursorPosTop  = cursorPosTop  + document.body.scrollTop -5 ;    
    cursorPosLeft = cursorPosLeft  + document.body.scrollLeft - 5;

    // Move the div (hidden) under the cursor.
    var divBox = document.getElementById('divBox');
    divBox.style.top = parseInt(cursorPosTop) + 'px';
    divBox.style.left = parseInt(cursorPosLeft) + 'px';

    // Reload the hidden frame with the build page we want to show.
    // The onload even on this frame will update the div and make it visible.
    document.getElementById("frameBox").src = url
    
    // We don't want to reload the page.
    return false;
}

// OnLoad handler for the iframe containing the build to show.
function updateDiv(event) { 
    // Get the frame innerHTML.
    var iframeContent = document.getElementById("frameBox").contentWindow.document.body.innerHTML;

    // If there is any content, update the div, and make it visible.
    if (iframeContent) {
        var divBox = document.getElementById('divBox'); 
        divBox.innerHTML = iframeContent ;
        divBox.style.display = "block";
    }
} 

// Util functions to know if an element is contained inside another element.
// We use this to know when we mouse out our build status div.
function containsDOM (container, containee) {
    var isParent = false;
    do {
        if ((isParent = container == containee))
            break;
        containee = containee.parentNode;
    } while (containee != null);

    return isParent;
}

// OnMouseOut handler. Returns true if the mouse moved out of the element.
// It is false if the mouse is still in the element, but in a blank part of it,
// like in an empty table cell.
function checkMouseLeave(element, event) {
  if (element.contains && event.toElement) {
    return !element.contains(event.toElement);
  }
  else if (event.relatedTarget) {
    return !containsDOM(element, event.relatedTarget);
  }
}

// ]]> 
</script>
{% endblock %}

{% block content %}

<h1>Console View</h1> 

<div align="center">
  <table width="95%" class="Grid" border="0" cellspacing="0">
    <tr>
      <td width="33%" align="left" class="left_align">
{% if categories|length > 1 %}
        <br><b>Categories:</b> {% for c in categories %}{{ c.name|e }} {% endfor %}
{% endif %}
{% if codebase %}
        <br><b>Codebase:</b> {{ codebase|e }}
{% endif %}
{% if repository %}
        <br><b>Repository:</b> {{ repository|e }}
{% endif %}
{% if project %}
        <br><b>Project:</b> {{ project|e }}
{% endif %}
{% if branch != ANYBRANCH %}
        <br><b>Branch:</b> {{ branch|e }}
{% endif %}
      </td>
      <td width="33%" align="center" class="center_align">
        <div align="center">
          <table class="info">
            <tr>
              <td>Legend:&nbsp;&nbsp;</td>
              <td class='legend success' title='All tests passed'>Passed</td>
              <td class='legend failure' title='There is a new failure. Take a look!'>Failed</td>
              <td class='legend warnings' title='Build has warnings'>Warnings</td>
              <td class='legend failure-again' title='It was failing before, and it is still failing. Make sure you did not introduce new regressions'>Failed&nbsp;Again</td>
              <td class='legend running' title='The tests are still running'>Running</td>
              <td class='legend exception' title='Something went wrong with the test, there is no result'>Exception</td>
              <td class='legend offline' title='The builder is offline, as there are no slaves connected to it'>Offline</td>
              <td class='legend notstarted' title='No result yet.'>No&nbsp;data</td>
            </tr>
          </table>
        </div>
      </td>
      <td width="33%" align="right" class="right_align">
      <script type="text/javascript"> 
// <![CDATA[
          function reload_page() {
            name_value = document.getElementById('namebox').value
            if (document.location.href.lastIndexOf('?') == -1)
              document.location.href = document.location.href+ '?name=' + name_value;
            else
              document.location.href = document.location.href+ '&name=' + name_value;
          }
// ]]> 
        </script>
        <form onsubmit='reload_page()'>
          <input id='namebox' name='name' type='text' style='color:#999;'
              onblur='this.value = this.value || this.defaultValue; this.style.color = "#999";'
              onfocus='this.value=""; this.style.color = "#000";'
              value='Personalized for...'/>
          <input type='submit' value='Go'/>
        </form>
      </td>
     </tr>
  </table>
</div>

<br/>

{% set alt_class = cycler('', 'Alt') %}

<div align="center">
<table width="96%">
  
{% if categories|length > 1 %}
  <tr>
    <td width="1%">
    </td>
    <td width="1%">
    </td>
  {% for c in categories %}
      <td class='DevStatus {{ alt_class.next() }} {{ "first" if loop.first else '' }} {{ "last" if loop.last else '' }}' width='{{ c.size }}%'>
        {{ c.name|e }}
      </td>
  {% endfor %}
  </tr>
  <tr class='DevStatusSpacing'>
  </tr>
{% endif %}

{% if slaves %}
  <tr>
    <td width="1%">
    </td>
    <td width="1%">
    </td>
  {% for c in categories %}
    <td class='DevSlave {{ alt_class.next() }}'>
      <table width="100%">
        <tr>          
    {% for s in slaves[c.name] %}          
          <td class='DevSlaveBox'>
            <a href='{{ s.url }}' title='{{ s.pageTitle }}' class='DevSlaveBox {{ s.color }}' target="_blank">
            </a>
          </td>
    {% endfor %}            
        </tr>
      </table>
    </td>
  {% endfor %}
  </tr>
{% endif %}
  
{% for r in revisions %}
  {% set alt = alt_class.next() %}
  {% set firstrev = "first" if loop.first else '' %}

  <tr>
    <td class='DevRev {{ alt }}' width="1%">
      {{ r.id|shortrev(r.repository) }}
    </td>
    <td class='DevName {{ alt }}' width="1%">
      {{ r.who|user }}
    </td>

  {% for c in categories %}
    {% set last = "last" if loop.last else "" %}
    <td class='DevStatus {{ alt }} {{ last if not firstrev else '' }}'>
      <table width="100%">
        <tr>    
    {% for b in r.builds[c.name] %}
          <td class='DevStatusBox'>
            <a href='#' onclick='showBuildBox("{{ b.url }}", event); return false;'
               title='{{ b.pageTitle|e }}' class='DevStatusBox {{ b.color }} {{ b.tag }}'
               target="_blank"></a>
          </td>
    {% endfor %}    
        </tr>
      </table>
    </td>
  {% endfor %}
  </tr>
   
  <tr>
    <td colspan="{{ r.span }}" class='DevComment {{ alt }} {% if not r.details %}DevBottom{% endif %}'> 
      {{ r.comments|changecomment(r.project or None)|replace('\n', '<br/>')|replace('  ','&nbsp; ') }}
    </td>
  </tr>
 
  {% if r.details %}
  <tr>
    <td colspan="{{ r.span }}" class='DevDetails {{ alt }} DevBottom'>
      <ul style='margin: 0px; padding: 0 0 0 1.5em;'>
    {% for d in r.details %}
        <li>{{ d.buildername }}: {{ d.status }} - &nbsp;
      {%- for l in d.logs -%}
            <a href="{{ l.url }}">{{ l.name }}</a>
      {%- endfor -%}
        </li>
    {% endfor %}
      </ul>
    </td>
  </tr>    
  {% endif %} 
  
  <tr class='DevStatusSpacing'>
    <td>
    </td>
  </tr>  

{% else %}
 <tr><td>No revisions available</td></tr>
{% endfor %}
  
</table>
</div>


<div id="divBox" onmouseout="if (checkMouseLeave(this, event)) this.style.display = 'None'" class="BuildWaterfall"> 
</div>


<iframe id="frameBox" style="display: none;"></iframe>
  
<script type="text/javascript">
// replace 'onload="updateDiv(event);" with this, as iframe doesn't have onload event in xhtml
window.onload = function() {
  document.getElementById('frameBox').onload = function(event) {
    updateDiv(event);
  };
}; 
</script>

{% endblock %}


{% block footer %}

{{ super() }}
{# <p>Debug info: {{ debuginfo }}</p> #}
{% endblock %}