diff --git a/apps/authentication/serializers/connection_token.py b/apps/authentication/serializers/connection_token.py index 4579e73ee..5781b020d 100644 --- a/apps/authentication/serializers/connection_token.py +++ b/apps/authentication/serializers/connection_token.py @@ -40,6 +40,7 @@ class ConnectionTokenSerializer(CommonModelSerializer): 'from_ticket': {'read_only': True}, 'value': {'read_only': True}, 'is_expired': {'read_only': True, 'label': _('Is expired')}, + 'org_name': {'label': _("Org name")}, } def get_request_user(self): diff --git a/apps/i18n/core/en/LC_MESSAGES/django.po b/apps/i18n/core/en/LC_MESSAGES/django.po index bc6f8b543..5088f557c 100644 --- a/apps/i18n/core/en/LC_MESSAGES/django.po +++ b/apps/i18n/core/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-04 18:09+0800\n" +"POT-Creation-Date: 2024-07-05 16:34+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3357,6 +3357,11 @@ msgstr "" msgid "Is expired" msgstr "Expired" +#: authentication/serializers/connection_token.py:43 +#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 +msgid "Org name" +msgstr "Organization" + #: authentication/serializers/password_mfa.py:29 #: users/templates/users/forgot_password.html:153 msgid "The {} cannot be empty" @@ -4473,7 +4478,8 @@ msgstr "" msgid "Run as policy" msgstr "" -#: ops/models/job.py:222 terminal/notifications.py:174 +#: ops/models/job.py:222 ops/serializers/job.py:92 +#: terminal/notifications.py:174 msgid "Job" msgstr "" @@ -4485,7 +4491,7 @@ msgstr "" msgid "Material Type" msgstr "" -#: ops/models/job.py:545 +#: ops/models/job.py:547 msgid "Job Execution" msgstr "" @@ -4549,7 +4555,11 @@ msgstr "" msgid "Is finished" msgstr "Finished" -#: ops/serializers/job.py:90 +#: ops/serializers/job.py:89 +msgid "Task id" +msgstr "" + +#: ops/serializers/job.py:98 msgid "You do not have permission for the current job." msgstr "" @@ -4652,10 +4662,6 @@ msgstr "請選擇一個組織後再保存" msgid "Organization" msgstr "" -#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 -msgid "Org name" -msgstr "Organization" - #: orgs/models.py:14 msgid "GLOBAL" msgstr "" diff --git a/apps/i18n/core/ja/LC_MESSAGES/django.po b/apps/i18n/core/ja/LC_MESSAGES/django.po index 1a3b6127d..82b7e759a 100644 --- a/apps/i18n/core/ja/LC_MESSAGES/django.po +++ b/apps/i18n/core/ja/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-04 18:09+0800\n" +"POT-Creation-Date: 2024-07-05 16:34+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3423,6 +3423,11 @@ msgstr "アクション" msgid "Is expired" msgstr "期限切れです" +#: authentication/serializers/connection_token.py:43 +#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 +msgid "Org name" +msgstr "組織名" + #: authentication/serializers/password_mfa.py:29 #: users/templates/users/forgot_password.html:153 msgid "The {} cannot be empty" @@ -4575,7 +4580,8 @@ msgstr "ユーザーとして実行" msgid "Run as policy" msgstr "ユーザー ポリシー" -#: ops/models/job.py:222 terminal/notifications.py:174 +#: ops/models/job.py:222 ops/serializers/job.py:92 +#: terminal/notifications.py:174 msgid "Job" msgstr "ジョブ#ジョブ#" @@ -4587,7 +4593,7 @@ msgstr "Material" msgid "Material Type" msgstr "Material を選択してオプションを設定します。" -#: ops/models/job.py:545 +#: ops/models/job.py:547 msgid "Job Execution" msgstr "ジョブ実行" @@ -4651,7 +4657,11 @@ msgstr "タスクの種類" msgid "Is finished" msgstr "終了しました" -#: ops/serializers/job.py:90 +#: ops/serializers/job.py:89 +msgid "Task id" +msgstr "タスク ID" + +#: ops/serializers/job.py:98 msgid "You do not have permission for the current job." msgstr "あなたは現在のジョブの権限を持っていません。" @@ -4755,10 +4765,6 @@ msgstr "組織を選択してから保存してください" msgid "Organization" msgstr "組織" -#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 -msgid "Org name" -msgstr "組織名" - #: orgs/models.py:14 msgid "GLOBAL" msgstr "グローバル組織" diff --git a/apps/i18n/core/zh/LC_MESSAGES/django.po b/apps/i18n/core/zh/LC_MESSAGES/django.po index 7d9fc1b7f..5ebee2fe7 100644 --- a/apps/i18n/core/zh/LC_MESSAGES/django.po +++ b/apps/i18n/core/zh/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: JumpServer 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-04 18:09+0800\n" +"POT-Creation-Date: 2024-07-05 16:34+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -3386,6 +3386,11 @@ msgstr "动作" msgid "Is expired" msgstr "已过期" +#: authentication/serializers/connection_token.py:43 +#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 +msgid "Org name" +msgstr "组织名称" + #: authentication/serializers/password_mfa.py:29 #: users/templates/users/forgot_password.html:153 msgid "The {} cannot be empty" @@ -4514,7 +4519,8 @@ msgstr "运行用户" msgid "Run as policy" msgstr "用户策略" -#: ops/models/job.py:222 terminal/notifications.py:174 +#: ops/models/job.py:222 ops/serializers/job.py:92 +#: terminal/notifications.py:174 msgid "Job" msgstr "作业" @@ -4526,7 +4532,7 @@ msgstr "Material" msgid "Material Type" msgstr "Material 类型" -#: ops/models/job.py:545 +#: ops/models/job.py:547 msgid "Job Execution" msgstr "作业执行" @@ -4590,7 +4596,11 @@ msgstr "任务类型" msgid "Is finished" msgstr "是否完成" -#: ops/serializers/job.py:90 +#: ops/serializers/job.py:89 +msgid "Task id" +msgstr "任务 ID" + +#: ops/serializers/job.py:98 msgid "You do not have permission for the current job." msgstr "你没有当前作业的权限。" @@ -4693,10 +4703,6 @@ msgstr "请选择一个组织后再保存" msgid "Organization" msgstr "组织" -#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 -msgid "Org name" -msgstr "组织名称" - #: orgs/models.py:14 msgid "GLOBAL" msgstr "全局组织" diff --git a/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po b/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po index 9a139525a..2c428330b 100644 --- a/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po +++ b/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: JumpServer 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-04 18:09+0800\n" +"POT-Creation-Date: 2024-07-05 16:34+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -3388,6 +3388,11 @@ msgstr "動作" msgid "Is expired" msgstr "已過期" +#: authentication/serializers/connection_token.py:43 +#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 +msgid "Org name" +msgstr "組織名稱" + #: authentication/serializers/password_mfa.py:29 #: users/templates/users/forgot_password.html:153 msgid "The {} cannot be empty" @@ -4517,7 +4522,8 @@ msgstr "執行使用者" msgid "Run as policy" msgstr "使用者策略" -#: ops/models/job.py:222 terminal/notifications.py:174 +#: ops/models/job.py:222 ops/serializers/job.py:92 +#: terminal/notifications.py:174 msgid "Job" msgstr "作業" @@ -4529,7 +4535,7 @@ msgstr "Material" msgid "Material Type" msgstr "Material 類型" -#: ops/models/job.py:545 +#: ops/models/job.py:547 msgid "Job Execution" msgstr "作業執行" @@ -4593,7 +4599,11 @@ msgstr "任務類型" msgid "Is finished" msgstr "是否完成" -#: ops/serializers/job.py:90 +#: ops/serializers/job.py:89 +msgid "Task id" +msgstr "任務 ID" + +#: ops/serializers/job.py:98 msgid "You do not have permission for the current job." msgstr "你沒有當前作業的權限。" @@ -4696,10 +4706,6 @@ msgstr "請選擇一個組織後再保存" msgid "Organization" msgstr "組織" -#: orgs/mixins/serializers.py:26 rbac/serializers/rolebinding.py:27 -msgid "Org name" -msgstr "組織名稱" - #: orgs/models.py:14 msgid "GLOBAL" msgstr "全局組織" diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index ecdbfaceb..ba6f34c29 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -1383,5 +1383,8 @@ "ZoneList": "Zones", "ZoneUpdate": "Update the zone", "forceEnableMFAHelpText": "If force enable, user can not disable by themselves", - "removeWarningMsg": "Are you sure you want to remove" + "removeWarningMsg": "Are you sure you want to remove", + "RetrySelected": "Retry selected", + "ApproveSelected": "Approve selected", + "Running": "Running" } \ No newline at end of file diff --git a/apps/i18n/lina/zh.json b/apps/i18n/lina/zh.json index 69d30500d..9bf631a30 100644 --- a/apps/i18n/lina/zh.json +++ b/apps/i18n/lina/zh.json @@ -1385,5 +1385,8 @@ "ZoneUpdate": "更新网域", "forceEnableMFAHelpText": "如果强制启用,用户无法自行禁用", "removeWarningMsg": "你确定要移除", - "VaultHCPMountPoint": "Vault 服务器的挂载点,默认为 jumpserver" + "VaultHCPMountPoint": "Vault 服务器的挂载点,默认为 jumpserver", + "RetrySelected": "重试所选", + "ApproveSelected": "审批所选", + "Running": "运行中" } \ No newline at end of file diff --git a/apps/ops/api/job.py b/apps/ops/api/job.py index f31df2b13..55365861b 100644 --- a/apps/ops/api/job.py +++ b/apps/ops/api/job.py @@ -271,7 +271,10 @@ class JobExecutionTaskDetail(APIView): execution = get_object_or_404(JobExecution, pk=task_id, creator=request.user) return Response(data={ - 'status': execution.status, + 'status': { + 'value': execution.status, + 'label': execution.get_status_display() + }, 'is_finished': execution.is_finished, 'is_success': execution.is_success, 'time_cost': execution.time_cost, diff --git a/apps/ops/models/job.py b/apps/ops/models/job.py index f8aedd209..689989b9a 100644 --- a/apps/ops/models/job.py +++ b/apps/ops/models/job.py @@ -247,6 +247,8 @@ class JobExecution(JMSOrgBaseModel): verbose_name=_("Material Type")) # clean up zombie execution + def get_status_display(self): + return dict(JobStatus.choices).get(self.status, self.status) @classmethod def clean_unexpected_execution(cls): diff --git a/apps/ops/serializers/job.py b/apps/ops/serializers/job.py index b66ab4202..431b062d0 100644 --- a/apps/ops/serializers/job.py +++ b/apps/ops/serializers/job.py @@ -84,6 +84,14 @@ class JobExecutionSerializer(BulkOrgResourceModelSerializer): fields = read_only_fields + [ "job", "parameters", "creator" ] + extra_kwargs = { + "task_id": { + "label": _("Task id"), + }, + "job": { + "label": _("Job"), + } + } def validate_job(self, job_obj): if job_obj.creator != self.context['request'].user: