Skip to content

Commit

Permalink
feat: turbo后台信息国际化 TencentBlueKing#86
Browse files Browse the repository at this point in the history
  • Loading branch information
eazence committed Jun 28, 2023
1 parent a545e7d commit 5c1cc86
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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!!}"
Expand Down Expand Up @@ -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()) {
Expand All @@ -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}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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通用环境
Expand All @@ -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=关联的流水线

0 comments on commit 5c1cc86

Please sign in to comment.