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

Merge pull request #6158 from lockiechen/issue_6088_1.7

feat: 代码库支持关联企业版工蜂 issue #6088 合并到1.7
Showing with 69 additions and 67 deletions
+69 -67
......@@ -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)
......
......@@ -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
......
......@@ -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",
......
{
"codelib": "代码库",
"linkCodelib": "关联代码库",
"repo": "代码库",
"link": "关联",
"codelibDesc": "代码库服务可以将项目已有的 SVN 及 GIT 工程关联至CI,它将作为流水线的原材料",
"laodingTitle": "正在加载仓库列表",
"aliasNamePlaceholder": "请输入别名,按回车进行搜索",
"noCodelibPermission": "无代码库权限",
"noPermissionDesc": "你没有创建权限,请切换项目或申请相应权限",
"switchProject": "切换项目",
"applyPermission": "申请权限",
"index": "序列",
"create": "创建",
"new": "新增",
"aliasName": "别名",
"aliasNameEnter": "请输入别名",
"address": "地址",
"type": "类型",
"operation": "操作",
"edit": "编辑",
"delete": "删除",
"deleteCodelib": "删除代码库({0})?",
"confirm": "确认",
"successfullyDeleted": "删除成功",
"codelibMode": "源代码方式",
"codelibUrl": "源代码地址",
"codelibUrlPlaceholder": "请选择代码库地址",
"oauthCert": "OAUTH",
"codelibPullType": "源代码拉取方式",
"codelibCredential": "访问凭据",
"credentialPlaceholder": "请选择相应类型的凭据",
"credentialRequired": "凭据ID不能为空",
"svnUrlPlaceholder": "请输入相应类型的SVN代码库地址",
"gitUrlPlaceholder": "请输入SSH方式的Git代码库地址",
"tgitUrlPlaceholder": "请输入SSH方式的TGit代码库地址",
"gitlabUrlPlaceholder": "请输入HTTP方式的Gitlab代码库地址",
"p4UrlPlaceholder": "请输入HTTP方式的P4代码库地址",
"httpUrlPlaceholder": "请输入HTTP方式的Git代码库地址",
"httpsUrlPlaceholder": "请输入HTTPS方式的TGit代码库地址",
"svnCredPlaceholder": "请选择相应类型的凭据",
"gitCredPlaceholder": "请选择SSH私钥+私有Token类型的凭据",
"gitlabCredPlaceholder": "请选择AccessToken类型的凭据",
"successfullyEdited": "修改成功",
"successfullyAdded": "添加成功",
"githubRule": "请输入以https://github.com/开头的",
"svnSshRule": "请输入以svn+ssh://开头的正确的",
"httpRule": "请输入以http://开头的正确的",
"httpsRule": "请输入以http://开头,以.git结尾的",
"paramBeString": "参数必须为字符串",
"gitCodeInternalRule": "请输入以git@开头,以.git结尾的",
"tgitHttpRule": "请输入以https://git.tencent.com或https://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和PORT。如果使用SSL连接到P4,则用ssl:host:port"
}
"codelib": "代码库",
"linkCodelib": "关联代码库",
"repo": "代码库",
"link": "关联",
"codelibDesc": "代码库服务可以将项目已有的 SVN 及 GIT 工程关联至CI,它将作为流水线的原材料",
"laodingTitle": "正在加载仓库列表",
"aliasNamePlaceholder": "请输入别名,按回车进行搜索",
"noCodelibPermission": "无代码库权限",
"noPermissionDesc": "你没有创建权限,请切换项目或申请相应权限",
"switchProject": "切换项目",
"applyPermission": "申请权限",
"index": "序列",
"create": "创建",
"new": "新增",
"aliasName": "别名",
"aliasNameEnter": "请输入别名",
"address": "地址",
"type": "类型",
"operation": "操作",
"edit": "编辑",
"delete": "删除",
"deleteCodelib": "删除代码库({0})?",
"confirm": "确认",
"successfullyDeleted": "删除成功",
"codelibMode": "源代码方式",
"codelibUrl": "源代码地址",
"codelibUrlPlaceholder": "请选择代码库地址",
"oauthCert": "OAUTH",
"codelibPullType": "源代码拉取方式",
"codelibCredential": "访问凭据",
"credentialPlaceholder": "请选择相应类型的凭据",
"credentialRequired": "凭据ID不能为空",
"svnUrlPlaceholder": "请输入相应类型的SVN代码库地址",
"gitUrlPlaceholder": "请输入SSH方式的Git代码库地址",
"tgitUrlPlaceholder": "请输入SSH方式的TGit代码库地址",
"gitlabUrlPlaceholder": "请输入HTTP方式的Gitlab代码库地址",
"p4UrlPlaceholder": "请输入HTTP方式的P4代码库地址",
"httpUrlPlaceholder": "请输入HTTP方式的Git代码库地址",
"httpsUrlPlaceholder": "请输入HTTPS方式的TGit代码库地址",
"svnCredPlaceholder": "请选择相应类型的凭据",
"gitCredPlaceholder": "请选择SSH私钥+私有Token类型的凭据",
"gitlabCredPlaceholder": "请选择AccessToken类型的凭据",
"successfullyEdited": "修改成功",
"successfullyAdded": "添加成功",
"githubRule": "请输入以https://github.com/开头的",
"svnSshRule": "请输入以svn+ssh://开头的正确的",
"httpRule": "请输入以http://开头的正确的",
"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和PORT。如果使用SSL连接到P4,则用ssl:host:port"
}
\ No newline at end of file
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