Skip to content

Commit

Permalink
frontend: add button for feeding log detective
Browse files Browse the repository at this point in the history
  • Loading branch information
FrostyX authored and nikromen committed Jan 29, 2024
1 parent 7afb039 commit 4b46a4a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ <h3> New Build Options </h3>
{% macro copr_build_delete_form(build, page, class="") %}
<form class="{{class}}" action="{{ url_for('coprs_ns.copr_delete_build', username=build.copr.user.name, coprname=build.copr.name, build_id=build.id)}}" method="post">
<input type="hidden" value="page" value="{{ page }}">
<button class="btn btn-default" type="submit">
<button class="btn btn-danger" type="submit">
<span class="pficon pficon-delete"></span> Delete
</button>
</form>
Expand Down Expand Up @@ -295,3 +295,22 @@ <h3> New Build Options </h3>
});
</script>
{% endmacro %}

{% macro copr_build_feed_log_detective(build, class="") %}
{% set url = "https://log-detective.com/contribute/copr/%s/%s" %}
{% set chroots = build.build_chroots|selectattr("state", "equalto", "failed") %}
<div class="dropdown {{ class }}">
<button class="btn btn-success dropdown-toggle" type="button" data-toggle="dropdown">
<span class="fa fa-external-link"></span>
Log Detective
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{% for chroot in chroots %}
<li><a href="{{ url |format(build.id, chroot.name) }}">Report {{ chroot.name }}</a></li>
{% else %}
<li><a href="{{ url |format(build.id, 'srpm-builds') }}">Report SRPM build</a></li>
{% endfor %}
</ul>
</div>
{% endmacro %}
12 changes: 11 additions & 1 deletion frontend/coprs_frontend/coprs/templates/coprs/detail/build.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{% extends "coprs/detail.html" %}
{% from "coprs/detail/_builds_forms.html" import copr_build_cancel_form, copr_build_repeat_form, copr_resubmit_allow_user_ssh_form, copr_build_delete_form %}
{% from "coprs/detail/_builds_forms.html" import
copr_build_cancel_form,
copr_build_repeat_form,
copr_resubmit_allow_user_ssh_form,
copr_build_delete_form,
copr_build_feed_log_detective
%}
{% from "coprs/detail/_describe_source.html" import describe_source %}
{% from "coprs/detail/_describe_failure.html" import describe_failure %}
{% from "_helpers.html" import chroot_to_os_logo, build_state_text, build_state, copr_name %}
Expand Down Expand Up @@ -29,6 +35,10 @@ <h2 class="build-detail"> Build {{ build.id }} doesn't belong to this project. <
{% endif %}
{% endif %}

{% if build.state == "failed" %}
{{ copr_build_feed_log_detective(build, class="pull-right button-build-action") }}
{% endif %}

{% if g.user and g.user.can_build_in(copr) and build.cancelable %}
{{ copr_build_cancel_form(build, page, class="pull-right button-build-action") }}
{% endif %}
Expand Down

0 comments on commit 4b46a4a

Please sign in to comment.