Skip to content

Commit

Permalink
Add processing in home.html
Browse files Browse the repository at this point in the history
  • Loading branch information
a-belhadj authored and Sispheor committed Jan 10, 2024
1 parent 7eca383 commit f3b2faf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
## Enhancement

- List related docs in OperationDetails and ServiceDetails view
- Add PROCESSING requests in the dashboard of the main page

# 2.5.0 2024-01-09

## Fix
Expand Down
3 changes: 3 additions & 0 deletions Squest/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def home(request):
service_dict["hold_requests"] = sum([x["count"] for x in all_requests if
x["state"] == RequestState.ON_HOLD and x[
"instance__service"] == service.id])
service_dict["processing_requests"] = sum([x["count"] for x in all_requests if
x["state"] == RequestState.PROCESSING and x[
"instance__service"] == service.id])

service_dict["opened_supports"] = sum([x["count"] for x in all_supports if
x["state"] == SupportState.OPENED and x[
Expand Down
8 changes: 8 additions & 0 deletions templates/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ <h3 class="card-title">Service overview</h3>
<th class="text-center">Submitted</th>
<th class="text-center">Accepted</th>
<th class="text-center">On hold</th>
<th class="text-center">Processing</th>
<th class="text-center">Failed</th>
{% if can_list_support %}
<th class="text-center">Supports</th>
Expand Down Expand Up @@ -86,6 +87,13 @@ <h3 class="card-title">Service overview</h3>
</a>
{% endif %}
</td>
<td class="align-middle text-center">
{% if service.processing_requests %}
<a href="{% url 'service_catalog:request_list' %}?state=6&instance__service__id={{ service.service.id }}"
class="btn text-white bg-orange btn-lg">{{ service.processing_requests }}
</a>
{% endif %}
</td>
<td class="align-middle text-center">
{% if service.failed_requests %}
<a href="{% url 'service_catalog:request_list' %}?state=8&instance__service__id={{ service.service.id }}"
Expand Down

0 comments on commit f3b2faf

Please sign in to comment.