Skip to content

Commit

Permalink
feat:前端支持conan仓库 #2601
Browse files Browse the repository at this point in the history
  • Loading branch information
lannoy0523 committed Sep 27, 2024
1 parent 24e0bf7 commit 701aa2b
Show file tree
Hide file tree
Showing 7 changed files with 148 additions and 11 deletions.
10 changes: 10 additions & 0 deletions src/frontend/devops-repository/src/images/conan.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ export default {
const urlMap = {
docker: 'docker/ext/addr',
npm: 'npm/ext/address',
helm: 'helm/ext/address'
helm: 'helm/ext/address',
conan: 'conan/ext/address'
}
if (!urlMap[repoType] || state.domain[repoType]) return
Vue.prototype.$ajax.get(
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/devops-repository/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ const storeObject = {
domain: {
docker: '',
npm: '',
helm: ''
helm: '',
conan: ''
},
clusterList: [],
dependAccessTokenValue: '', // 依赖源仓库的使用指引中用户输入的访问令牌的值
Expand Down
6 changes: 4 additions & 2 deletions src/frontend/devops-repository/src/store/publicEnum.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export const repoEnum = MODE_CONFIG === 'ci'
{ label: 'Helm', value: 'helm' },
{ label: 'Docker', value: 'docker' },
// { label: 'Rds', value: 'rds' },
{ label: 'Nuget', value: 'nuget' }
{ label: 'Nuget', value: 'nuget' },
{ label: 'Conan', value: 'conan' }
]
: [
{ label: 'Generic', value: 'generic' },
Expand All @@ -20,7 +21,8 @@ export const repoEnum = MODE_CONFIG === 'ci'
{ label: 'Composer', value: 'composer' },
{ label: 'Rpm', value: 'rpm' },
{ label: 'Git', value: 'git' },
{ label: 'Nuget', value: 'nuget' }
{ label: 'Nuget', value: 'nuget' },
{ label: 'Conan', value: 'conan' }
]

// 文件类型
Expand Down
125 changes: 122 additions & 3 deletions src/frontend/devops-repository/src/views/repoCommon/repoGuideMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export default {
title: this.$t('npmCreditGuideSubTitle1'),
optionType: 'setCredentials',
main: [

{
subTitle: this.$t('npmCreditGuideSubTitle3'),
codeList: [
Expand Down Expand Up @@ -761,7 +761,7 @@ export default {
{
subTitle: this.$t('helmInstallGuideSubTitle2'),
codeList: [
'helm repo update'
'helm repo update '
]
},
{
Expand Down Expand Up @@ -873,7 +873,6 @@ export default {
},
pypiGuide () {
return [

{
title: this.$t('pypiCreditGuideSubTitle1'),
optionType: 'setCredentials',
Expand Down Expand Up @@ -1160,6 +1159,126 @@ export default {
]
}]
},
conanGuide () {
return [
{
title: this.$t('setCredentials'),
optionType: 'setCredentials',
main: [
{
subTitle: this.$t('conanCreditGuideSubTitle1'),
codeList: [
`conan remote add ${this.repoName} ${this.domain.conan}/${this.projectId}/${this.repoName}`

]
},
{
subTitle: this.$t('conanCreditGuideSubTitle2'),
codeList: [
`conan user add -p ${this.accessToken} -r ${this.repoName} ${this.userName}`
]
},
{
subTitle: this.$t('conanCreditGuideSubTitle3'),
codeList: [
`conan remote login -p ${this.accessToken} ${this.repoName} ${this.userName}`
]
}
]
},
{
title: this.$t('push'),
optionType: 'push',
inputBoxList: [
{
key: 'dependInputValue1', // vux中存储的变量名
label: this.$t('artifactName'), // 输入框左侧label文案
placeholder: this.$t('artifactNamePlaceholder'), // 输入框提示文案
methodFunctionName: 'SET_DEPEND_INPUT_VALUE1' // vuex中mutations中的方法名
},
{
key: 'dependInputValue2', // vux中存储的变量名
label: this.$t('artifactVersion'), // 输入框左侧label文案
placeholder: this.$t('packageVersionPlaceholder'), // 输入框提示文案
methodFunctionName: 'SET_DEPEND_INPUT_VALUE2' // vuex中mutations中的方法名
}
],
main: [
{
subTitle: this.$t('pushGuideSubTitle'),
codeList: [
`conan upload ${this.dependInputValue1 || this.packageName}/${this.dependInputValue2 || this.versionLabel} -r=${this.repoName}`
]
}
]
},
{
title: this.$t('pull'),
optionType: 'pull',
inputBoxList: [
{
key: 'dependInputValue1', // vux中存储的变量名
label: this.$t('artifactName'), // 输入框左侧label文案
placeholder: this.$t('artifactNamePlaceholder'), // 输入框提示文案
methodFunctionName: 'SET_DEPEND_INPUT_VALUE1' // vuex中mutations中的方法名
},
{
key: 'dependInputValue2', // vux中存储的变量名
label: this.$t('artifactVersion'), // 输入框左侧label文案
placeholder: this.$t('packageVersionPlaceholder'), // 输入框提示文案
methodFunctionName: 'SET_DEPEND_INPUT_VALUE2' // vuex中mutations中的方法名
}
],
main: [
{
subTitle: this.$t('helmPullGuideSubTitle'),
codeList: [
`conan install ${this.dependInputValue1 || this.packageName}/${this.dependInputValue2 || this.versionLabel}@ -r ${this.repoName}`
]
}
]
}
]
},
conanInstall () {
return [
{
main: [
{
subTitle: this.$t('conanCreditGuideSubTitle1'),
codeList: [
`conan remote add ${this.repoName} ${this.domain.conan}/${this.projectId}/${this.repoName}`

]
},
{
subTitle: this.$t('conanCreditGuideSubTitle2'),
codeList: [
`conan user add -p <PERSONAL_ACCESS_TOKEN> -r ${this.repoName} ${this.userName}`
]
},
{
subTitle: this.$t('conanCreditGuideSubTitle3'),
codeList: [
`conan remote login -p <PERSONAL_ACCESS_TOKEN> ${this.repoName} ${this.userName}`
]
},
{
subTitle: this.$t('helmPullGuideSubTitle'),
codeList: [
`conan install ${this.packageName}/${this.versionLabel}@ -r ${this.repoName}`
]
},
{
subTitle: this.$t('pushGuideSubTitle'),
codeList: [
`conan upload ${this.packageName}/${this.versionLabel} -r=${this.repoName}`
]
}
]
}
]
},
articleGuide () {
return this[`${guideMap[this.repoType] || this.repoType}Guide`]
},
Expand Down
7 changes: 4 additions & 3 deletions src/frontend/locale/repository/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,6 @@
"relatedUsers":"Related Users",
"assetUserTip": "Please start with g_",
"createGroupToken": "Create Token",
"inFolderSearchPlaceholder":"Please enter a file/folder name to search",
"folderDirectory":"Folder directory",
"batchDownload":"Batch download",
"noFilenameErrorInfo":"Sorry, the server got the file name abnormally, please try again later",
"batchDownloadBackTypeErrorInfo":"Batch download of files failed, please try again later",
Expand Down Expand Up @@ -893,5 +891,8 @@
"changeSelectAllTip": "Select full data",
"selectAllTip": "{0} pieces of total data have been selected,",
"clearSelectTip":"Clear selection",
"previewErrorTip": "File Preview Fail"
"previewErrorTip": "File Preview Fail",
"conanCreditGuideSubTitle1":"1. Execute the following command on the command line to configure remote artifact repository",
"conanCreditGuideSubTitle2":"2、Execute the following command on the command line to configure artifact repository credentials(conan1.x)",
"conanCreditGuideSubTitle3":"2、Execute the following command on the command line to configure artifact repository credentials(conan2.x)"
}
5 changes: 4 additions & 1 deletion src/frontend/locale/repository/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -894,5 +894,8 @@
"changeSelectAllTip": "选择全量数据",
"selectAllTip": "已选择全量数据{0}条,",
"clearSelectTip":"清除选择",
"previewErrorTip": "文件预览失败"
"previewErrorTip": "文件预览失败",
"conanCreditGuideSubTitle1":"1、在命令行执行以下命令配置远程仓库",
"conanCreditGuideSubTitle2":"2、在命令行执行以下命令配置制品仓库凭据(conan1.x)",
"conanCreditGuideSubTitle3":"2、在命令行执行以下命令配置制品仓库凭据(conan2.x)"
}

0 comments on commit 701aa2b

Please sign in to comment.