Skip to content

Commit 53f518b

Browse files
authored
1 parent 1bc6150 commit 53f518b

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

readthedocsext/theme/static/readthedocsext/theme/js/site.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readthedocsext/theme/templates/builds/build_detail.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,12 @@
243243
<td class="command">
244244
<code class="ui text"
245245
data-bind="text: command, class: command_class, click: toggle_expanded"></code>
246-
<a class="ui mini inverted label" data-bind="text: run_time() + 's'"></a>
247246
<a class="ui mini inverted label"
248-
data-bind="text: '{% trans "Exit" %}: ' + exit_code(), visible: exit_code() > 0"></a>
247+
data-bind="text: '{% trans "Running" %}', visible: !finished()"></a>
248+
<a class="ui mini inverted label"
249+
data-bind="text: run_time() + 's', visible: finished()"></a>
250+
<a class="ui mini inverted label"
251+
data-bind="text: '{% trans "Exit" %}: ' + exit_code(), visible: finished() && exit_code() > 0"></a>
249252
</td>
250253
</tr>
251254
</tbody>

src/js/build/detail.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ class BuildCommand {
8080
});
8181
/** @observable {number} Command run time in seconds */
8282
this.run_time = ko.observable(build_command.run_time);
83+
/** @observable {number} Command end time in seconds */
84+
this.end_time = ko.observable(build_command.end_time);
85+
/** @computed {Boolean} Command is finished running? */
86+
this.finished = ko.computed(() => {
87+
return this.end_time() !== null;
88+
});
8389
/** @computed {Boolean} This command is a debug class command */
8490
this.is_debug = ko.observable(is_debug);
8591
/** @computed {Boolean} Hide debug commands until debug mode is enabled */
@@ -503,7 +509,12 @@ export class BuildDetailView {
503509
return command_search.id() === command.id;
504510
},
505511
);
506-
if (!command_found) {
512+
if (command_found) {
513+
command_found.output(command.output);
514+
command_found.exit_code(command.exit_code || 0);
515+
command_found.run_time(command.run_time);
516+
command_found.end_time(command.end_time);
517+
} else {
507518
this.commands.push(new BuildCommand(command));
508519
}
509520
}

0 commit comments

Comments
 (0)