-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
build_detail.html
276 lines (243 loc) · 9.61 KB
/
build_detail.html
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 "projects/base_project.html" %}
{% load i18n %}
{% load privacy_tags %}
{% load static %}
{% block title %}{{ build.project.name }}{% endblock %}
{% block extra_scripts %}
<script type="text/javascript" src="{% static 'vendor/knockout.js' %}"></script>
<script type="text/javascript" src="{% static 'builds/js/detail.js' %}"></script>
<script type="text/javascript">
var detail_views = require('builds/detail');
$(document).ready(function () {
var view = detail_views.BuildDetailView.init({id: '{{ build.pk }}'});
});
</script>
{% endblock %}
{% block extra_links %}
<link rel="stylesheet" href="{% static 'builds/css/detail.css' %}" />
{% endblock %}
{% block project_editing %}
{% with builds_active="active" %}
{% include "core/project_bar.html" %}
{% endwith %}
{% endblock %}
{% block content %}
<div class="build build-detail" id="build-detail">
{% if build.state != "finished" and build.state != "cancelled" and request.user|is_admin:project %}
<form method="post" action="{% url "builds_detail" build.version.project.slug build.pk %}">
{% csrf_token %}
<input type="submit" value="{% trans "Cancel build" %}">
</form>
{% endif %}
<!-- Build meta data -->
<ul class="build-meta">
<div data-bind="visible: finished()">
<li>
{% trans "Completed" %}
<span>{{ build.date|date:"N j, Y. P" }}</span>
</li>
<li>
{% trans "Build took" %}
<span data-bind="text: length">
{{ build.length }}
</span>
{% trans "seconds" %}
</li>
</div>
{% if build.builder and request.user.is_staff %}
<li>
{% trans "Built on" %}
{{ build.builder }}
</li>
{% endif %}
<div data-bind="visible: finished() && success() && docs_url">
<li>
<a data-bind="attr: {href: docs_url}">
{% trans "View docs" %}
</a>
</li>
</div>
<div data-bind="visible: finished()">
<li>
<a href="{% url "build-detail" build.pk "txt" %}">
{% trans "View raw" %}
</a>
</li>
</div>
{# Show rebuild button only if the version is external, active and it's the latest build for this version #}
{# see https://github.com/readthedocs/readthedocs.org/pull/6995#issuecomment-852918969 #}
{% if request.user|is_admin:project and build.can_rebuild %}
<div data-bind="visible: finished()">
<form method="post" name="rebuild_commit" action="{% url "builds_project_list" project.slug %}">
{% csrf_token %}
<a href="#" onclick="document.forms['rebuild_commit'].submit();">
Rebuild this build
</a>
<input type="hidden" name="version_slug" value="{{ build.version.slug }}">
<input type="hidden" name="build_pk" value="{{ build.pk }}">
</form>
</div>
{% endif %}
</ul>
<div class="build-id">
{% blocktrans trimmed with build_id=build.pk %}
Build #{{ build_id }}
{% endblocktrans %}
</div>
<div class="build-version">
<span class="build-version-slug">
{% if request.user|is_admin:project and not build.is_external and build.version %}
<a href="{% url "project_version_detail" build.version.project.slug build.version.slug %}">{{ build.version.slug }}</a>
{% elif build.is_external %}
{% blocktrans with build.external_version_name as external_version_name %}
<b>{{ external_version_name }}</b>
{% endblocktrans %}
#<a href="{{ build.vcs_url }}">{{ build.get_version_name }}</a>
{% else %}
{{ build.get_version_slug }}
{% endif %}
</span>
<span class="build-commit" data-bind="visible: commit">
{% if build.get_commit_url %}
(<a data-bind="attr: {href: commit_url}"><span data-bind="text: commit">{{ build.commit }}</span></a>)
{% else %}
(<span data-bind="text: commit">{{ build.commit }}</span>)
{% endif %}
</span>
</div>
<div class="build-state">
<span>
<span data-bind="visible: !finished(), text: state_display"
style="display: none;">
{{ build.get_state_display }}
</span>
<img src="{% static 'core/img/loader.gif' %}"
data-bind="visible: !finished()"
style="display: none;" />
</span>
<span class="build-state-successful"
data-bind="visible: finished() && success()"
style="display: none;">
{% trans "Build completed" %}
</span>
<span class="build-state-failed"
data-bind="visible: finished() && !success() && !cancelled()"
style="display: none;">
{% trans "Build failed" %}
</span>
<span class="build-state-cancelled"
data-bind="visible: finished() && !success() && cancelled()"
style="display: none;">
{% trans "Build cancelled" %}
</span>
</div>
{% if request.user|is_admin:project %}
{% if not build.success and "setup.py install" in build.commands.last.output %}
<div class="build-ideas">
<p>
{% url 'projects_advanced' build.project.slug as advanced_url %}
{% blocktrans trimmed %}
Don't want <em>setup.py install</em> called?
Change the <strong>Install Project</strong> setting in your <a href="{{ advanced_url }}">advanced settings</a>.
{% endblocktrans %}
</p>
</div>
{% endif %}
{# This message is not dynamic and only appears when loading the page after the build has finished #}
{% if build.finished and build.deprecated_config_used %}
<div class="build-ideas">
<p>
{% blocktrans trimmed with config_file_link="https://blog.readthedocs.com/migrate-configuration-v2/" %}
<strong>Your builds will stop working soon!</strong><br/>
Configuration files will <strong>soon be required</strong> by projects, and will no longer be optional.
<a href="{{ config_file_link }}">Read our blog post to create one</a>
and ensure your project continues building successfully.
{% endblocktrans %}
</p>
</div>
{% endif %}
{% endif %}
{% if build.finished and build.config.build.commands %}
<div class="build-ideas">
<p>
{% blocktrans trimmed with config_file_link="https://docs.readthedocs.io/page/build-customization.html#override-the-build-process" %}
<strong>The <code>"build.commands"</code> feature is in beta, and could have backwards incompatible changes while in beta.</strong>
Read more at <a href="{{ config_file_link }}">our documentation</a> to find out its limitations and potential issues.
{% endblocktrans %}
</p>
</div>
{% endif %}
{% if build.output %}
{# If we have build output, this is an old build #}
<p>
<button data-bind="visible: !legacy_output(), click: show_legacy_output">
{% trans "Show full build output" %}
</button>
</p>
<div data-bind="visible: legacy_output"
style="display: none;">
<h3>{% trans "Build Output" %}</h3>
<pre class="build-output"><span id="build-output">{{ build.output }}</span></pre>
{% if build.setup %}
<h3>{% trans "Setup Output" %}</h3>
<pre class="build-output"><span id="build-setup">{{ build.setup }}</span></pre>
{% endif %}
{% if build.setup_error %}
<h3>{% trans "Environment Standard Error" %}</h3>
<pre class="build-error"><span id="build-setup_error">{{ build.setup_error }}</span></pre>
{% endif %}
</div>
{% if build.error %}
<h3>{% trans "Build Errors" %}</h3>
<pre class="build-error"><span id="build-error">{{ build.error }}</span></pre>
{% endif %}
{% else %}
{# Show new command output if lacking build.output #}
<div class="build-error"
data-bind="visible: error"
style="display: none;">
<h3>{% trans "Error" %}</h3>
<p class="build-error"
data-bind="text: error">
{{ build.error }}
</p>
<p>
{% block github_issue_link %}
{% if issue_url %}
{% blocktrans trimmed with url=issue_url %}
<a href="{{ url }}">Report any build issues here</a>.
{% endblocktrans %}
{% endif %}
{% endblock %}
</p>
</div>
<div id="build-commands"
class="build-command-list"
data-bind="visible: commands, foreach: display_commands"
style="display: none;">
<div class="build-command"
data-bind="css: command_status">
<div class="build-command-run" data-bind="click: toggleCommand">
<span data-bind="text: command"></span>
</div>
<div class="build-command-return"
data-bind="visible: is_showing">
<div class="build-command-output">
<span data-bind="text: output"></span>
</div>
<div class="build-command-meta">
<span class="build-command-time">
{% trans "Command time:" %}
<span data-bind="text: run_time">0</span>s
</span>
<span class="build-command-exit-code">
{% trans "Return" %}:
<span data-bind="text: exit_code"></span>
</span>
</div>
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}