From c017e5fdf780079e8f95167eddd763f2bf994d96 Mon Sep 17 00:00:00 2001 From: lannoy0523 <46735290+lannoy0523@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:05:33 +0800 Subject: [PATCH] =?UTF-8?q?bug=EF=BC=9A=E4=BF=AE=E6=AD=A3=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E4=BB=93=E5=BA=93=E8=AE=BF=E9=97=AE=E6=9D=83=E9=99=90?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=B8=A5=E6=A0=BC=EF=BC=8C=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=86=8D=E6=AC=A1=E5=88=87=E6=8D=A2=E9=9D=9E?= =?UTF-8?q?GENERIC=EF=BC=8CDDC=E7=B1=BB=E5=9E=8B=EF=BC=8C=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E8=AE=BF=E9=97=AE=E6=9D=83=E9=99=90=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=20#2527?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/repoList/createRepoDialog.vue | 76 +------------------ 1 file changed, 4 insertions(+), 72 deletions(-) diff --git a/src/frontend/devops-repository/src/views/repoList/createRepoDialog.vue b/src/frontend/devops-repository/src/views/repoList/createRepoDialog.vue index f2dc3ea559..4b74d91d0c 100644 --- a/src/frontend/devops-repository/src/views/repoList/createRepoDialog.vue +++ b/src/frontend/devops-repository/src/views/repoList/createRepoDialog.vue @@ -148,51 +148,7 @@ projectId () { return this.$route.params.projectId }, - isCommunity () { - // 是否为社区版 - return RELEASE_MODE === 'community' - }, - genericInterceptorsList () { - return this.isCommunity ? ['mobile', 'web'] : ['mobile', 'web', 'ip_segment'] - }, rules () { - const filenameRule = [ - { - required: true, - message: this.$t('pleaseFileName'), - trigger: 'blur' - } - ] - const metadataRule = [ - { - required: true, - message: this.$t('pleaseMetadata'), - trigger: 'blur' - }, - { - regex: /^[^\s]+:[^\s]+/, - message: this.$t('metadataRule'), - trigger: 'blur' - } - ] - const ipSegmentRule = [ - { - required: true, - message: this.$t('pleaseIpSegment'), - trigger: 'blur' - }, - { - validator: function (val) { - const ipList = val.split(',') - return ipList.every(ip => { - if (!ip) return true - return ipList.every(ip => /(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\b\/([0-9]|[1-2][0-9]|3[0-2])\b)/.test(ip)) - }) - }, - message: this.$t('ipSegmentRule'), - trigger: 'blur' - } - ] return { type: [ { @@ -235,12 +191,7 @@ message: this.$t('pleaseInput') + this.$t('legit') + this.$t('groupXmlSet') + `(.xml${this.$t('type')})`, trigger: 'change' } - ], - 'mobile.filename': filenameRule, - 'mobile.metadata': metadataRule, - 'web.filename': filenameRule, - 'web.metadata': metadataRule, - 'ip_segment.ipSegment': this.repoBaseInfo.ip_segment.officeNetwork ? {} : ipSegmentRule + ] } }, available: { @@ -275,6 +226,7 @@ { label: this.$t('permissionTitle.public'), value: 'public', tip: this.$t('permissionTip.public') } ] } else { + this.accessControl = 'DEFAULT' return [ { label: this.$t('permissionTitle.default'), value: 'default', tip: this.$t('permissionTip.default') }, { label: this.$t('permissionTitle.public'), value: 'public', tip: this.$t('permissionTip.public') } @@ -293,6 +245,7 @@ }) }, cancel () { + this.accessControl = 'DEFAULT' this.show = false }, asynCheckRepoName () { @@ -307,27 +260,6 @@ }, async confirm () { await this.$refs.repoBaseInfo.validate() - const interceptors = [] - if (this.repoBaseInfo.type === 'generic' || this.repoBaseInfo.type === 'ddc') { - ['mobile', 'web', 'ip_segment'].forEach(type => { - const { enable, filename, metadata, ipSegment, whitelistUser, officeNetwork } = this.repoBaseInfo[type] - if (['mobile', 'web'].includes(type)) { - enable && interceptors.push({ - type: type.toUpperCase(), - rules: { filename, metadata } - }) - } else { - enable && interceptors.push({ - type: type.toUpperCase(), - rules: { - ipSegment: ipSegment.split(','), - whitelistUser: whitelistUser.split(','), - officeNetwork - } - }) - } - }) - } const body = { projectId: this.projectId, type: this.repoBaseInfo.type.toUpperCase(), @@ -340,7 +272,7 @@ type: this.repoBaseInfo.type === 'generic' ? 'local' : 'composite', settings: { system: this.repoBaseInfo.system, - interceptors: interceptors.length ? interceptors : undefined, + interceptors: undefined, ...( this.repoBaseInfo.type === 'rpm' ? {