mirror of https://github.com/jumpserver/jumpserver
perf: update report
parent
f513eb62a6
commit
44a3815044
|
@ -63,8 +63,8 @@ class CheckAccountExecutionViewSet(AutomationExecutionViewSet):
|
|||
if not asset_id:
|
||||
return Response(status=400, data={"asset_id": "This field is required."})
|
||||
|
||||
get_object_or_404(Asset, pk=asset_id)
|
||||
name = "Check asset risk: {}".format(asset_id)
|
||||
asset = get_object_or_404(Asset, pk=asset_id)
|
||||
name = "Check asset risk: {}".format(asset.name)
|
||||
execution = AutomationExecution()
|
||||
execution.snapshot = {
|
||||
"assets": [asset_id],
|
||||
|
|
|
@ -31,27 +31,35 @@
|
|||
|
||||
<div class="item">
|
||||
<span class="item-label">{% trans 'Weak password' %}</span>
|
||||
<span class="item-value">{{ summary.weak_password | default:0 }}</span>
|
||||
<span class="item-value{% if summary.weak_password > 0 %} red{% endif %}">
|
||||
{{ summary.weak_password | default:0 }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="item-label">{% trans 'Leaked password' %}</span>
|
||||
<span class="item-value">{{ summary.leaked_password | default:0 }}</span>
|
||||
<span class="item-value {% if summary.leaked_password > 0 %} red {% endif %}">
|
||||
{{ summary.leaked_password | default:0 }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="item-label">{% trans 'Repeated password' %}</span>
|
||||
<span class="item-value">{{ summary.repeated_password | default:0 }}</span>
|
||||
<span class="item-value {% if summary.repeated_password > 0 %} red {% endif %}">
|
||||
{{ summary.repeated_password | default:0 }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="item-label">{% trans 'No secret' %}</span>
|
||||
<span class="item-value">{{ summary.no_secret | default:0 }}</span>
|
||||
<span class="item-value {% if summary.no_secret > 0 %} red {% endif %}">
|
||||
{{ summary.no_secret | default:0 }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="item-label">{% trans 'Task name' %}</span>
|
||||
<span class="item-value">{{ execution.automation.name }}</span>
|
||||
<span class="item-value">{{ execution.snapshot.name }}</span>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
|
@ -205,6 +213,9 @@
|
|||
font: 500 14px/22px 'PingFang SC';
|
||||
}
|
||||
|
||||
.container-section .item .item-value.red {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.custom-table {
|
||||
margin-bottom: 0;
|
||||
|
@ -254,6 +265,7 @@
|
|||
color: #2e7d32;
|
||||
}
|
||||
|
||||
|
||||
.lost-accounts .section-header span {
|
||||
background: #fbe9e7;
|
||||
color: #d84315;
|
||||
|
|
|
@ -116,7 +116,7 @@ class BaseManager:
|
|||
automation.save(update_fields=['last_execution_date'])
|
||||
|
||||
def update_execution(self):
|
||||
self.duration = time.time() - self.time_start
|
||||
self.duration = round(time.time() - self.time_start, 2)
|
||||
self.execution.date_finished = timezone.now()
|
||||
self.execution.duration = self.duration
|
||||
self.execution.summary = self.summary
|
||||
|
|
Loading…
Reference in New Issue