diff --git a/src/frontend/devops-codelib/src/components/CodeLibDialog/index.vue b/src/frontend/devops-codelib/src/components/CodeLibDialog/index.vue index 3929237f4210405fc33d3a6e4f2052e7bc023a82..8154b5a7154ddff8586b2fbf97b1536738ef4ed4 100755 --- a/src/frontend/devops-codelib/src/components/CodeLibDialog/index.vue +++ b/src/frontend/devops-codelib/src/components/CodeLibDialog/index.vue @@ -246,7 +246,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) diff --git a/src/frontend/devops-codelib/src/utils/index.js b/src/frontend/devops-codelib/src/utils/index.js index 483cf794d356e65dfa3720afbfa509aba591db0f..c4875b4a05541fb70323dd773564ba5090eed218 100755 --- a/src/frontend/devops-codelib/src/utils/index.js +++ b/src/frontend/devops-codelib/src/utils/index.js @@ -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,12 +49,14 @@ 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 } @@ -61,7 +64,7 @@ export function parsePathAlias (type, path, authType, svnType) { return matchResult ? { - alias: matchResult[3] + alias: matchResult[aliasIndex] } : { msg diff --git a/src/frontend/locale/codelib/en-US.json b/src/frontend/locale/codelib/en-US.json index 5c1572ee9b4c258fdbe320c2ebeef924592fedde..2a24d84f470a64933645d0c64a15385936fd1264 100644 --- a/src/frontend/locale/codelib/en-US.json +++ b/src/frontend/locale/codelib/en-US.json @@ -48,8 +48,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", diff --git a/src/frontend/locale/codelib/zh-CN.json b/src/frontend/locale/codelib/zh-CN.json index fc77a4ee2c7b9e5ba7ebbde4ed8f694d3d5f395b..70ba05b68e8cd4173fe357b0fcf8818682602d15 100644 --- a/src/frontend/locale/codelib/zh-CN.json +++ b/src/frontend/locale/codelib/zh-CN.json @@ -1,62 +1,61 @@ { - "codelib": "浠g爜搴�", - "linkCodelib": "鍏宠仈浠g爜搴�", - "repo": "浠g爜搴�", - "link": "鍏宠仈", - "codelibDesc": "浠g爜搴撴湇鍔″彲浠ュ皢椤圭洰宸叉湁鐨� SVN 鍙� GIT 宸ョ▼鍏宠仈鑷矯I锛屽畠灏嗕綔涓烘祦姘寸嚎鐨勫師鏉愭枡", - "laodingTitle": "姝e湪鍔犺浇浠撳簱鍒楄〃", - "aliasNamePlaceholder": "璇疯緭鍏ュ埆鍚嶏紝鎸夊洖杞﹁繘琛屾悳绱�", - "noCodelibPermission": "鏃犱唬鐮佸簱鏉冮檺", - "noPermissionDesc": "浣犳病鏈夊垱寤烘潈闄愶紝璇峰垏鎹㈤」鐩垨鐢宠鐩稿簲鏉冮檺", - "switchProject": "鍒囨崲椤圭洰", - "applyPermission": "鐢宠鏉冮檺", - "index": "搴忓垪", - "create": "鍒涘缓", - "new": "鏂板", - "aliasName": "鍒悕", - "aliasNameEnter": "璇疯緭鍏ュ埆鍚�", - "address": "鍦板潃", - "type": "绫诲瀷", - "operation": "鎿嶄綔", - "edit": "缂栬緫", - "delete": "鍒犻櫎", - "deleteCodelib": "鍒犻櫎浠g爜搴擄紙{0}锛夛紵", - "confirm": "纭", - "successfullyDeleted": "鍒犻櫎鎴愬姛", - "codelibMode": "婧愪唬鐮佹柟寮�", - "codelibUrl": "婧愪唬鐮佸湴鍧€", - "codelibUrlPlaceholder": "璇烽€夋嫨浠g爜搴撳湴鍧€", - "oauthCert": "OAUTH", - "codelibPullType": "婧愪唬鐮佹媺鍙栨柟寮�", - "codelibCredential": "璁块棶鍑嵁", - "credentialPlaceholder": "璇烽€夋嫨鐩稿簲绫诲瀷鐨勫嚟鎹�", - "credentialRequired": "鍑嵁ID涓嶈兘涓虹┖", - "svnUrlPlaceholder": "璇疯緭鍏ョ浉搴旂被鍨嬬殑SVN浠g爜搴撳湴鍧€", - "gitUrlPlaceholder": "璇疯緭鍏SH鏂瑰紡鐨凣it浠g爜搴撳湴鍧€", - "tgitUrlPlaceholder": "璇疯緭鍏SH鏂瑰紡鐨凾Git浠g爜搴撳湴鍧€", - "gitlabUrlPlaceholder": "璇疯緭鍏TTP鏂瑰紡鐨凣itlab浠g爜搴撳湴鍧€", - "p4UrlPlaceholder": "璇疯緭鍏TTP鏂瑰紡鐨凱4浠g爜搴撳湴鍧€", - "httpUrlPlaceholder": "璇疯緭鍏TTP鏂瑰紡鐨凣it浠g爜搴撳湴鍧€", - "httpsUrlPlaceholder": "璇疯緭鍏TTPS鏂瑰紡鐨凾Git浠g爜搴撳湴鍧€", - "svnCredPlaceholder": "璇烽€夋嫨鐩稿簲绫诲瀷鐨勫嚟鎹�", - "gitCredPlaceholder": "璇烽€夋嫨SSH绉侀挜+绉佹湁Token绫诲瀷鐨勫嚟鎹�", - "gitlabCredPlaceholder": "璇烽€夋嫨AccessToken绫诲瀷鐨勫嚟鎹�", - "successfullyEdited": "淇敼鎴愬姛", - "successfullyAdded": "娣诲姞鎴愬姛", - "githubRule": "璇疯緭鍏ヤ互https://github.com/寮€澶寸殑", - "svnSshRule": "璇疯緭鍏ヤ互svn+ssh://寮€澶寸殑姝g‘鐨�", - "httpRule": "璇疯緭鍏ヤ互http://寮€澶寸殑姝g‘鐨�", - "httpsRule": "璇疯緭鍏ヤ互http://寮€澶达紝浠�.git缁撳熬鐨�", - "paramBeString": "鍙傛暟蹇呴』涓哄瓧绗︿覆", - "gitCodeInternalRule": "璇疯緭鍏ヤ互git@寮€澶达紝浠�.git缁撳熬鐨�", - "tgitHttpRule": "璇疯緭鍏ヤ互https://git.tencent.com鎴杊ttps://git.code.tencent.com寮€澶达紝浠�.git缁撳熬鐨�", - "tgitRule": "璇疯緭鍏ヤ互git@git.tencent.com寮€澶达紝浠�.git缁撳熬鐨�", - "SVN": "SVN", - "Github": "Github", - "Gitlab": "Gitlab", - "TGit": "宸ヨ渹澶栫綉", - "P4": "P4", - "authType": "鎺堟潈鏂瑰紡", - "authIdentity": "鎺堟潈韬唤", - "portTips": "鎵樼鍏变韩鐗堟湰鎺у埗鏈嶅姟鐨勬満鍣ㄥ悕绉帮紝蹇呴』鎸囧畾TCP/IP鍜孭ORT銆傚鏋滀娇鐢⊿SL杩炴帴鍒癙4锛屽垯鐢╯sl:host:port" -} + "codelib": "浠g爜搴�", + "linkCodelib": "鍏宠仈浠g爜搴�", + "repo": "浠g爜搴�", + "link": "鍏宠仈", + "codelibDesc": "浠g爜搴撴湇鍔″彲浠ュ皢椤圭洰宸叉湁鐨� SVN 鍙� GIT 宸ョ▼鍏宠仈鑷矯I锛屽畠灏嗕綔涓烘祦姘寸嚎鐨勫師鏉愭枡", + "laodingTitle": "姝e湪鍔犺浇浠撳簱鍒楄〃", + "aliasNamePlaceholder": "璇疯緭鍏ュ埆鍚嶏紝鎸夊洖杞﹁繘琛屾悳绱�", + "noCodelibPermission": "鏃犱唬鐮佸簱鏉冮檺", + "noPermissionDesc": "浣犳病鏈夊垱寤烘潈闄愶紝璇峰垏鎹㈤」鐩垨鐢宠鐩稿簲鏉冮檺", + "switchProject": "鍒囨崲椤圭洰", + "applyPermission": "鐢宠鏉冮檺", + "index": "搴忓垪", + "create": "鍒涘缓", + "new": "鏂板", + "aliasName": "鍒悕", + "aliasNameEnter": "璇疯緭鍏ュ埆鍚�", + "address": "鍦板潃", + "type": "绫诲瀷", + "operation": "鎿嶄綔", + "edit": "缂栬緫", + "delete": "鍒犻櫎", + "deleteCodelib": "鍒犻櫎浠g爜搴擄紙{0}锛夛紵", + "confirm": "纭", + "successfullyDeleted": "鍒犻櫎鎴愬姛", + "codelibMode": "婧愪唬鐮佹柟寮�", + "codelibUrl": "婧愪唬鐮佸湴鍧€", + "codelibUrlPlaceholder": "璇烽€夋嫨浠g爜搴撳湴鍧€", + "oauthCert": "OAUTH", + "codelibPullType": "婧愪唬鐮佹媺鍙栨柟寮�", + "codelibCredential": "璁块棶鍑嵁", + "credentialPlaceholder": "璇烽€夋嫨鐩稿簲绫诲瀷鐨勫嚟鎹�", + "credentialRequired": "鍑嵁ID涓嶈兘涓虹┖", + "svnUrlPlaceholder": "璇疯緭鍏ョ浉搴旂被鍨嬬殑SVN浠g爜搴撳湴鍧€", + "gitUrlPlaceholder": "璇疯緭鍏SH鏂瑰紡鐨凣it浠g爜搴撳湴鍧€", + "tgitUrlPlaceholder": "璇疯緭鍏SH鏂瑰紡鐨凾Git浠g爜搴撳湴鍧€", + "gitlabUrlPlaceholder": "璇疯緭鍏TTP鏂瑰紡鐨凣itlab浠g爜搴撳湴鍧€", + "p4UrlPlaceholder": "璇疯緭鍏TTP鏂瑰紡鐨凱4浠g爜搴撳湴鍧€", + "httpUrlPlaceholder": "璇疯緭鍏TTP鏂瑰紡鐨凣it浠g爜搴撳湴鍧€", + "httpsUrlPlaceholder": "璇疯緭鍏TTPS鏂瑰紡鐨凾Git浠g爜搴撳湴鍧€", + "svnCredPlaceholder": "璇烽€夋嫨鐩稿簲绫诲瀷鐨勫嚟鎹�", + "gitCredPlaceholder": "璇烽€夋嫨SSH绉侀挜+绉佹湁Token绫诲瀷鐨勫嚟鎹�", + "gitlabCredPlaceholder": "璇烽€夋嫨AccessToken绫诲瀷鐨勫嚟鎹�", + "successfullyEdited": "淇敼鎴愬姛", + "successfullyAdded": "娣诲姞鎴愬姛", + "githubRule": "璇疯緭鍏ヤ互https://github.com/寮€澶寸殑", + "svnSshRule": "璇疯緭鍏ヤ互svn+ssh://寮€澶寸殑姝g‘鐨�", + "httpRule": "璇疯緭鍏ヤ互http://寮€澶寸殑姝g‘鐨�", + "httpsRule": "璇疯緭鍏ヤ互http://寮€澶达紝浠�.git缁撳熬鐨�", + "paramBeString": "鍙傛暟蹇呴』涓哄瓧绗︿覆", + "gitCodeInternalRule": "璇疯緭鍏ヤ互git@寮€澶达紝浠�.git缁撳熬鐨�", + "tgitHttpRule": "璇疯緭鍏ヤ互https://寮€澶达紝浠�.git缁撳熬鐨�", + "tgitRule": "璇疯緭鍏ヤ互git@寮€澶达紝浠�.git缁撳熬鐨�", + "SVN": "SVN", + "Github": "Github", + "Gitlab": "Gitlab", + "TGit": "鑵捐宸ヨ渹", + "authType": "鎺堟潈鏂瑰紡", + "authIdentity": "鎺堟潈韬唤", + "portTips": "鎵樼鍏变韩鐗堟湰鎺у埗鏈嶅姟鐨勬満鍣ㄥ悕绉帮紝蹇呴』鎸囧畾TCP/IP鍜孭ORT銆傚鏋滀娇鐢⊿SL杩炴帴鍒癙4锛屽垯鐢╯sl:host:port" +} \ No newline at end of file