diff --git a/src/frontend/devops-repository/src/store/actions/repoCommon.js b/src/frontend/devops-repository/src/store/actions/repoCommon.js index 9ea863cc9c..7ac5134e0d 100644 --- a/src/frontend/devops-repository/src/store/actions/repoCommon.js +++ b/src/frontend/devops-repository/src/store/actions/repoCommon.js @@ -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( diff --git a/src/frontend/devops-repository/src/store/index.js b/src/frontend/devops-repository/src/store/index.js index 44764804b3..4fb49da252 100644 --- a/src/frontend/devops-repository/src/store/index.js +++ b/src/frontend/devops-repository/src/store/index.js @@ -44,7 +44,8 @@ const storeObject = { domain: { docker: '', npm: '', - helm: '' + helm: '', + conan: '' }, clusterList: [], dependAccessTokenValue: '', // 依赖源仓库的使用指引中用户输入的访问令牌的值 diff --git a/src/frontend/devops-repository/src/views/repoCommon/repoGuideMixin.js b/src/frontend/devops-repository/src/views/repoCommon/repoGuideMixin.js index 892e610b94..9575af8f61 100644 --- a/src/frontend/devops-repository/src/views/repoCommon/repoGuideMixin.js +++ b/src/frontend/devops-repository/src/views/repoCommon/repoGuideMixin.js @@ -184,7 +184,7 @@ export default { title: this.$t('npmCreditGuideSubTitle1'), optionType: 'setCredentials', main: [ - + { subTitle: this.$t('npmCreditGuideSubTitle3'), codeList: [ @@ -761,7 +761,7 @@ export default { { subTitle: this.$t('helmInstallGuideSubTitle2'), codeList: [ - 'helm repo update' + 'helm repo update ' ] }, { @@ -873,7 +873,6 @@ export default { }, pypiGuide () { return [ - { title: this.$t('pypiCreditGuideSubTitle1'), optionType: 'setCredentials', @@ -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`] },