summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templates/mrb_section.html
blob: b74f72393243ebe07fe02a7971c9369656459a1a (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
{% load static %}
{% load humanize %}
{% load project_url_tag %}
<script src="{% static 'js/mrbsection.js' %}"></script>

{% if mru %}
  {% if mrb_type == 'project' %}
    <h2>
      Latest project builds

      {% if project.is_default %}
        <span class="glyphicon glyphicon-question-sign get-help heading-help" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></span>
        {% endif %}
    </h2>
  {% else %}
    <div class="page-header">
      <h1>Latest builds</h1>
    </div>
  {% endif %}

  <div id="latest-builds">
    {% for build in mru %}
      <div data-latest-build-result="{{build.id}}" class="alert build-result {% if build.outcome == build.SUCCEEDED %}alert-success{% elif build.outcome == build.FAILED %}alert-danger{% else %}alert-info{% endif %}">
        <!-- project title -->
        {% if mrb_type != 'project' %}
          <div class="row project-name">
            <div class="col-md-12">
              <small>
                <a class="alert-link text-uppercase" href="{% project_url build.project %}">
                  {{build.project.name}}
                </a>
              </small>
            </div>
          </div>
        {% endif %}

        <div class="row" data-role="build-status-container">
          <div class="col-md-12">
            Loading...
          </div>
        </div>
      </div>
    {% endfor %}
  </div>
{% endif %}

<!-- build main template -->
<script id="build-template" type="text/x-jsrender">
  <div class="col-md-3">
    <!-- only show link for completed builds -->
    <%if state == 'Succeeded' || state == 'Failed'%>
      <a class="alert-link" href="<%:dashboard_url%>">
        <span data-toggle="tooltip" data-role="targets-text" title="Recipes: <%:targets%>">
          <%:targets_abbreviated%>
        </span>
      </a>
    <%else targets_abbreviated !== ''%>
      <span data-toggle="tooltip" data-role="targets-text" title="Recipes: <%:targets%>">
        <%:targets_abbreviated%>
      </span>
    <%else%>
      ...targets not yet available...
    <%/if%>
  </div>

  <%if state == 'Parsing'%>
    <%include tmpl='#parsing-recipes-build-template'/%>
  <%else state == 'Queued'%>
    <%include tmpl='#queued-build-template'/%>
  <%else state == 'Succeeded' || state == 'Failed'%>
    <%include tmpl='#succeeded-or-failed-build-template'/%>
  <%else state == 'Cancelling'%>
    <%include tmpl='#cancelling-build-template'/%>
  <%else state == 'Starting'%>
    <%include tmpl='#starting-template'/%>
  <%else state == 'In Progress'%>
    <%include tmpl='#in-progress-build-template'/%>
  <%else state == 'Cancelled'%>
    <%include tmpl='#cancelled-build-template'/%>
  <%/if%>
</script>

<!-- queued build -->
<script id="queued-build-template" type="text/x-jsrender">
  <div class="col-md-5">
    <span class="glyphicon glyphicon-question-sign get-help get-help-blue"
          title="This build is waiting for the build directory to become available">
    </span>

    Build queued
  </div>

  <div class="col-md-4">
    <!-- cancel button -->
    <%include tmpl='#cancel-template'/%>
  </div>
</script>

<!-- parsing recipes build -->
<script id="parsing-recipes-build-template" type="text/x-jsrender">
  <!-- progress bar and parse completion percentage -->
  <div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info">
    <!-- progress bar -->
    <div class="progress">
      <div id="recipes-parsed-percentage-bar-<%:id%>"
           style="width: <%:recipes_parsed_percentage%>%;"
           class="progress-bar">
      </div>
    </div>
  </div>

  <div class="col-md-4 progress-info">
    <!-- parse completion percentage -->
    <span class="glyphicon glyphicon-question-sign get-help get-help-blue" title="BitBake is parsing the layers required for your build">
    </span>

    Parsing <span id="recipes-parsed-percentage-<%:id%>"><%:recipes_parsed_percentage%></span>% complete

    <%include tmpl='#cancel-template'/%>
  </div>
</script>

<!-- in progress build; tasks still starting -->
<script id="starting-template" type="text/x-jsrender">
  <div class="col-md-5">
    <span class="glyphicon glyphicon-question-sign get-help get-help-blue"
          title="This build is waiting for tasks to start">
    </span>

    Tasks starting...
  </div>

  <div class="col-md-4">
    <!-- cancel button -->
    <%include tmpl='#cancel-template'/%>
  </div>
</script>

<!-- in progress build; at least one task finished -->
<script id="in-progress-build-template" type="text/x-jsrender">
  <!-- progress bar and task completion percentage -->
  <div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info">
    <!-- progress bar -->
    <div class="progress" id="build-pc-done-title-<%:id%>">
      <div id="build-pc-done-bar-<%:id%>"
           style="width: <%:tasks_complete_percentage%>%;"
           class="progress-bar">
      </div>
    </div>
  </div>

  <div class="col-md-4 progress-info">
    <!-- task completion percentage -->
    <span id="build-pc-done-<%:id%>"><%:tasks_complete_percentage%></span>% of
    tasks complete

    <!-- cancel button -->
    <%include tmpl='#cancel-template'/%>
  </div>
</script>

<!-- cancelling build -->
<script id="cancelling-build-template" type="text/x-jsrender">
  <div class="col-md-9">
    Cancelling the build ...
  </div>
</script>

<!-- succeeded or failed build -->
<script id="succeeded-or-failed-build-template" type="text/x-jsrender">
  <!-- completed_on -->
  <div class="col-md-2">
    <%:completed_on%>
  </div>

  <!-- errors -->
  <div class="col-md-2">
    <%if errors%>
      <span class="glyphicon glyphicon-minus-sign"></span>
      <a href="<%:dashboard_errors_url%>" class="alert-link">
        <%:errors%> error<%:errors_pluralize%>
      </a>
    <%/if%>
  </div>

  <!-- warnings -->
  <div class="col-md-2">
    <%if warnings%>
      <span class="glyphicon glyphicon-minus-sign"></span>
      <a href="<%:dashboard_warnings_url%>" class="alert-link">
        <%:warnings%> warning<%:warnings_pluralize%>
      </a>
    <%/if%>
  </div>

  <!-- build time -->
  <div class="col-md-3">
    Build time: <a class="alert-link" href="<%:buildtime_url%>"><%:buildtime%></a>

    <!-- rebuild button -->
    <%include tmpl='#rebuild-template'/%>
  </div>
</script>

<!-- cancelled build -->
<script id="cancelled-build-template" type="text/x-jsrender">
  <!-- build cancelled message -->
  <div class="col-md-6">
    Build cancelled
  </div>

  <!-- rebuild button -->
  <div class="col-md-3">
    <%include tmpl='#rebuild-template'/%>
  </div>
</script>

<!-- rebuild button or no rebuild icon -->
<script id="rebuild-template" type="text/x-jsrender">
  <%if is_default_project_build%>
    <!-- no rebuild info icon -->
    <span class="pull-right glyphicon glyphicon-question-sign get-help <%if state == 'Success'%>get-help-green<%else state == 'Failed'%>get-help-red<%else%>get-help-blue<%/if%>"
    title="Builds in this project cannot be started from Toaster: they are started from the command line">
    </span>
  <%else%>
    <!-- rebuild button -->
    <span class="rebuild-btn alert-link <%if state == 'Success'%>success<%else state == 'Failed'%>danger<%else%>info<%/if%> pull-right"
    data-request-url="<%:rebuild_url%>" data-target='<%:build_targets_json%>'>
      <span class="glyphicon glyphicon-repeat"></span>
      Rebuild
    </span>
  <%/if%>
</script>

<!-- cancel button or no cancel icon -->
<script id="cancel-template" type="text/x-jsrender">
  <%if is_default_project_build%>
    <!-- no cancel icon -->
    <span class="glyphicon glyphicon-question-sign get-help get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>
  <%else%>
    <!-- cancel button -->
    <span class="cancel-build-btn pull-right alert-link"
    data-buildrequest-id="<%:buildrequest_id%>" data-request-url="<%:cancel_url%>">
      <span class="glyphicon glyphicon-remove-circle"></span>
      Cancel
    </span>
  <%/if%>
</script>

<script>
  $(document).ready(function () {
    var ctx = {
      mrbType : "{{mrb_type}}",
    }

    try {
      mrbSectionInit(ctx);
    } catch (e) {
      document.write("Sorry, An error has occurred loading this page");
      console.warn(e);
    }
  });
</script>