diff --git a/apps/accounts/api/automations/check_account.py b/apps/accounts/api/automations/check_account.py index 657a4b5c0..c34f92f10 100644 --- a/apps/accounts/api/automations/check_account.py +++ b/apps/accounts/api/automations/check_account.py @@ -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], diff --git a/apps/accounts/templates/accounts/change_secret_report.html b/apps/accounts/templates/accounts/change_secret_report.html index 637e8fabb..5dd15cced 100644 --- a/apps/accounts/templates/accounts/change_secret_report.html +++ b/apps/accounts/templates/accounts/change_secret_report.html @@ -14,6 +14,11 @@
+
+ {% trans 'Task name' %} + {{ execution.automation.name }} +
+
{% trans 'Date start' %} {{ execution.date_start | date:"Y/m/d H:i:s" }} @@ -43,12 +48,7 @@ {% trans 'Asset not support count' %} {{ summary.error_assets | default:0 }}
- -
- {% trans 'Task name' %} - {{ execution.automation.name }} -
- +
{% trans 'Time using' %} {{ execution.duration }}s diff --git a/apps/accounts/templates/accounts/check_account_report.html b/apps/accounts/templates/accounts/check_account_report.html index bad0fc065..c3f069fb6 100644 --- a/apps/accounts/templates/accounts/check_account_report.html +++ b/apps/accounts/templates/accounts/check_account_report.html @@ -14,6 +14,11 @@
+
+ {% trans 'Task name' %} + {{ execution.snapshot.name }} +
+
{% trans 'Date start' %} {{ execution.date_start | date:"Y/m/d H:i:s" }} @@ -31,27 +36,30 @@
{% trans 'Weak password' %} - {{ summary.weak_password | default:0 }} + + {{ summary.weak_password | default:0 }} +
{% trans 'Leaked password' %} - {{ summary.leaked_password | default:0 }} + + {{ summary.leaked_password | default:0 }} +
{% trans 'Repeated password' %} - {{ summary.repeated_password | default:0 }} + + {{ summary.repeated_password | default:0 }} +
{% trans 'No secret' %} - {{ summary.no_secret | default:0 }} -
- -
- {% trans 'Task name' %} - {{ execution.automation.name }} + + {{ summary.no_secret | default:0 }} +
@@ -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; diff --git a/apps/accounts/templates/accounts/gather_account_report.html b/apps/accounts/templates/accounts/gather_account_report.html index 4fc9003ae..440613e23 100644 --- a/apps/accounts/templates/accounts/gather_account_report.html +++ b/apps/accounts/templates/accounts/gather_account_report.html @@ -12,6 +12,11 @@
+
+ {% trans 'Task name' %} + {{ execution.automation.name }} +
+
{% trans 'Date start' %} {{ execution.date_start | date:"Y/m/d H:i:s" }} @@ -42,11 +47,6 @@ {{ summary.error_assets | default:0 }}
-
- {% trans 'Task name' %} - {{ execution.automation.name }} -
-
{% trans 'Time using' %} {{ execution.duration }}s diff --git a/apps/accounts/templates/accounts/push_account_report.html b/apps/accounts/templates/accounts/push_account_report.html index 9d3de44cc..7708f05b8 100644 --- a/apps/accounts/templates/accounts/push_account_report.html +++ b/apps/accounts/templates/accounts/push_account_report.html @@ -13,6 +13,11 @@
+
+ {% trans 'Task name' %} + {{ execution.automation.name }} +
+
{% trans 'Date start' %} {{ execution.date_start | date:"Y/m/d H:i:s" }} @@ -42,12 +47,7 @@ {% trans 'Asset not support count' %} {{ summary.error_assets | default:0 }}
- -
- {% trans 'Task name' %} - {{ execution.automation.name }} -
- +
{% trans 'Time using' %} {{ execution.duration }}s diff --git a/apps/assets/automations/base/manager.py b/apps/assets/automations/base/manager.py index 87a5fe7d9..3c968213f 100644 --- a/apps/assets/automations/base/manager.py +++ b/apps/assets/automations/base/manager.py @@ -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 diff --git a/apps/common/management/commands/services/services/celery_base.py b/apps/common/management/commands/services/services/celery_base.py index edfd7bb0e..859ca26b4 100644 --- a/apps/common/management/commands/services/services/celery_base.py +++ b/apps/common/management/commands/services/services/celery_base.py @@ -14,7 +14,8 @@ class CeleryBaseService(BaseService): print('\n- Start Celery as Distributed Task Queue: {}'.format(self.queue.capitalize())) ansible_config_path = os.path.join(settings.APPS_DIR, 'libs', 'ansible', 'ansible.cfg') ansible_modules_path = os.path.join(settings.APPS_DIR, 'libs', 'ansible', 'modules') - os.environ.setdefault('LC_ALL', 'C.UTF-8') + os.environ.setdefault('LC_ALL', 'en_US.UTF-8') + os.environ.setdefault('LANG', 'en_US.UTF-8') os.environ.setdefault('PYTHONOPTIMIZE', '1') os.environ.setdefault('ANSIBLE_FORCE_COLOR', 'True') os.environ.setdefault('ANSIBLE_CONFIG', ansible_config_path) diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index 41bc2f68b..a003cbede 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -1465,7 +1465,7 @@ "View": "View", "ViewMore": "View more", "ViewPerm": "View", - "ViewSecret": "View ciphertext", + "ViewSecret": "View secret", "VirtualAccountDetail": "Virtual account details", "VirtualAccountHelpMsg": "Virtual accounts are specialized accounts with specific purposes when connecting assets.", "VirtualAccountUpdate": "Virtual account update",