Skip to content

Commit

Permalink
feat:增加鸿蒙仓库前端 TencentBlueKing#2877
Browse files Browse the repository at this point in the history
  • Loading branch information
lannoy0523 committed Jan 8, 2025
1 parent 4228e94 commit fe41bc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
17 changes: 11 additions & 6 deletions src/frontend/devops-repository/src/store/actions/repoCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ export default {
},
// 删除包
deletePackage (_, { projectId, repoType, repoName, packageKey }) {
const type = repoType === 'ohpm' ? 'npm' : repoType
return Vue.prototype.$ajax.delete(
`${repoType}/ext/package/delete/${projectId}/${repoName}`,
`${type}/ext/package/delete/${projectId}/${repoName}`,
{
params: {
packageKey
Expand Down Expand Up @@ -55,8 +56,9 @@ export default {
},
// 删除包版本
deleteVersion (_, { projectId, repoType, repoName, packageKey, version }) {
const type = repoType === 'ohpm' ? 'npm' : repoType
return Vue.prototype.$ajax.delete(
`${repoType}/ext/version/delete/${projectId}/${repoName}`,
`${type}/ext/version/delete/${projectId}/${repoName}`,
{
params: {
packageKey,
Expand All @@ -67,8 +69,9 @@ export default {
},
// 查询包版本详情
getVersionDetail (_, { projectId, repoType, repoName, packageKey, version }) {
const type = repoType === 'ohpm' ? 'npm' : repoType
return Vue.prototype.$ajax.get(
`${repoType}/ext/version/detail/${projectId}/${repoName}`,
`${type}/ext/version/detail/${projectId}/${repoName}`,
{
params: {
packageKey,
Expand All @@ -80,12 +83,13 @@ export default {
// 包搜索-仓库数量
searchRepoList (_, { projectId, repoType, packageName }) {
const isGeneric = repoType === 'generic'
const type = repoType === 'ohpm' ? 'npm' : repoType
return Vue.prototype.$ajax.get(
`${prefix}/${isGeneric ? 'node' : 'package'}/search/overview`,
{
params: {
projectId,
repoType: repoType.toUpperCase(),
repoType: type.toUpperCase(),
[isGeneric ? 'name' : 'packageName']: `*${packageName}*`,
...(MODE_CONFIG === 'ci' && isGeneric
? {
Expand All @@ -99,6 +103,7 @@ export default {
// 跨仓库搜索
searchPackageList (_, { projectId, repoType, repoName, repoNames = [], packageName, property = 'name', direction = 'ASC', current = 1, limit = 20, extRules = [] }) {
const isGeneric = repoType === 'generic'
const type = repoType === 'ohpm' ? 'npm' : repoType
return Vue.prototype.$ajax.post(
`${prefix}/${isGeneric ? 'node/queryWithoutCount' : 'package/search'}`,
{
Expand All @@ -119,10 +124,10 @@ export default {
operation: 'EQ'
}]
: []),
...((MODE_CONFIG === 'ci' ? !isGeneric : true) && repoType
...((MODE_CONFIG === 'ci' ? !isGeneric : true) && type
? [{
field: 'repoType',
value: repoType.toUpperCase(),
value: type.toUpperCase(),
operation: 'EQ'
}]
: []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1295,12 +1295,12 @@ export default {
{
subTitle: this.$t('ohpmPushGuideSubTitle1'),
codeList: [
`ohpm publish "${this.dependInputValue1 || '<PATH_TO_PACKAGE_FILE>'}"`
`ohpm publish ${this.dependInputValue1 || '<PATH_TO_PACKAGE_FILE>'}`
]
},
{
subTitle: this.$t('ohpmPushGuideSubTitle2'),
codeList: [`ohpm publish "${this.dependInputValue1 || '<PATH_TO_PACKAGE_FILE>'}" --publish_registry ${this.domain.ohpm}/${this.projectId}/${this.repoName}/`]
codeList: [`ohpm publish ${this.dependInputValue1 || '<PATH_TO_PACKAGE_FILE>'} --publish_registry ${this.domain.ohpm}/${this.projectId}/${this.repoName}/`]
}
]
},
Expand Down

0 comments on commit fe41bc5

Please sign in to comment.