Merge pull request #13616 from jumpserver/pr@dev@translate

perf: Translate
pull/13618/head
ZhaoJiSen 2024-07-05 16:50:00 +08:00 committed by GitHub
commit 8a3fb6bd4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 79 additions and 35 deletions

View File

@ -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):

View File

@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 "グローバル組織"

View File

@ -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 <ibuler@qq.com>\n"
"Language-Team: JumpServer team<ibuler@qq.com>\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 "全局组织"

View File

@ -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 <ibuler@qq.com>\n"
"Language-Team: JumpServer team<ibuler@qq.com>\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 "全局組織"

View File

@ -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"
}

View File

@ -1385,5 +1385,8 @@
"ZoneUpdate": "更新网域",
"forceEnableMFAHelpText": "如果强制启用,用户无法自行禁用",
"removeWarningMsg": "你确定要移除",
"VaultHCPMountPoint": "Vault 服务器的挂载点,默认为 jumpserver"
"VaultHCPMountPoint": "Vault 服务器的挂载点,默认为 jumpserver",
"RetrySelected": "重试所选",
"ApproveSelected": "审批所选",
"Running": "运行中"
}

View File

@ -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,

View File

@ -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):

View File

@ -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: