Skip to content

Commit

Permalink
feat:流水线支持归档目录 #9320
Browse files Browse the repository at this point in the history
  • Loading branch information
vhwweng committed Aug 31, 2023
1 parent 2866c24 commit 274706f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 11 deletions.
42 changes: 33 additions & 9 deletions src/frontend/devops-pipeline/src/components/Outputs/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -534,6 +557,7 @@
}
&.active,
&:hover {
color: $iconPrimaryColor;
background: #f5f7fa;
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/frontend/locale/pipeline/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion src/frontend/locale/pipeline/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,11 @@
"pipelineErrorCode": "错误码",
"pipelineErrorPos": "错误位置",
"pipelineErrorInfo": "错误信息",
"Errors": "Errors"
"Errors": "Errors",
"directoryName": "目录名称",
"directoryPath": "目录路径",
"include": "包含",
"fileAndFolder": "{0}个文件,{1}个目录"
},
"editPage": {
"invalidValue": "插件表单参数{0}非法 ",
Expand Down

0 comments on commit 274706f

Please sign in to comment.