From 5c1cc866a61acfeca5625c5ab86f97930c0b2bd6 Mon Sep 17 00:00:00 2001 From: RJ Date: Wed, 28 Jun 2023 16:39:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20turbo=E5=90=8E=E5=8F=B0=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=9B=BD=E9=99=85=E5=8C=96=20#86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devops/turbo/service/TurboPlanService.kt | 3 ++- .../devops/turbo/service/TurboRecordService.kt | 9 +++++---- .../src/main/resources/i18n/message_en.properties | 15 ++++++++++----- .../main/resources/i18n/message_zh_CN.properties | 5 +++++ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboPlanService.kt b/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboPlanService.kt index 5d8e3b0e..ae784a11 100644 --- a/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboPlanService.kt +++ b/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboPlanService.kt @@ -10,6 +10,7 @@ import com.tencent.devops.common.db.PageUtils import com.tencent.devops.common.service.prometheus.BkTimed import com.tencent.devops.common.util.JsonUtil import com.tencent.devops.common.util.MathUtil +import com.tencent.devops.common.web.utils.I18NUtil import com.tencent.devops.project.api.service.ServiceProjectResource import com.tencent.devops.turbo.dao.mongotemplate.TurboPlanDao import com.tencent.devops.turbo.dao.repository.TurboPlanRepository @@ -444,7 +445,7 @@ class TurboPlanService @Autowired constructor( planId = it.id, planName = it.planName, engineCode = it.engineCode, - engineName = it.engineName, + engineName = I18NUtil.getMessage("${it.engineCode}.engineName") ?: it.engineName, instanceNum = it.instanceNum, executeCount = it.executeCount, estimateTimeHour = if (it.executeCount <= 0) "0.0" else MathUtil.roundToTwoDigits(it.estimateTimeHour / it.executeCount), diff --git a/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboRecordService.kt b/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboRecordService.kt index e01dec84..ce74b334 100644 --- a/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboRecordService.kt +++ b/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboRecordService.kt @@ -14,6 +14,7 @@ import com.tencent.devops.common.util.constants.EXCHANGE_TURBO_PLUGIN import com.tencent.devops.common.util.constants.ROUTE_TURBO_PLUGIN_DATA import com.tencent.devops.common.util.constants.SYSTEM_ADMIN import com.tencent.devops.common.web.mq.CORE_RABBIT_TEMPLATE_NAME +import com.tencent.devops.common.web.utils.I18NUtil import com.tencent.devops.turbo.dao.mongotemplate.TurboRecordDao import com.tencent.devops.turbo.dao.repository.TurboRecordRepository import com.tencent.devops.turbo.dto.TurboRecordPluginUpdateDto @@ -312,11 +313,11 @@ class TurboRecordService @Autowired constructor( fun getTurboRecordDisplayInfo(turboRecordEntity: TTurboRecordEntity, turboPlanEntity: TTurboPlanEntity): TurboRecordDisplayVO { val displayFields = mutableListOf( TurboDisplayFieldVO( - fieldName = "任务ID", + fieldName = I18NUtil.getMessage("displayFields.taskId")!!, fieldValue = turboRecordEntity.id!! ), TurboDisplayFieldVO( - fieldName = "方案", + fieldName = I18NUtil.getMessage("displayFields.plan")!!, fieldValue = turboPlanEntity.planName, link = true, linkAddress = "$devopRootPath/console/turbo/${turboPlanEntity.projectId}/task/detail/${turboRecordEntity.turboPlanId!!}" @@ -350,7 +351,7 @@ class TurboRecordService @Autowired constructor( val displayFieldValue = (paramConfigMap[it.fieldKey]?.get(displayRange[it.fieldKey].toString())) ?: displayRange[it.fieldKey] displayFields.add( TurboDisplayFieldVO( - fieldName = it.fieldName, + fieldName = I18NUtil.getMessage("displayFields.${it.fieldKey}.fieldName") ?: it.fieldName, fieldValue = displayFieldValue, link = it.link, linkAddress = if (it.link == true && !it.linkTemplate.isNullOrBlank()) { @@ -371,7 +372,7 @@ class TurboRecordService @Autowired constructor( if (!turboRecordEntity.pipelineName.isNullOrBlank()) { displayFields.add( TurboDisplayFieldVO( - fieldName = "关联的流水线", + fieldName = I18NUtil.getMessage("displayFields.pipeline")!!, fieldValue = turboRecordEntity.pipelineName, link = true, linkAddress = "$devopRootPath/console/pipeline/${turboPlanEntity.projectId}/${turboRecordEntity.pipelineId}/detail/${turboRecordEntity.devopsBuildId}" diff --git a/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_en.properties b/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_en.properties index 4998bac9..a7bc8f7e 100644 --- a/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_en.properties +++ b/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_en.properties @@ -14,6 +14,7 @@ disttask-ue4.desc=A self-developed engine for accelerating Unreal Engine builds disttask-ue4.recommendReason=A self-developed engine for accelerating Unreal Engine builds across multiple platforms. Supports acceleration for Editor, Shader, Dedicated Servers, and more. disttask-ue4.engineName=Unreal Engine Acceleration disttask-ue4.paramConfig.worker_version.paramName=Build Environment +disttask-ue4.paramConfig.worker_version.tips=If the requirements are not met, please contact DevOps-helper disttask-ue4.paramConfig.worker_version.paramEnum.win2019-pure-drived=Windows General Environment disttask-ue4.paramConfig.worker_version.paramEnum.macvm=MacOS General Environment disttask-ue4.paramConfig.worker_version.paramEnum.tlinux2.2-generic=TLinux2.2 General Environment @@ -30,8 +31,12 @@ distcc.paramConfig.city.paramEnum.tianjin=Beijing/Tianjin distcc.paramConfig.gcc_version.paramName=Builder Version distcc.paramConfig.ccache_enabled.paramName=Enable Ccache -disttask-cc.displayFields.queue_name.fieldName=Acceleration Zone -disttask-cc.displayFields.request_cpu.fieldName=Acceleration CPU Core -disttask-cc.displayFields.worker_version.fieldName=Work Version -disttask-cc.displayFields.client_version.fieldName=Client Version -disttask-cc.displayFields.client_ip.fieldName=Initiating Node +displayFields.taskId=Plan ID +displayFields.plan=Plan ID +displayFields.queue_name.fieldName=Acceleration Zone +displayFields.request_cpu.fieldName=Acceleration CPU Core +displayFields.worker_version.fieldName=Worker Version +displayFields.client_version.fieldName=Client Version +displayFields.client_ip.fieldName=Initiating Node +displayFields.ccache_enabled.fieldName=Ccache +displayFields.pipeline=Associated Pipeline diff --git a/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_zh_CN.properties b/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_zh_CN.properties index 7c147fe9..5b5a8382 100644 --- a/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_zh_CN.properties +++ b/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_zh_CN.properties @@ -14,6 +14,7 @@ disttask-ue4.desc=自研引擎,多平台下的 UE4 构建加速。支持 Edito disttask-ue4.recommendReason=自研引擎,多平台下的 UE4 构建加速。支持 Editor、Shader、Dedicated Servers 等加速。 disttask-ue4.engineName=UE4加速 disttask-ue4.paramConfig.worker_version.paramName=编译环境 +disttask-ue4.paramConfig.worker_version.tips=若不满足需求,请联系 DevOps-helper disttask-ue4.paramConfig.worker_version.paramEnum.win2019-pure-drived=Windows通用环境 disttask-ue4.paramConfig.worker_version.paramEnum.macvm=Mac通用环境 disttask-ue4.paramConfig.worker_version.paramEnum.tlinux2.2-generic=TLinux2.2通用环境 @@ -30,8 +31,12 @@ distcc.paramConfig.city.paramEnum.tianjin=北京/天津 distcc.paramConfig.gcc_version.paramName=编译器版本 distcc.paramConfig.ccache_enabled.paramName=是否启用Ccache +displayFields.taskId=任务ID +displayFields.plan=方案 displayFields.queue_name.fieldName=加速集群地区 displayFields.request_cpu.fieldName=加速资源 displayFields.worker_version.fieldName=Worker 版本 displayFields.client_version.fieldName=Client 版本 displayFields.client_ip.fieldName=发起机器 IP +displayFields.ccache_enabled.fieldName=Ccache +displayFields.pipeline=关联的流水线