From 2ce1b44cf8d67a470792723556075537ec6f8ccc Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Fri, 27 Sep 2024 17:41:35 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feature:=20=20=E7=94=A8=E6=88=B7=E7=BB=84?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E6=94=AF=E6=8C=81=E5=85=B3=E8=81=94=E4=B8=8D?= =?UTF-8?q?=E5=9C=A8=E5=90=8C=E4=B8=80=E7=B3=BB=E7=BB=9F=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B8=8B=E7=9A=84=E6=9D=83=E9=99=90=E5=AE=9E?= =?UTF-8?q?=E4=BE=8B=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/render-instance-table.vue | 7 +++---- .../components/render-instance-table.vue | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/frontend/src/views/group/components/render-instance-table.vue b/frontend/src/views/group/components/render-instance-table.vue index 2bd5f25d2..87bbae34e 100644 --- a/frontend/src/views/group/components/render-instance-table.vue +++ b/frontend/src/views/group/components/render-instance-table.vue @@ -1304,10 +1304,9 @@ let scopeInstanceList = []; let scopeAttributeList = []; payload.forEach(item => { - const curIndex = this.tableList.findIndex(sub => sub.id === item.id - && item.resource_groups[this.curGroupIndex] - && sub.detail.system.id === item.resource_groups[this.curGroupIndex] - .related_resource_types[0].system_id); + const curIndex = this.tableList.findIndex(sub => + sub.id === item.id && item.resource_groups[this.curGroupIndex] + ); if (curIndex > -1) { const { isTemplate, detail } = this.tableList[curIndex]; const systemId = this.isCreateMode && detail ? detail.system.id : this.systemId; diff --git a/frontend/src/views/manage-spaces/secondary-manage-space/components/render-instance-table.vue b/frontend/src/views/manage-spaces/secondary-manage-space/components/render-instance-table.vue index 93efba8dc..27238e91d 100644 --- a/frontend/src/views/manage-spaces/secondary-manage-space/components/render-instance-table.vue +++ b/frontend/src/views/manage-spaces/secondary-manage-space/components/render-instance-table.vue @@ -982,10 +982,9 @@ let scopeInstanceList = []; let scopeAttributeList = []; payload.forEach(item => { - const curIndex = this.tableList.findIndex(sub => sub.id === item.id - && item.resource_groups[this.curGroupIndex] - && sub.detail.system.id === item.resource_groups[this.curGroupIndex] - .related_resource_types[0].system_id); + const curIndex = this.tableList.findIndex(sub => + sub.id === item.id && item.resource_groups[this.curGroupIndex] + ); if (curIndex > -1) { const { isTemplate, detail } = this.tableList[curIndex]; const systemId = this.isCreateMode && detail ? detail.system.id : this.systemId; @@ -1017,8 +1016,16 @@ resource.instances.forEach((ins) => { ins.path.forEach((p, pathIndex) => { if (p.length > 0) { + // 处理授权范围是父级,但是选择了子集数据,需要查找所选数据是不是属于授权范围内的子集数据 + let curParentChain = []; + const tempPath = p.filter(v => v.id !== '*'); + if (tempPath.length) { + curParentChain = tempPath.slice(0, tempPath.length - 1); + } + // 判断授权范围是不是父级数据 + const isExistParent = curParentChain.filter((subPath) => scopeInsList.includes(`${subPath.id}&${subPath.name}&${subPath.type}`)); // 只获取授权范围内的资源实例 - ins.path[pathIndex] = p.filter((subPath) => scopeInsList.includes(`${subPath.id}&${subPath.name}&${subPath.type}`)); + ins.path[pathIndex] = p.filter((subPath) => scopeInsList.includes(`${subPath.id}&${subPath.name}&${subPath.type}`) || isExistParent.length > 0); } }); // 因为path链路是多维数组且无法确定链路数量,所以这里需要过滤掉空数组 @@ -1027,6 +1034,8 @@ ins.paths = _.cloneDeep(ins.path); } }); + // 这里会存在path的内容不在授权范围内会被过滤掉,而path内容是必填项 + resource.instances = resource.instances.filter((k) => k.path && k.path.length > 0); if (resource.attributes && resource.attributes.length > 0 && scopeAttributeList && scopeAttributeList.length > 0 ) { From 2563a5ce60efc163cd9b0813666b18428a03e6eb Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Wed, 9 Oct 2024 17:38:53 +0800 Subject: [PATCH 2/7] =?UTF-8?q?feature:=20=E6=9B=B4=E6=96=B0=E6=89=80?= =?UTF-8?q?=E6=9C=89=E6=96=87=E6=A1=A3=E4=B8=AD=E5=BF=83=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E6=9C=80=E6=96=B0=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 3 ++- frontend/src/components/header-nav/index.vue | 3 ++- frontend/src/views/grading-admin/index.vue | 6 +++--- frontend/src/views/my-manage-space/index.vue | 7 ++++--- frontend/src/views/system-access/index.vue | 5 +++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index ec51dac30..e1907b858 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -384,12 +384,13 @@ getRouteInstanceSearch (payload = {}) { const { show, routeName } = payload; + const curLang = formatI18nKey().toLowerCase().indexOf('en') > -1 ? 'EN' : 'ZH'; const routeMap = { applyCustomPerm: () => { this.noInstanceSearchData = Object.assign({}, { show: show || false, mode: 'dialog', - url: `/IAM//1.8/UserGuide/Feature/PermissionsApply.md`, + url: `/${curLang}/IAM/1.16/UserGuide/Feature/PermissionsApply.md`, title: this.$t(`m.permApply['未启用用户组自动推荐功能']`), functionalDesc: this.t(`m.permApply['该功能可以根据用户当前的权限需求,自动匹配相关的用户组']`), guideTitle: this.$t(`m.permApply['如需启用该功能,请联系部署同学部署相关ES服务']`), diff --git a/frontend/src/components/header-nav/index.vue b/frontend/src/components/header-nav/index.vue index 8343001d2..e82592648 100644 --- a/frontend/src/components/header-nav/index.vue +++ b/frontend/src/components/header-nav/index.vue @@ -173,7 +173,8 @@ }; }; - const NORMAL_DOCU_LINK = '/IAM/UserGuide/Introduce/README.md'; + const curLang = formatI18nKey().toLowerCase().indexOf('en') > -1 ? 'EN' : 'ZH'; + const NORMAL_DOCU_LINK = `/${curLang}/IAM/1.16/UserGuide/Introduce/README.md`; // const GRADE_DOCU_LINK = '/权限中心/产品白皮书/场景案例/GradingManager.md'; const docuLinkMap = new Map([ diff --git a/frontend/src/views/grading-admin/index.vue b/frontend/src/views/grading-admin/index.vue index bf331f50a..6c6033192 100644 --- a/frontend/src/views/grading-admin/index.vue +++ b/frontend/src/views/grading-admin/index.vue @@ -273,7 +273,7 @@ import _ from 'lodash'; import { mapGetters } from 'vuex'; import { buildURLParams } from '@/common/url'; - import { getWindowHeight, formatCodeData } from '@/common/util'; + import { getWindowHeight, formatCodeData, formatI18nKey } from '@/common/util'; import ConfirmDialog from '@/components/iam-confirm-dialog/index'; import ApplyDialog from './components/apply-join-dialog'; import IamEditInput from '@/views/my-manage-space/components/iam-edit/input'; @@ -864,8 +864,8 @@ }, handleOpenDocu () { - const GRADE_DOCU_LINK = '/IAM/UserGuide/Feature/ManagerCreate.md'; - window.open(`${window.BK_DOCS_URL_PREFIX}${GRADE_DOCU_LINK}`); + const curLang = formatI18nKey().toLowerCase().indexOf('en') > -1 ? 'EN' : 'ZH'; + window.open(`${window.BK_DOCS_URL_PREFIX}/${curLang}/IAM/1.16/UserGuide/Feature/ManagerCreate.md`); } } diff --git a/frontend/src/views/my-manage-space/index.vue b/frontend/src/views/my-manage-space/index.vue index b0c8f53de..bc83c77a1 100644 --- a/frontend/src/views/my-manage-space/index.vue +++ b/frontend/src/views/my-manage-space/index.vue @@ -319,7 +319,7 @@ diff --git a/frontend/src/views/my-manage-space/index.vue b/frontend/src/views/my-manage-space/index.vue index bc83c77a1..af9820dcb 100644 --- a/frontend/src/views/my-manage-space/index.vue +++ b/frontend/src/views/my-manage-space/index.vue @@ -196,9 +196,9 @@ iconColor[1] : iconColor[0] }" /> @@ -224,9 +224,9 @@ @@ -319,7 +319,7 @@