Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:前端支持conan仓库 #2601 #2602

Merged
merged 8 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -7,7 +7,8 @@ export const repoEnum = MODE_CONFIG === 'ci'
{ label: 'Docker', value: 'docker' },
// { label: 'Rds', value: 'rds' },
{ label: 'Nuget', value: 'nuget' },
{ label: 'S3', value: 's3' }
{ label: 'S3', value: 's3' },
{ label: 'Conan', value: 'conan' }
]
: [
{ label: 'Generic', value: 'generic' },
Expand All @@ -22,7 +23,8 @@ export const repoEnum = MODE_CONFIG === 'ci'
{ label: 'Rpm', value: 'rpm' },
{ label: 'Git', value: 'git' },
{ label: 'Nuget', value: 'nuget' },
{ label: 'S3', value: 's3' }
{ label: 'S3', value: 's3' },
{ label: 'Conan', value: 'conan' }
]

// 文件类型
Expand Down
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,102 @@ 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 -p ${this.accessToken} -r ${this.repoName} ${this.userName}`
]
}
]
},
{
title: this.$t('push'),
optionType: 'push',
inputBoxList: [
{
key: 'dependInputValue1', // vux中存储的变量名
label: 'RECIPE', // 输入框左侧label文案
placeholder: this.$t('conanRecipePlaceholder'), // 输入框提示文案
methodFunctionName: 'SET_DEPEND_INPUT_VALUE1' // vuex中mutations中的方法名
}
],
main: [
{
subTitle: this.$t('pushGuideSubTitle') + '(conan1.x)',
codeList: [
`conan upload ${this.dependInputValue1} -r ${this.repoName}`
]
}
]
},
{
title: this.$t('pull'),
optionType: 'pull',
inputBoxList: [
{
key: 'dependInputValue1', // vux中存储的变量名
label: 'RECIPE', // 输入框左侧label文案
placeholder: this.$t('conanRecipePlaceholder'), // 输入框提示文案
methodFunctionName: 'SET_DEPEND_INPUT_VALUE1' // vuex中mutations中的方法名
}
],
main: [
{
subTitle: this.$t('helmPullGuideSubTitle'),
codeList: [
`conan install ${this.dependInputValue1} -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 -p <PERSONAL_ACCESS_TOKEN> -r ${this.repoName} ${this.userName}`
]
},
{
subTitle: this.$t('conanPullGuideSubTitle'),
codeList: [
`conan install ${this.packageName.split('@', 2)[1].split('/', 2)[0]}/${this.versionLabel}@${this.packageName.split('@', 2)[0]}/${this.packageName.split('@', 2)[1].split('/', 2)[1]} -r ${this.repoName}`
]
},
{
subTitle: this.$t('pushGuideSubTitle') + '(conan1.x)',
codeList: [
`conan upload ${this.packageName.split('@', 2)[1].split('/', 2)[0]}/${this.versionLabel}@${this.packageName.split('@', 2)[0]}/${this.packageName.split('@', 2)[1].split('/', 2)[1]} -r ${this.repoName}`
]
}
]
}
]
},
articleGuide () {
return this[`${guideMap[this.repoType] || this.repoType}Guide`]
},
Expand Down
8 changes: 5 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 @@ -900,5 +898,9 @@
"feedback": "Feedback",
"openSource": "Open Source"
},
"currentVersion": "Current"
"currentVersion": "Current",
"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)",
"conanRecipePlaceholder":"The format of RECIPE is <NAME>/VERSION>@<USER>/CHANNEL>",
"conanPullGuideSubTitle":"Please execute the following command on the command line to pull(conan1.x):"
}
6 changes: 5 additions & 1 deletion src/frontend/locale/repository/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -901,5 +901,9 @@
"feedback": "问题反馈",
"openSource": "开源社区"
},
"currentVersion": "当前版本"
"currentVersion": "当前版本",
"conanCreditGuideSubTitle1":"1、在命令行执行以下命令配置远程仓库",
"conanCreditGuideSubTitle2":"2、在命令行执行以下命令配置制品仓库凭据(conan1.x)",
"conanRecipePlaceholder":"RECIPE的格式为<NAME>/VERSION>@<USER>/CHANNEL>",
"conanPullGuideSubTitle":"请在命令行执行以下命令进行拉取(conan1.x):"
}
Loading