diff --git a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts index 70ec1e23..42fc22f7 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts @@ -682,4 +682,20 @@ export default { setAsDefault: "Set as Default", disabledLabel: "Disabled", confirmToggleStatus: "Are you sure to {action}?", + template: { + title: "Pipeline Template", + edit: "Pipeline Template Edit", + importCreate: "Pipeline Batch Create", + // intro: "可根据模版批量创建流水线", + intro: "Batch create pipeline based on template", + createTemplate: "Create Template", + useTemplate: "Use This Template", + batchCreate: "Batch Create Pipeline", + singleCreate: "Create Single Pipeline", + importCreate: "Batch Import Create", + templateName: "Template Name", + enterTemplateName: "Please enter template name", + copyPipelineConfig: "Copy this pipeline configuration as template source", + pipeline: "Pipeline", + }, }; diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts index 7721d4da..3f47f5b0 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts @@ -685,4 +685,20 @@ export default { setAsDefault: "设为默认", disabledLabel: "禁用", confirmToggleStatus: "确定要{action}吗?", + + template: { + title: "流水线模版", + edit: "流水线模版编辑", + importCreate: "流水线模版批量创建", + intro: "可根据模版批量创建流水线", + createTemplate: "创建模版", + useTemplate: "使用此模板", + batchCreate: "批量创建流水线", + singleCreate: "创建单个流水线", + importCreate: "批量导入创建", + templateName: "模板名称", + enterTemplateName: "请输入模板名称", + copyPipelineConfig: "复制该流水线配置作为模板来源", + pipeline: "流水线", + }, }; diff --git a/packages/ui/certd-client/src/router/source/modules/certd.ts b/packages/ui/certd-client/src/router/source/modules/certd.ts index cc255f8b..c638a475 100644 --- a/packages/ui/certd-client/src/router/source/modules/certd.ts +++ b/packages/ui/certd-client/src/router/source/modules/certd.ts @@ -44,7 +44,7 @@ export const certdResources = [ }, }, { - title: "流水线模版", + title: "certd.template.title", name: "PipelineTemplate", path: "/certd/pipeline/template", component: "/certd/pipeline/template/index.vue", @@ -54,7 +54,7 @@ export const certdResources = [ }, }, { - title: "流水线模版编辑", + title: "certd.template.edit", name: "PipelineTemplateEdit", path: "/certd/pipeline/template/edit", component: "/certd/pipeline/template/edit.vue", @@ -63,7 +63,7 @@ export const certdResources = [ }, }, { - title: "流水线模版批量创建", + title: "certd.template.importCreate", name: "PipelineTemplateImport", path: "/certd/pipeline/template/import", component: "/certd/pipeline/template/import/index.vue", diff --git a/packages/ui/certd-client/src/views/certd/pipeline/template/crud.tsx b/packages/ui/certd-client/src/views/certd/pipeline/template/crud.tsx index 93a5d383..c60cc510 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/template/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/pipeline/template/crud.tsx @@ -5,8 +5,10 @@ import { useModal } from "/@/use/use-modal"; import createCrudOptionsPipeline from "../crud"; import * as pipelineApi from "../api"; import { useTemplate } from "/@/views/certd/pipeline/template/use"; +import { useI18n } from "/@/locales"; export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet { const api = templateApi; + const { t } = useI18n(); const pageRequest = async (query: UserPageQuery): Promise => { return await api.GetList(query); }; @@ -65,7 +67,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat show: true, buttons: { add: { - text: "创建模版", + text: t("certd.template.createTemplate"), type: "primary", show: true, }, @@ -119,13 +121,13 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat }, }, title: { - title: "模版名称", + title: t("certd.template.templateName"), type: "text", search: { show: true, }, form: { - rules: [{ required: true, message: "请输入模版名称" }], + rules: [{ required: true, message: t("certd.template.enterTemplateName") }], }, column: { width: 400, @@ -141,7 +143,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat }, }, pipelineId: { - title: "流水线ID", + title: t("certd.template.pipeline"), type: "table-select", search: { show: true }, dict: dict({ @@ -160,7 +162,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat }, form: { show: true, - helper: "复制该流水线配置作为模版来源", + helper: t("certd.template.copyPipelineConfig"), component: { valuesFormat: { labelFormatter: (item: any) => { @@ -191,7 +193,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat }, }, useCreate: { - title: "使用此模版", + title: t("certd.template.useTemplate"), form: { show: false }, column: { conditionalRender: false, @@ -208,14 +210,14 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat return ( - 创建单个流水线 + {t("certd.template.singleCreate")} ); }, }, }, useImport: { - title: "使用此模版", + title: t("certd.template.useTemplate"), form: { show: false }, column: { conditionalRender: false, @@ -224,7 +226,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat return ( - 批量创建流水线 + {t("certd.template.batchCreate")} ); }, diff --git a/packages/ui/certd-client/src/views/certd/pipeline/template/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/template/index.vue index fa637165..b10b671b 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/template/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/template/index.vue @@ -2,9 +2,9 @@