Unverified Commit c4418314 authored by irwinsun's avatar irwinsun Committed by GitHub
Browse files

Merge pull request #6107 from vhwweng/issue_6088

feat: 代码库支持关联企业版工蜂 issue #6088
parents 37588d92 906ae0c5
Showing with 20 additions and 15 deletions
+20 -15
......@@ -32,4 +32,5 @@ out
.temp
.history
build.yml
\ No newline at end of file
build.yml
.codecc
\ No newline at end of file
......@@ -10,12 +10,13 @@
*
* Terms of the MIT License:
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
......
......@@ -228,7 +228,7 @@
)
},
title () {
return `${this.$t('codelib.link')}${this.codelibConfig.label || ''}${this.$t('codelib.codelib')}`
return `${this.$t('codelib.link')}${this.$t(`codelib.${this.codelibConfig.label}`) || ''}${this.$t('codelib.codelib')}`
},
isGit () {
return isGit(this.codelibTypeName)
......
......@@ -28,6 +28,7 @@ import {
export function parsePathAlias (type, path, authType, svnType) {
let reg = ''
let msg = ''
let aliasIndex = 3
const codelibLocaleObj = window.devops.$i18n.t('codelib')
switch (true) {
......@@ -48,19 +49,21 @@ export function parsePathAlias (type, path, authType, svnType) {
msg = `${codelibLocaleObj.httpsRule}${type}${codelibLocaleObj.address}`
break
case (authType === 'T_GIT_OAUTH') || (isTGit(type) && authType === 'HTTPS'):
reg = /^https\:\/\/git(\.code)?(\.tencent)\.com[\:|\/](.*)\.git$/
reg = /^https\:\/\/([\-\.a-z0-9A-Z]+)[\:|\/](.*)\.git$/
msg = `${codelibLocaleObj.tgitHttpRule}${type}${codelibLocaleObj.address}`
aliasIndex = 2
break
case isTGit(type):
reg = /^git@git(\.tencent)(\.com)[\:|\/](.*)\.git$/
reg = /^git@([\-\.a-z0-9A-Z]+)[\:|\/](.*)\.git$/
msg = `${codelibLocaleObj.tgitRule}${type}${codelibLocaleObj.address}`
aliasIndex = 2
break
}
const matchResult = path.match(reg)
return matchResult ? {
alias: matchResult[3]
alias: matchResult[aliasIndex]
} : {
msg
}
......
......@@ -47,8 +47,8 @@
"httpRule": "start by http:// and the correct one",
"httpsRule": "start by http:// and end with .git",
"paramBeString": "parameter must be string",
"tgitHttpRule": "start by https://git.tencent.com or https://git.code.tencent.com and end with .git",
"tgitRule": "start by git@git.tencent.com and end with .git",
"tgitHttpRule": "start by https:// and end with .git",
"tgitRule": "start by git@ and end with .git",
"SVN": "SVN",
"Github": "Github",
"Gitlab": "Gitlab",
......
......@@ -48,12 +48,12 @@
"httpsRule": "请输入以http://开头,以.git结尾的",
"paramBeString": "参数必须为字符串",
"gitCodeInternalRule": "请输入以git@开头,以.git结尾的",
"tgitHttpRule": "请输入以https://git.tencent.com或https://git.code.tencent.com开头,以.git结尾的",
"tgitRule": "请输入以git@git.tencent.com开头,以.git结尾的",
"tgitHttpRule": "请输入以https://开头,以.git结尾的",
"tgitRule": "请输入以git@开头,以.git结尾的",
"SVN": "SVN",
"Github": "Github",
"Gitlab": "Gitlab",
"TGit": "工蜂外网",
"TGit": "腾讯工蜂",
"authType": "授权方式",
"authIdentity": "授权身份"
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment