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 26, 2024
1 parent dca927c commit 77d5357
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 5 deletions.
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
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,94 @@ export default {
]
}]
},
conanGuide () {
return [
{
title: this.$t('setCredentials'),
optionType: 'setCredentials',
main: [
{
subTitle: this.$t('helmCreditGuideSubTitle1'),
codeList: [
`conan user add -p ${this.accessToken} -r ${this.domain.conan}/${this.projectId}/${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} --all -r=${this.domain.conan}/${this.projectId}/${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.domain.conan}/${this.projectId}/${this.repoName}/`
]
}
]
}
]
},
conanInstall () {
return [
{
main: [
{
subTitle: this.$t('helmInstallGuideSubTitle1'),
codeList: [
`conan user add -p ${this.accessToken} -r ${this.domain.conan}/${this.projectId}/${this.repoName} ${this.userName}`
]
},
{
subTitle: this.$t('helmPullGuideSubTitle'),
codeList: [
`conan install ${this.packageName}/${this.versionLabel}@ -r ${this.domain.conan}/${this.projectId}/${this.repoName}/`
]
}
]
}
]
},
articleGuide () {
return this[`${guideMap[this.repoType] || this.repoType}Guide`]
},
Expand Down

0 comments on commit 77d5357

Please sign in to comment.