mirror of https://github.com/jumpserver/jumpserver
perf: update automation report template
parent
a784ca29c3
commit
c0b548af67
|
@ -56,7 +56,7 @@ class DiscoverAccountsExecutionViewSet(AutomationExecutionViewSet):
|
||||||
if not asset_id:
|
if not asset_id:
|
||||||
return Response(status=400, data={"asset_id": "This field is required."})
|
return Response(status=400, data={"asset_id": "This field is required."})
|
||||||
|
|
||||||
get_object_or_404(Asset, pk=asset_id)
|
asset = get_object_or_404(Asset, pk=asset_id)
|
||||||
execution = AutomationExecution()
|
execution = AutomationExecution()
|
||||||
execution.snapshot = {
|
execution.snapshot = {
|
||||||
"assets": [asset_id],
|
"assets": [asset_id],
|
||||||
|
@ -64,7 +64,7 @@ class DiscoverAccountsExecutionViewSet(AutomationExecutionViewSet):
|
||||||
"type": "gather_accounts",
|
"type": "gather_accounts",
|
||||||
"is_sync_account": False,
|
"is_sync_account": False,
|
||||||
"check_risk": True,
|
"check_risk": True,
|
||||||
"name": "Adhoc gather accounts: {}".format(asset_id),
|
"name": "Adhoc gather accounts: {}".format(asset.name),
|
||||||
}
|
}
|
||||||
execution.save()
|
execution.save()
|
||||||
execution.start()
|
execution.start()
|
||||||
|
|
|
@ -45,6 +45,9 @@ class AutomationExecution(AssetAutomationExecution):
|
||||||
('add_backupaccountexecution', _('Can add backup account execution')),
|
('add_backupaccountexecution', _('Can add backup account execution')),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return '{}: {}'.format(self.snapshot.get('name', ''), self.id)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def manager(self):
|
def manager(self):
|
||||||
from accounts.automations.endpoint import ExecutionManager
|
from accounts.automations.endpoint import ExecutionManager
|
||||||
|
|
|
@ -14,6 +14,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-section collapsible-content" id="basic-info-content">
|
<div class="container-section collapsible-content" id="basic-info-content">
|
||||||
|
<div class="item">
|
||||||
|
<span class="item-label">{% trans 'Task name' %}</span>
|
||||||
|
<span class="item-value">{{ execution.snapshot.name }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<span class="item-label">{% trans 'Date start' %}</span>
|
<span class="item-label">{% trans 'Date start' %}</span>
|
||||||
<span class="item-value">{{ execution.date_start | date:"Y/m/d H:i:s" }}</span>
|
<span class="item-value">{{ execution.date_start | date:"Y/m/d H:i:s" }}</span>
|
||||||
|
@ -29,11 +34,6 @@
|
||||||
<span class="item-value">{{ summary.total_accounts | default:0 }}</span>
|
<span class="item-value">{{ summary.total_accounts | default:0 }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item">
|
|
||||||
<span class="item-label">{% trans 'Task name' %}</span>
|
|
||||||
<span class="item-value">{{ execution.automation.name }}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<span class="item-label">{% trans 'Time using' %}</span>
|
<span class="item-label">{% trans 'Time using' %}</span>
|
||||||
<span class="item-value">{{ execution.duration }}s</span>
|
<span class="item-value">{{ execution.duration }}s</span>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<div class="container-section collapsible-content" id="basic-info-content">
|
<div class="container-section collapsible-content" id="basic-info-content">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<span class="item-label">{% trans 'Task name' %}</span>
|
<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>
|
||||||
|
|
||||||
<div class="item">
|
<div class="item">
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<div class="container-section collapsible-content" id="basic-info-content">
|
<div class="container-section collapsible-content" id="basic-info-content">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<span class="item-label">{% trans 'Task name' %}</span>
|
<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>
|
||||||
|
|
||||||
<div class="item">
|
<div class="item">
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<div class="container-section collapsible-content" id="basic-info-content">
|
<div class="container-section collapsible-content" id="basic-info-content">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<span class="item-label">{% trans 'Task name' %}</span>
|
<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>
|
||||||
|
|
||||||
<div class="item">
|
<div class="item">
|
||||||
|
|
Loading…
Reference in New Issue