From b7bb409e96b8d01434e812b5c3531248f20cabc7 Mon Sep 17 00:00:00 2001 From: ningyv <1793599591@qq.com> Date: Fri, 13 Dec 2024 20:00:38 +0800 Subject: [PATCH] fix: consumer permission --- .../PublishApprovalModalContent.tsx | 19 ++++----------- .../packages/common/src/const/permissions.ts | 24 +++++++++---------- .../PartitionInsideDashboardSetting.tsx | 2 +- frontend/packages/core/vite.config.ts | 3 ++- .../management/ServiceHubManagement.tsx | 4 ++-- 5 files changed, 22 insertions(+), 30 deletions(-) diff --git a/frontend/packages/common/src/components/aoplatform/PublishApprovalModalContent.tsx b/frontend/packages/common/src/components/aoplatform/PublishApprovalModalContent.tsx index 5cc681ff..3e1393da 100644 --- a/frontend/packages/common/src/components/aoplatform/PublishApprovalModalContent.tsx +++ b/frontend/packages/common/src/components/aoplatform/PublishApprovalModalContent.tsx @@ -146,20 +146,11 @@ export const PublishApprovalModalContent = forwardRef { - switch(entity.change){ - case 'none': - return '-' - case 'new': - return $t('新建') - case 'update': - return $t('更新') - case 'delete': - return $t('删除') - default: - return '-' - } - } + render:(_,entity)=> ( + + {$t(ChangeTypeEnum[entity.change as (keyof typeof ChangeTypeEnum)] || '-')} + + ) }:{}) } }),[state.language]) diff --git a/frontend/packages/common/src/const/permissions.ts b/frontend/packages/common/src/const/permissions.ts index f1e6f43c..abfff745 100644 --- a/frontend/packages/common/src/const/permissions.ts +++ b/frontend/packages/common/src/const/permissions.ts @@ -486,17 +486,17 @@ export const PERMISSION_DEFINITION = [ }, "team.application.subscription.add": { "granted": { - "anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.subscription.subscribe"] }] + "anyOf": [{ "backend": ["system.workspace.application.manager_all","team.consumer.subscription.subscribe"] }] } }, "team.application.subscription.edit": { "granted": { - "anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.subscription.manager_subscribed_services"] }] + "anyOf": [{ "backend": ["system.workspace.application.manager_all","team.consumer.subscription.manager_subscribed_services"] }] } }, "team.application.subscription.delete": { "granted": { - "anyOf": [{ "backend": ["system.workspace.application.manager_al","team.team.consumer.subscription.manager_subscribed_services"] }] + "anyOf": [{ "backend": ["system.workspace.application.manager_all","team.team.consumer.subscription.manager_subscribed_services"] }] } }, "team.application.application.view": { @@ -506,47 +506,47 @@ export const PERMISSION_DEFINITION = [ }, "team.application.application.add": { "granted": { - "anyOf": [{ "backend": ["system.workspace.application.manager_al",'team.team.consumer.manager',"team.consumer.application.manager"] }] + "anyOf": [{ "backend": ["system.workspace.application.manager_all",'team.team.consumer.manager',"team.consumer.application.manager"] }] } }, "team.application.application.edit": { "granted": { - "anyOf": [{ "backend": ["system.workspace.application.manager_al",'team.team.consumer.manager',"team.consumer.application.manager"] }] + "anyOf": [{ "backend": ["system.workspace.application.manager_all",'team.team.consumer.manager',"team.consumer.application.manager"] }] } }, "team.application.application.delete": { "granted": { - "anyOf": [{ "backend": ["system.workspace.application.manager_al",'team.team.consumer.manager',"team.consumer.application.manager"] }] + "anyOf": [{ "backend": ["system.workspace.application.manager_all",'team.team.consumer.manager',"team.consumer.application.manager"] }] } }, "team.consumer.authorization.view": { "granted": { - "anyOf": [{ "backend": ["system.workspace.application.manager_al","system.workspace.application.view_all","team.consumer.authorization.view"] }] + "anyOf": [{ "backend": ["system.workspace.application.manager_all","system.workspace.application.view_all","team.consumer.authorization.view"] }] } }, "team.application.authorization.add": { "granted": { - "anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.authorization.manager"] }] + "anyOf": [{ "backend": ["system.workspace.application.manager_all","team.consumer.authorization.manager"] }] } }, "team.application.authorization.edit": { "granted": { - "anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.authorization.manager"] }] + "anyOf": [{ "backend": ["system.workspace.application.manager_all","team.consumer.authorization.manager"] }] } }, "team.application.authorization.delete": { "granted": { - "anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.authorization.manager"] }] + "anyOf": [{ "backend": ["system.workspace.application.manager_all","team.consumer.authorization.manager"] }] } }, "team.application.authorization.cancelSubApply": { "granted": { - "anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.authorization.manager"] }] + "anyOf": [{ "backend": ["system.workspace.application.manager_all","team.consumer.authorization.manager"] }] } }, "team.application.authorization.cancelSub": { "granted": { - "anyOf": [{ "backend": ["system.workspace.application.manager_al","team.consumer.authorization.manager"] }] + "anyOf": [{ "backend": ["system.workspace.application.manager_all","team.consumer.authorization.manager"] }] } }, "team.team.team.view": { diff --git a/frontend/packages/core/src/pages/partitions/PartitionInsideDashboardSetting.tsx b/frontend/packages/core/src/pages/partitions/PartitionInsideDashboardSetting.tsx index bede0a6f..53b2882e 100644 --- a/frontend/packages/core/src/pages/partitions/PartitionInsideDashboardSetting.tsx +++ b/frontend/packages/core/src/pages/partitions/PartitionInsideDashboardSetting.tsx @@ -88,7 +88,7 @@ const PartitionInsideDashboardSetting: FC = () => { pageTitle={$t('数据源')} description={$t("设置监控报表的数据来源,设置完成之后即可获得详细的API调用统计图表。")} showBorder={false} - scrollPage={true} + scrollPage={false} >
} spinning={loading}> diff --git a/frontend/packages/core/vite.config.ts b/frontend/packages/core/vite.config.ts index 4313bf4d..9239dd7d 100644 --- a/frontend/packages/core/vite.config.ts +++ b/frontend/packages/core/vite.config.ts @@ -77,7 +77,8 @@ export default defineConfig({ target: 'http://172.18.166.219:8288/', changeOrigin: true, } - } + }, + open: true }, logLevel:'info' }) diff --git a/frontend/packages/market/src/pages/serviceHub/management/ServiceHubManagement.tsx b/frontend/packages/market/src/pages/serviceHub/management/ServiceHubManagement.tsx index 59e99221..c71f0494 100644 --- a/frontend/packages/market/src/pages/serviceHub/management/ServiceHubManagement.tsx +++ b/frontend/packages/market/src/pages/serviceHub/management/ServiceHubManagement.tsx @@ -11,7 +11,7 @@ import { RouterParams } from "@core/components/aoplatform/RenderRoutes"; import { SimpleTeamItem } from "@common/const/type"; import { useTenantManagementContext } from "../../../contexts/TenantManagementContext"; import { Icon } from "@iconify/react/dist/iconify.js"; -import { useGlobalContext } from "@common/contexts/GlobalStateContext"; +import { GlobalProvider, useGlobalContext } from "@common/contexts/GlobalStateContext"; import { $t } from "@common/locales"; import WithPermission from "@common/components/aoplatform/WithPermission"; import InsidePage from "@common/components/aoplatform/InsidePage"; @@ -149,7 +149,7 @@ export default function ServiceHubManagement() { switch (type){ case 'add': title=$t('添加消费者') - content= + content= break; // case 'edit':{ // title='配置 Open Api'