From 274706fcb053bfb8c4fdda387037030cbb1e6fd4 Mon Sep 17 00:00:00 2001 From: vhwweng <1010382269@qq.com> Date: Thu, 31 Aug 2023 15:52:17 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=B5=81=E6=B0=B4=E7=BA=BF?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=BD=92=E6=A1=A3=E7=9B=AE=E5=BD=95=20#9320?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Outputs/index.vue | 42 +++++++++++++++---- src/frontend/locale/pipeline/en-US.json | 6 ++- src/frontend/locale/pipeline/zh-CN.json | 6 ++- 3 files changed, 43 insertions(+), 11 deletions(-) diff --git a/src/frontend/devops-pipeline/src/components/Outputs/index.vue b/src/frontend/devops-pipeline/src/components/Outputs/index.vue index 9c19d8d681e..0aeab670540 100644 --- a/src/frontend/devops-pipeline/src/components/Outputs/index.vue +++ b/src/frontend/devops-pipeline/src/components/Outputs/index.vue @@ -282,13 +282,22 @@ ] }, baseInfoRows () { - return [ - { key: 'name', name: this.$t('details.name') }, - { key: 'fullName', name: this.$t('details.filePath') }, - { key: 'size', name: this.$t('details.size') }, - { key: 'createdTime', name: this.$t('details.created') }, - { key: 'modifiedTime', name: this.$t('details.lastModified') } - ] + return this.activeOutputDetail.folder + ? [ + { key: 'name', name: this.$t('details.directoryName') }, + { key: 'fullName', name: this.$t('details.directoryPath') }, + { key: 'size', name: this.$t('details.size') }, + { key: 'include', name: this.$t('details.include') }, + { key: 'createdTime', name: this.$t('details.created') }, + { key: 'modifiedTime', name: this.$t('details.lastModified') } + ] + : [ + { key: 'name', name: this.$t('details.name') }, + { key: 'fullName', name: this.$t('details.filePath') }, + { key: 'size', name: this.$t('details.size') }, + { key: 'createdTime', name: this.$t('details.created') }, + { key: 'modifiedTime', name: this.$t('details.lastModified') } + ] }, checkSumRows () { return [ @@ -338,7 +347,7 @@ this.outputs = res.map((item) => { const isReportOutput = item.artifactoryType === 'REPORT' - const icon = isReportOutput ? 'order' : extForFile(item.name) + const icon = isReportOutput ? 'order' : item.folder ? 'folder-open' : extForFile(item.name) const id = isReportOutput ? item.createTime : item.fullPath const type = this.isArtifact(item.artifactoryType) ? 'ARTIFACT' : '' return { @@ -396,7 +405,8 @@ size: res.size > 0 ? convertFileSize(res.size, 'B') : '--', createdTime: convertTime(res.createdTime * 1000), modifiedTime: convertTime(res.modifiedTime * 1000), - icon: extForFile(res.name) + icon: !output.folder ? extForFile(res.name) : 'folder-open', + include: this.getInclude(output) } this.isLoading = false } catch (err) { @@ -410,6 +420,19 @@ ]) } }, + getInclude (payload) { + if (!payload.folder) return '--' + const fileCount = this.getValuesByKey(payload.properties, 'fileCount') + const folderCount = this.getValuesByKey(payload.properties, 'folderCount') + return this.$t('details.fileAndFolder', [fileCount, folderCount]) + }, + getValuesByKey (data, key) { + for (const item of data) { + if (key.includes(item.key)) { + return item.value + } + } + }, setActiveOutput (output) { this.activeOutput = output switch (output.type) { @@ -534,6 +557,7 @@ } &.active, &:hover { + color: $iconPrimaryColor; background: #f5f7fa; } } diff --git a/src/frontend/locale/pipeline/en-US.json b/src/frontend/locale/pipeline/en-US.json index f54c56644b1..51ca879b317 100644 --- a/src/frontend/locale/pipeline/en-US.json +++ b/src/frontend/locale/pipeline/en-US.json @@ -695,7 +695,11 @@ "pipelineErrorCode": "Error Code", "pipelineErrorPos": "Error Position", "pipelineErrorInfo": "Error Message", - "Errors": "Errors" + "Errors": "Errors", + "directoryName": "Folder Name", + "directoryPath": "Folder Path", + "include": "Include", + "fileAndFolder": "{0} files, {1} folders" }, "editPage": { "invalidValue": "Plugin's Input {0} Invalid", diff --git a/src/frontend/locale/pipeline/zh-CN.json b/src/frontend/locale/pipeline/zh-CN.json index 5ef46943f8f..85393291537 100644 --- a/src/frontend/locale/pipeline/zh-CN.json +++ b/src/frontend/locale/pipeline/zh-CN.json @@ -698,7 +698,11 @@ "pipelineErrorCode": "错误码", "pipelineErrorPos": "错误位置", "pipelineErrorInfo": "错误信息", - "Errors": "Errors" + "Errors": "Errors", + "directoryName": "目录名称", + "directoryPath": "目录路径", + "include": "包含", + "fileAndFolder": "{0}个文件,{1}个目录" }, "editPage": { "invalidValue": "插件表单参数{0}非法 ",