fix server report n_computers
This commit is contained in:
parent
6b0110adda
commit
93d6502a66
|
@ -1105,9 +1105,9 @@ class ExportsView(View):
|
||||||
|
|
||||||
erasures = sorted(erasures, key=lambda x: x.end_time)
|
erasures = sorted(erasures, key=lambda x: x.end_time)
|
||||||
erasures_on_server = sorted(erasures_on_server, key=lambda x: x.end_time)
|
erasures_on_server = sorted(erasures_on_server, key=lambda x: x.end_time)
|
||||||
# import pdb; pdb.set_trace()
|
|
||||||
erasures_normal = list(set(erasures) - set(erasures_on_server))
|
erasures_normal = list(set(erasures) - set(erasures_on_server))
|
||||||
erasures_normal = sorted(erasures_normal, key=lambda x: x.end_time)
|
erasures_normal = sorted(erasures_normal, key=lambda x: x.end_time)
|
||||||
|
n_computers = len({x.parent for x in erasures} - erasures_host)
|
||||||
|
|
||||||
params = {
|
params = {
|
||||||
'title': 'Erasure Certificate',
|
'title': 'Erasure Certificate',
|
||||||
|
@ -1117,7 +1117,7 @@ class ExportsView(View):
|
||||||
'uuid_report': '{}'.format(uuid.uuid4()),
|
'uuid_report': '{}'.format(uuid.uuid4()),
|
||||||
'software': software,
|
'software': software,
|
||||||
'my_data': my_data,
|
'my_data': my_data,
|
||||||
'n_computers': len(set([x.parent for x in erasures])),
|
'n_computers': n_computers,
|
||||||
'result': result,
|
'result': result,
|
||||||
'customer_details': customer_details,
|
'customer_details': customer_details,
|
||||||
'erasure_hosts': erasures_host,
|
'erasure_hosts': erasures_host,
|
||||||
|
|
|
@ -159,19 +159,20 @@
|
||||||
<table class="body_content">
|
<table class="body_content">
|
||||||
<tbody>
|
<tbody>
|
||||||
{% if erasure_hosts %}
|
{% if erasure_hosts %}
|
||||||
{% for e in erasure_hosts %}
|
|
||||||
<tr style="padding-top:5px;">
|
<tr style="padding-top:5px;">
|
||||||
<td style="width:20%;">
|
<td style="width:20%;">
|
||||||
<span>N° of sanitization server ({{ loop.index }}/{{ erasure_hosts|length }}):</span>
|
<span>N° of sanitization server {{ erasure_hosts|length }}:</span>
|
||||||
</td>
|
</td>
|
||||||
<td style="width:80%;">
|
<td style="width:80%;">
|
||||||
|
{% for e in erasure_hosts %}
|
||||||
{% if e.serial_number %}
|
{% if e.serial_number %}
|
||||||
<span>{{ e.serial_number.upper() }}</span>
|
<span>{{ e.serial_number.upper() }}</span>{% if not loop.last %},{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endif %}
|
||||||
{% else %}
|
{% if n_computers %}
|
||||||
<tr style="padding-top:5px;">
|
<tr style="padding-top:5px;">
|
||||||
<td style="width:20%;">
|
<td style="width:20%;">
|
||||||
<span>N° of computers:</span>
|
<span>N° of computers:</span>
|
||||||
|
@ -245,7 +246,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" style="margin-top:225px;">
|
<div class="row" style="margin-top:200px;">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<table class="body_content" style="border-top: 1px solid #000;">
|
<table class="body_content" style="border-top: 1px solid #000;">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
Reference in New Issue