From 693b76ee186df6edfc0a7c6fa5ef8980459a9d59 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Thu, 15 Aug 2024 18:28:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E4=BB=A3=E7=A0=81=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/packages/businessEntry/tsconfig.json | 2 +- .../src/components/aoplatform/BasicLayout.tsx | 4 +- .../aoplatform/DrawerWithFooter.tsx | 5 +- .../src/components/aoplatform/InsidePage.tsx | 45 +++++----- .../aoplatform/InsidePageForHub.tsx | 54 ------------ .../components/aoplatform/PageList.module.css | 1 - .../src/components/aoplatform/PageList.tsx | 10 +-- .../PublishApprovalModalContent.tsx | 8 +- .../src/components/aoplatform/UserAvatar.tsx | 2 +- .../components/aoplatform/WithPermission.tsx | 10 +-- .../IntelligentPluginConfig.tsx | 5 +- .../IntelligentPluginList.tsx | 10 +-- .../common/src/const/approval/const.tsx | 19 ----- frontend/packages/common/tailwind.config.js | 4 + .../packages/core/src/const/member/const.tsx | 4 - .../core/src/const/partitions/const.tsx | 18 ++-- .../packages/core/src/const/role/const.tsx | 1 - .../packages/core/src/const/system/const.tsx | 29 +------ .../packages/core/src/const/system/type.ts | 3 +- .../packages/core/src/const/team/const.tsx | 8 -- .../packages/core/src/const/user/const.tsx | 2 - frontend/packages/core/src/index.css | 19 +++-- .../core/src/pages/auditLog/AuditLog.tsx | 1 - .../core/src/pages/member/MemberList.tsx | 33 ++------ .../core/src/pages/member/MemberPage.tsx | 68 ++++++--------- .../pages/partitions/PartitionInsideCert.tsx | 13 +-- .../partitions/PartitionInsideCluster.tsx | 62 +++++++------- .../core/src/pages/role/RoleConfig.tsx | 2 - .../packages/core/src/pages/role/RoleList.tsx | 84 ++++++++++--------- .../pages/serviceCategory/ServiceCategory.tsx | 18 ++-- .../core/src/pages/system/SystemConfig.tsx | 25 ++---- .../src/pages/system/SystemInsidePage.tsx | 4 +- .../pages/system/SystemInsideSubscriber.tsx | 17 ++-- .../core/src/pages/system/SystemList.tsx | 2 +- .../core/src/pages/system/SystemTopology.tsx | 2 +- .../pages/system/api/SystemInsideApiList.tsx | 2 +- .../approval/SystemInsideApprovalList.tsx | 2 +- .../system/publish/SystemInsidePublish.tsx | 2 +- .../publish/SystemInsidePublishList.tsx | 3 +- .../upstream/SystemInsideUpstreamContent.tsx | 4 +- .../core/src/pages/team/TeamInsidePage.tsx | 5 +- .../packages/core/src/pages/team/TeamList.tsx | 13 +-- frontend/packages/core/tsconfig.json | 2 +- .../packages/dashboard/src/const/const.tsx | 18 ---- .../market/src/const/serviceHub/const.tsx | 5 -- .../market/src/const/serviceHub/type.ts | 4 - .../src/pages/serviceHub/ServiceHubGroup.tsx | 11 +-- .../src/pages/serviceHub/ServiceHubList.tsx | 8 +- .../src/pages/SystemRunningInstruction.tsx | 4 +- go.mod | 5 +- middleware/permit/identity/identity.go | 5 +- middleware/permit/permit.go | 2 + resources/access/access.yaml | 20 +++++ resources/access/role.yaml | 28 ++++++- 54 files changed, 304 insertions(+), 433 deletions(-) delete mode 100644 frontend/packages/common/src/components/aoplatform/InsidePageForHub.tsx diff --git a/frontend/packages/businessEntry/tsconfig.json b/frontend/packages/businessEntry/tsconfig.json index 4bc7c38f..bfb0e8fa 100644 --- a/frontend/packages/businessEntry/tsconfig.json +++ b/frontend/packages/businessEntry/tsconfig.json @@ -28,6 +28,6 @@ "@businessEntry/*": ["./src/*"], }, }, - "include": ["src", "public/iconpark_eolink.js", "public/iconpark_apinto.js", "../common/src/component/aoplatform/EditableTableWithModal.tsx", "../common/src/components/aoplatform/TransferTable.tsx", "../common/src/components/aoplatform/TreeWithMore.tsx", "../common/src/components/aoplatform/DatePicker.tsx", "../common/src/components/aoplatform/TimeRangeSelector.tsx", "../common/src/components/aoplatform/TimePicker.tsx", "../common/src/components/aoplatform/MemberTransfer.tsx", "../common/src/components/aoplatform/Navigation.tsx", "../common/src/components/aoplatform/PageList.tsx", "../common/src/components/aoplatform/GroupTree.tsx", "../common/src/components/aoplatform/ErrorBoundary.tsx", "../common/src/components/aoplatform/ScrollableSection.tsx", "../common/src/utils/postcat.tsx", "../common/src/utils/curl.ts", "../common/src/components/aoplatform/ResetPsw.tsx", "../common/src/components/aoplatform/SubscribeApprovalModalContent.tsx", "../common/src/components/aoplatform/InsidePageForHub.tsx", "src/components/aoplatform/RenderRoutes.tsx", "../common/src/components/aoplatform/PublishApprovalModalContent.tsx", "../common/src/components/aoplatform/InsidePage.tsx", "../common/src/const/type.ts", "../common/src/components/aoplatform/intelligent-plugin", "../common/src/const/domain"], + "include": ["src", "public/iconpark_eolink.js", "public/iconpark_apinto.js", "../common/src/component/aoplatform/EditableTableWithModal.tsx", "../common/src/components/aoplatform/TransferTable.tsx", "../common/src/components/aoplatform/TreeWithMore.tsx", "../common/src/components/aoplatform/DatePicker.tsx", "../common/src/components/aoplatform/TimeRangeSelector.tsx", "../common/src/components/aoplatform/TimePicker.tsx", "../common/src/components/aoplatform/MemberTransfer.tsx", "../common/src/components/aoplatform/Navigation.tsx", "../common/src/components/aoplatform/PageList.tsx", "../common/src/components/aoplatform/GroupTree.tsx", "../common/src/components/aoplatform/ErrorBoundary.tsx", "../common/src/components/aoplatform/ScrollableSection.tsx", "../common/src/utils/postcat.tsx", "../common/src/utils/curl.ts", "../common/src/components/aoplatform/ResetPsw.tsx", "../common/src/components/aoplatform/SubscribeApprovalModalContent.tsx", "src/components/aoplatform/RenderRoutes.tsx", "../common/src/components/aoplatform/PublishApprovalModalContent.tsx", "../common/src/components/aoplatform/InsidePage.tsx", "../common/src/const/type.ts", "../common/src/components/aoplatform/intelligent-plugin", "../common/src/const/domain"], "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/frontend/packages/common/src/components/aoplatform/BasicLayout.tsx b/frontend/packages/common/src/components/aoplatform/BasicLayout.tsx index 256f4eaa..0e4002fa 100644 --- a/frontend/packages/common/src/components/aoplatform/BasicLayout.tsx +++ b/frontend/packages/common/src/components/aoplatform/BasicLayout.tsx @@ -125,7 +125,7 @@ const themeToken = { { key: '3', label: ( - + 退出登录 ), @@ -259,7 +259,7 @@ const themeToken = { collapsed={false} collapsedButtonRender={false} > -
+
diff --git a/frontend/packages/common/src/components/aoplatform/DrawerWithFooter.tsx b/frontend/packages/common/src/components/aoplatform/DrawerWithFooter.tsx index 87531dac..3016cd09 100644 --- a/frontend/packages/common/src/components/aoplatform/DrawerWithFooter.tsx +++ b/frontend/packages/common/src/components/aoplatform/DrawerWithFooter.tsx @@ -34,8 +34,11 @@ export function DrawerWithFooter(props:DrawerWithFooterProps){ width="60%" destroyOnClose={true} maskClosable={false} + classNames={ + {footer:'text-right'} + } footer={ - + {showOkBtn && -
} -
-
-

{pageTitle}

- {tagList && tagList?.length > 0 && tagList?.map((tag)=>{ - return ( {tag.label}) - })} +
+ { showBanner &&
+
+ {backUrl &&
+ +
} +
+
+

{pageTitle}

+ {tagList && tagList?.length > 0 && tagList?.map((tag)=>{ + return ( {tag.label}) + })} +
+ {showBtn && }
- {showBtn && } +

+ {description} +

-

- {description} -

} -
{children}
+
{children}
) } diff --git a/frontend/packages/common/src/components/aoplatform/InsidePageForHub.tsx b/frontend/packages/common/src/components/aoplatform/InsidePageForHub.tsx deleted file mode 100644 index 833c717a..00000000 --- a/frontend/packages/common/src/components/aoplatform/InsidePageForHub.tsx +++ /dev/null @@ -1,54 +0,0 @@ - -import { Button, Tag } from "antd" -import {useNavigate} from "react-router-dom"; -import WithPermission from "@common/components/aoplatform/WithPermission"; -import { FC, ReactNode } from "react"; -import { ArrowLeftOutlined } from "@ant-design/icons"; - - -class InsidePageProps { - showBanner?:boolean = true - pageTitle:string = '' - tagList?:Array<{label:string|ReactNode}> = [] - children:React.ReactNode - showBtn?:boolean = false - btnTitle?:string = '' - description?:string = '' - onBtnClick?:()=>void - backUrl:string = '/' - btnAccess?:string -} - -const InsidePageForHub:FC = ({showBanner=true,pageTitle,tagList,showBtn,btnTitle,btnAccess,description,children,onBtnClick,backUrl})=>{ - const navigate = useNavigate(); - - const goBack = () => { - navigate(backUrl); - }; - return ( -
- { showBanner &&
-
- -
-
-
- {pageTitle} - {tagList && tagList?.length > 0 && tagList?.map((tag)=>{ - return ( {tag.label}) - })} -
- {showBtn && } -
-

- {description} -

-
} -
{children}
-
- ) -} - -export default InsidePageForHub \ No newline at end of file diff --git a/frontend/packages/common/src/components/aoplatform/PageList.module.css b/frontend/packages/common/src/components/aoplatform/PageList.module.css index a5b0918f..06bbac7e 100644 --- a/frontend/packages/common/src/components/aoplatform/PageList.module.css +++ b/frontend/packages/common/src/components/aoplatform/PageList.module.css @@ -4,7 +4,6 @@ } :global .eo_page_list .ant-pro-table-list-toolbar-container{ - padding:10px 20px 10px 10px !important; .ant-pro-table-list-toolbar-right{ justify-content: flex-start; diff --git a/frontend/packages/common/src/components/aoplatform/PageList.tsx b/frontend/packages/common/src/components/aoplatform/PageList.tsx index bf06ea5d..f11b02a6 100644 --- a/frontend/packages/common/src/components/aoplatform/PageList.tsx +++ b/frontend/packages/common/src/components/aoplatform/PageList.tsx @@ -77,7 +77,7 @@ const PageList = >(props: React.PropsWithChild const handleResize = () => { if (parentRef.current && !noScroll) { const res = parentRef.current.getBoundingClientRect(); - const height = res.height - ((noTop ? 0 : 52) + 40 + (showPagination && !dragSortKey ? 52 : 0) +( besidesTableHeight ?? 0)); // 减去顶部按钮、底部分页、表头高度 + const height = res.height - ((noTop ? 0 : 59) + 54 + (showPagination && !dragSortKey ? 52 : 0) +( besidesTableHeight ?? 0) + 1); // 减去顶部按钮、底部分页、表头高度 setTableWidth(minTableWidth > res.width ? minTableWidth : undefined); height && setTableHeight(minVirtualHeight === undefined ? height : (height > minVirtualHeight ? height : minVirtualHeight)); } @@ -112,11 +112,11 @@ const PageList = >(props: React.PropsWithChild const newColumns = useMemo(()=>{ let width:number = 0 const res = columns?.map( - (x)=>{ + (x, index)=>{ width += Number(x.width ?? ((x.filters || x.sorter) ? 120 : 100)) - x.copyable = x.copyable === false? false: true const sorter = localStorage.getItem(`${id}_sorter`) const filters = localStorage.getItem(`${id}_filters`) + x.copyable = x.copyable ?? (index === 0 || x.dataIndex === 'id' || x.dataIndex === 'email') if(sorter && x.sorter){ const sorterObj = JSON.parse(sorter) const xName = Array.isArray(x.dataIndex) ? x.dataIndex.join(','):x.dataIndex @@ -137,7 +137,7 @@ const PageList = >(props: React.PropsWithChild return ( <>{ tableTitle ? {tableTitle} : ( - addNewBtnTitle ? : undefined + addNewBtnTitle ? : undefined ) } @@ -191,7 +191,7 @@ const PageList = >(props: React.PropsWithChild ):null, ]} toolbar={{ - actions:[...[beforeSearchNode],...[searchPlaceholder? debounce(onSearchWordChange, 100)(e) : undefined } onPressEnter={()=>manualReloadTable ? manualReloadTable():actionRef.current?.reload?.()} allowClear placeholder={searchPlaceholder} prefix={{actionRef.current?.reload?.()}}/>}/>:null]], + actions:[...[beforeSearchNode],...[searchPlaceholder? debounce(onSearchWordChange, 100)(e) : undefined } onPressEnter={()=>manualReloadTable ? manualReloadTable():actionRef.current?.reload?.()} allowClear placeholder={searchPlaceholder} prefix={{actionRef.current?.reload?.()}}/>}/>:null]], }} options={{ reload: false, diff --git a/frontend/packages/common/src/components/aoplatform/PublishApprovalModalContent.tsx b/frontend/packages/common/src/components/aoplatform/PublishApprovalModalContent.tsx index c8e6a8c9..2128cc7a 100644 --- a/frontend/packages/common/src/components/aoplatform/PublishApprovalModalContent.tsx +++ b/frontend/packages/common/src/components/aoplatform/PublishApprovalModalContent.tsx @@ -26,19 +26,16 @@ const apiColumns = [ { title:'API 名称', dataIndex:'name', - copyable: true, ellipsis:true }, { title:'请求方式', dataIndex:'method', - copyable: true, ellipsis:true }, { title:'路径', dataIndex:'path', - copyable: true, ellipsis:true }, { @@ -77,7 +74,6 @@ const upstreamColumns = [ title:'地址', dataIndex:'addr', render:(text:string[])=>(<>{text.join(',')}), - copyable: true, ellipsis:true }, { @@ -265,7 +261,7 @@ export const PublishApprovalModalContent = forwardRef - +{/* {type !== 'add' && type !== 'publish' && - } + } */} {['error','done'].indexOf(data.status) !== -1 && data.clusterPublishStatus &&data.clusterPublishStatus.length > 0 && <> 上线情况: diff --git a/frontend/packages/common/src/components/aoplatform/UserAvatar.tsx b/frontend/packages/common/src/components/aoplatform/UserAvatar.tsx index 7748c443..ade60c0c 100644 --- a/frontend/packages/common/src/components/aoplatform/UserAvatar.tsx +++ b/frontend/packages/common/src/components/aoplatform/UserAvatar.tsx @@ -70,7 +70,7 @@ const UserAvatar: FC = () => { { key: '3', label: ( - + 退出登录 ), diff --git a/frontend/packages/common/src/components/aoplatform/WithPermission.tsx b/frontend/packages/common/src/components/aoplatform/WithPermission.tsx index c094cd55..cacbcd4a 100644 --- a/frontend/packages/common/src/components/aoplatform/WithPermission.tsx +++ b/frontend/packages/common/src/components/aoplatform/WithPermission.tsx @@ -27,13 +27,13 @@ const WithPermission = ({access, tooltip, children,disabled}:WithPermissionProps disabled && setEditAccess(false) },[lastAccess,disabled]) + return ( <> - {editAccess ? cloneElement(children): - - { cloneElement(children, {disabled:true})} - - } + {editAccess ? cloneElement(children): children?.type?.displayName !== 'Button' && + { cloneElement(children, {disabled:true})} + + } ); } diff --git a/frontend/packages/common/src/components/aoplatform/intelligent-plugin/IntelligentPluginConfig.tsx b/frontend/packages/common/src/components/aoplatform/intelligent-plugin/IntelligentPluginConfig.tsx index 9f9c5a74..fc959714 100644 --- a/frontend/packages/common/src/components/aoplatform/intelligent-plugin/IntelligentPluginConfig.tsx +++ b/frontend/packages/common/src/components/aoplatform/intelligent-plugin/IntelligentPluginConfig.tsx @@ -46,6 +46,7 @@ import {createSchemaField, FormProvider, RecursionField, useField, useForm} from import {BasicResponse, STATUS_CODE} from "@common/const/const.ts"; import {useFetch} from "@common/hooks/http.ts"; import {App} from "antd"; +import { config } from "process"; @@ -218,8 +219,8 @@ export const IntelligentPluginConfig = forwardRef({ + setColumns(res.data.basic.fields.map((field:DynamicTableField, index:number)=>({ title:field.title, dataIndex:field.name, - copyable: true, fixed:field.name === 'title' ? 'left' : undefined, ellipsis:true, width:field.name === 'title' ? 150 : undefined, @@ -227,7 +226,7 @@ export default function IntelligentPluginList(){ const openDrawer = async (type:'add'|'edit', entity?:DynamicTableItem)=>{ switch (type){ case 'add': - setCurDetail({driver:driverOptions[0].value || '',config:{'c3ebd745-f7d5-45cd-8d3e-e0e43099d20e':{scopes:[]},'550e2537-8436-48e4-ab84-f9f58faf1b18':{scopes:[]}}}) + setCurDetail({driver:driverOptions[0].value || '',config:{}}) break; case 'edit':{ setDrawerLoading(true) @@ -237,9 +236,6 @@ export default function IntelligentPluginList(){ const {code, data, msg } = res if(code === STATUS_CODE.SUCCESS){ if(data.info.config){ - for (const tab in data.info.config) { - data.info.config[tab]._apinto_show = true - } } setCurDetail(data.info) }else{ @@ -276,7 +272,7 @@ export default function IntelligentPluginList(){ return;} case 'delete': title='删除' - content=确定删除成员?此操作无法恢复,确认操作? + content=确定删除?此操作无法恢复,确认操作? break; } diff --git a/frontend/packages/common/src/const/approval/const.tsx b/frontend/packages/common/src/const/approval/const.tsx index fe7181b2..859660df 100644 --- a/frontend/packages/common/src/const/approval/const.tsx +++ b/frontend/packages/common/src/const/approval/const.tsx @@ -19,25 +19,21 @@ export const SUBSCRIBE_APPROVAL_TABLE_COLUMN : ProColumns { title: '申请方-应用', dataIndex: ['application','name'], - copyable: true, ellipsis:true }, { title: '申请服务', dataIndex: ['service','name'], - copyable: true, ellipsis:true }, { title: '服务所属系统', dataIndex: ['service','name'], - copyable: true, ellipsis:true }, { title: '服务所属团队', dataIndex: ['team','name'], - copyable: true, ellipsis:true }, { @@ -74,7 +70,6 @@ export const SUBSCRIBE_APPROVAL_INNER_TODO_TABLE_COLUMN : ProColumns[] { title: '申请时间', dataIndex: 'applyTime', - copyable: true, ellipsis:true, width:182, fixed:'left', @@ -368,13 +351,11 @@ export const PUBLISH_APPROVAL_TABLE_COLUMN : ProColumns[] { title: '申请系统', dataIndex: ['service','name'], - copyable: true, ellipsis:true }, { title: '所属团队', dataIndex: ['team','name'], - copyable: true, ellipsis:true }, { diff --git a/frontend/packages/common/tailwind.config.js b/frontend/packages/common/tailwind.config.js index 1f606491..33c2e2c7 100644 --- a/frontend/packages/common/tailwind.config.js +++ b/frontend/packages/common/tailwind.config.js @@ -75,6 +75,10 @@ module.exports = { DEFAULT_BORDER_RADIUS: 'var(--border-radius)', TREE_TITLE:'var(--small-padding) var(--LAYOUT_PADDING);', 'navbar-height': 'var(--layout-header-height)', + TAG_LEFT:'10px', + PAGE_INSIDE_X:'40px', + PAGE_INSIDE_T:'30px', + PAGE_INSIDE_B:'20px', }, borderColor: { 'color-base': 'var(--border-color)' diff --git a/frontend/packages/core/src/const/member/const.tsx b/frontend/packages/core/src/const/member/const.tsx index db321600..ed2bb056 100644 --- a/frontend/packages/core/src/const/member/const.tsx +++ b/frontend/packages/core/src/const/member/const.tsx @@ -7,7 +7,6 @@ export const MEMBER_TABLE_COLUMNS: ProColumns[] = [ { title: '用户名', dataIndex: 'name', - copyable: true, ellipsis:true, width:160, fixed:'left', @@ -18,13 +17,11 @@ export const MEMBER_TABLE_COLUMNS: ProColumns[] = [ { title: '邮箱', dataIndex: 'email', - copyable: true, ellipsis:true, }, { title: '部门', dataIndex: 'department', - copyable: true, ellipsis:true, filterMode:'tree', renderText:(_,entity:MemberTableListItem)=>(entity.department?.map(x=>x.name).join(',') || '-'), @@ -36,7 +33,6 @@ export const MEMBER_TABLE_COLUMNS: ProColumns[] = [ { title: '角色', dataIndex: 'roles', - copyable: true, ellipsis:true, width:200 }, diff --git a/frontend/packages/core/src/const/partitions/const.tsx b/frontend/packages/core/src/const/partitions/const.tsx index dae636db..1dd04fe5 100644 --- a/frontend/packages/core/src/const/partitions/const.tsx +++ b/frontend/packages/core/src/const/partitions/const.tsx @@ -8,7 +8,6 @@ export const PARTITION_CERT_TABLE_COLUMNS: ProColumns( entity.domains.join(',') ), - copyable: true, ellipsis:true }, { - title: '证书有效期', + title: '过期日期', ellipsis: true, dataIndex: 'notAfter', - copyable: true, - width:320, - renderText: (value:string,entity:PartitionCertTableListItem) => { - return `${entity.notBefore} - ${entity.notAfter}` + width:100, + renderText: (value: string) => value ? value.split(' ')?.[0] : '-', + sorter: (a,b)=> { + return a.notAfter.localeCompare(b.notAfter) }, }, { @@ -60,7 +58,6 @@ export const PARTITION_CLUSTER_TABLE_COLUMNS : ProColumns { @@ -159,7 +153,6 @@ export const PARTITION_LIST_COLUMNS: ProColumns[] = [ { title: '环境名称', dataIndex: 'name', - copyable: true, ellipsis:true, fixed:'left', sorter: (a,b)=> { @@ -169,7 +162,6 @@ export const PARTITION_LIST_COLUMNS: ProColumns[] = [ { title: 'ID', dataIndex: 'id', - copyable: true, ellipsis:true, width:140, }, diff --git a/frontend/packages/core/src/const/role/const.tsx b/frontend/packages/core/src/const/role/const.tsx index 18afbf5d..58093888 100644 --- a/frontend/packages/core/src/const/role/const.tsx +++ b/frontend/packages/core/src/const/role/const.tsx @@ -3,7 +3,6 @@ export const ROLE_TABLE_COLUMNS = [ { title: '角色名称', dataIndex: 'name', - copyable: true, ellipsis:true, fixed:'left', sorter: (a,b)=> { diff --git a/frontend/packages/core/src/const/system/const.tsx b/frontend/packages/core/src/const/system/const.tsx index 0054011e..eff6113f 100644 --- a/frontend/packages/core/src/const/system/const.tsx +++ b/frontend/packages/core/src/const/system/const.tsx @@ -74,7 +74,6 @@ export const SYSTEM_TABLE_COLUMNS: ProColumns[] = [ { title: '服务名称', dataIndex: 'name', - copyable: true, ellipsis:true, width:160, fixed:'left', @@ -86,13 +85,11 @@ export const SYSTEM_TABLE_COLUMNS: ProColumns[] = [ title: '服务 ID', dataIndex: 'id', width: 140, - copyable: true, ellipsis:true, }, { title: '所属团队', dataIndex: ['team','name'], - copyable: true, ellipsis:true, // filters: true, // onFilter: true, @@ -134,7 +131,6 @@ export const SYSTEM_SUBSERVICE_TABLE_COLUMNS: ProColumns[] { title: '用户名', dataIndex: ['user','name'], - copyable: true, ellipsis:true, width:160, fixed:'left', @@ -318,13 +306,11 @@ export const SYSTEM_MEMBER_TABLE_COLUMN: ProColumns[] { title: '邮箱', dataIndex: 'email', - copyable: true, ellipsis:true }, { title: '角色', dataIndex: ['roles','name'], - copyable: true, ellipsis:true } @@ -374,7 +360,6 @@ export const SYSTEM_API_TABLE_COLUMNS: ProColumns[] = [ { title: '名称', dataIndex: 'name', - copyable: true, ellipsis:true, width:160, fixed:'left', @@ -401,7 +386,6 @@ export const SYSTEM_API_TABLE_COLUMNS: ProColumns[] = [ { title: 'URL', dataIndex: 'requestPath', - copyable: true, ellipsis:true }, { @@ -429,7 +413,6 @@ export const SYSTEM_UPSTREAM_TABLE_COLUMNS: ProColumns[ { title: '服务名称', dataIndex: 'name', - copyable: true, ellipsis:true, width:160, fixed:'left', @@ -714,7 +691,6 @@ export const SYSTEM_MYSERVICE_TABLE_COLUMNS: ProColumns[ title: '服务ID', dataIndex: 'id', width: 140, - copyable: true, ellipsis:true }, { @@ -796,7 +772,6 @@ export const SYSTEM_UPSTREAM_GLOBAL_CONFIG_TABLE_COLUMNS: ProColumnsAPI, 'api',undefined,undefined,undefined,'team.service.api.view'), getItem(上游, 'upstream',undefined,undefined,undefined,'team.service.upstream.view'), @@ -936,7 +911,7 @@ const APP_MODE = import.meta.env.VITE_APP_MODE; getItem(发布, 'publish',undefined,undefined,undefined,'team.service.release.view'), ], 'group'), - getItem('提供服务', 'provideSer', null, + getItem('订阅管理', 'provideSer', null, [ getItem(订阅审批, 'approval',undefined,undefined,undefined,'team.service.subscription.view'), getItem(订阅方管理, 'subscriber',undefined,undefined,undefined,'team.service.subscription.view'), diff --git a/frontend/packages/core/src/const/system/type.ts b/frontend/packages/core/src/const/system/type.ts index 2a15aa74..3ab4f8c6 100644 --- a/frontend/packages/core/src/const/system/type.ts +++ b/frontend/packages/core/src/const/system/type.ts @@ -56,8 +56,7 @@ export type SystemSubscriberTableListItem = { }; export type SystemSubscriberConfigFieldType = { - service:string - subscriber:string + application:string applier:string }; diff --git a/frontend/packages/core/src/const/team/const.tsx b/frontend/packages/core/src/const/team/const.tsx index 294ed9e1..76d2d8f9 100644 --- a/frontend/packages/core/src/const/team/const.tsx +++ b/frontend/packages/core/src/const/team/const.tsx @@ -12,7 +12,6 @@ export const TEAM_TABLE_COLUMNS: ProColumns[] = [ { title: '名称', dataIndex: 'name', - copyable: true, ellipsis:true, width:160, fixed:'left', @@ -24,13 +23,11 @@ export const TEAM_TABLE_COLUMNS: ProColumns[] = [ title: 'ID', dataIndex: 'id', width: 140, - copyable: true, ellipsis:true }, { title: '描述', dataIndex: 'description', - copyable: true, ellipsis:true }, { @@ -67,7 +64,6 @@ export const TEAM_SYSTEM_TABLE_COLUMNS: ProColumns[] = [ { title: '服务名称', dataIndex: 'name', - copyable: true, ellipsis:true, width:160, fixed:'left', @@ -79,13 +75,11 @@ export const TEAM_SYSTEM_TABLE_COLUMNS: ProColumns[] = [ title: '服务 ID', dataIndex: 'id', width: 140, - copyable: true, ellipsis:true }, { title: '所属团队', dataIndex: ['team','name'], - copyable: true, ellipsis:true }, { @@ -128,7 +122,6 @@ export const TEAM_MEMBER_TABLE_COLUMNS: ProColumns[] = { title: '姓名', dataIndex: ['user','name'], - copyable: true, ellipsis:true, width:160, fixed:'left', @@ -139,7 +132,6 @@ export const TEAM_MEMBER_TABLE_COLUMNS: ProColumns[] = { title: '团队角色', dataIndex: 'roles', - copyable: true, ellipsis:true, }, { diff --git a/frontend/packages/core/src/const/user/const.tsx b/frontend/packages/core/src/const/user/const.tsx index 7b06d0d4..a4e87916 100644 --- a/frontend/packages/core/src/const/user/const.tsx +++ b/frontend/packages/core/src/const/user/const.tsx @@ -8,7 +8,6 @@ export const USER_LIST_COLUMNS: ProColumns[]= [ { title: '用户名', dataIndex: 'name', - copyable: true, ellipsis:true, width:160, fixed:'left', @@ -19,7 +18,6 @@ export const USER_LIST_COLUMNS: ProColumns[]= [ { title: '邮箱', dataIndex: 'email', - copyable: true, ellipsis:true, }, { diff --git a/frontend/packages/core/src/index.css b/frontend/packages/core/src/index.css index baf2543b..ee3fbd68 100644 --- a/frontend/packages/core/src/index.css +++ b/frontend/packages/core/src/index.css @@ -754,12 +754,22 @@ p{ height:10px !important; } -/* 生产环境无法获取到下列样式,先写在这里 */ +.eo_page_list .ant-pro-card{ + margin-top: -1px; + margin-bottom: -1px; +} + .eo_page_list .ant-pro-card .ant-pro-card-body{ padding:0 !important; } .eo_page_list .ant-pro-table-list-toolbar-container{ - padding:12px 20px 12px 12px !important; + /* padding:12px 20px 12px 12px !important; */ + padding-block:0px !important; + flex-direction: row-reverse; + + .ant-pro-table-list-toolbar-left{ + justify-content: flex-end !important; + } .ant-pro-table-list-toolbar-right{ flex:unset !important; @@ -1161,11 +1171,6 @@ p{ padding-bottom:60px !important; } -/* .padding-top-20 .virtuoso-grid-list{ - padding-bottom:60px !important; - padding:20px 40px 40px !important; -} */ - .ant-form-item-control-input-content{ .ant-pro-card-body{ padding-bottom: 0px !important; diff --git a/frontend/packages/core/src/pages/auditLog/AuditLog.tsx b/frontend/packages/core/src/pages/auditLog/AuditLog.tsx index 62fc17e6..4d950a01 100644 --- a/frontend/packages/core/src/pages/auditLog/AuditLog.tsx +++ b/frontend/packages/core/src/pages/auditLog/AuditLog.tsx @@ -27,7 +27,6 @@ const AUDIT_LOG_COLUMNS_CONFIG: ProColumns{ return !checkAccess(permission, accessData); }; - const openModal = (type:'addMember'|'editMember'|'removeFromDep'|'addToDep'|'blocked'|'activate'|'delete',entity?:MemberTableListItem)=>{ + const openModal = (type:'addMember'|'editMember'|'addToDep'|'delete',entity?:MemberTableListItem)=>{ let title:string = '' let content:string|React.ReactNode = '' switch (type){ @@ -244,10 +244,6 @@ const MemberList = ()=>{ title='编辑成员信息' content= break; - case 'removeFromDep': - title='移出当前部门' - content=确定将成员从当前部门中移除?此操作无法恢复,确认操作? - break; case 'addToDep': title='加入部门' content= @@ -256,14 +252,6 @@ const MemberList = ()=>{ title='删除' content=确定删除成员?此操作无法恢复,确认操作? break; - case 'blocked': - title='禁用成员' - content=确定禁用成员?此操作无法恢复,确认操作? - break; - case 'activate': - title='启用成员' - content=确定启用成员?此操作无法恢复,确认操作? - break; } modal.confirm({ @@ -274,18 +262,9 @@ const MemberList = ()=>{ case 'addMember': return AddMemberRef.current?.save().then((res)=>{if(res === true) {refreshGroup && refreshGroup();manualReloadTable()}}) case 'editMember': - //console.log('addChild') return EditMemberRef.current?.save().then((res)=>{if(res === true){refreshGroup && refreshGroup();manualReloadTable()}}) - case 'removeFromDep': - //console.log('addChild') - return handleMemberAction('removeFromDep').then((res)=>{if(res === true){refreshGroup && refreshGroup();manualReloadTable()}}) case 'addToDep': - //console.log('addToDep') return AddToDepRef.current?.save().then((res)=>{if(res === true) {refreshGroup && refreshGroup();manualReloadTable()}}) - case 'activate': - return handleMemberAction('activate').then((res)=>{if(res === true){refreshGroup && refreshGroup();manualReloadTable()}}) - case 'blocked': - return handleMemberAction('blocked').then((res)=>{if(res === true){refreshGroup && refreshGroup();manualReloadTable()}}) case 'delete': return handleMemberAction('delete').then((res)=>{if(res === true){refreshGroup && refreshGroup();manualReloadTable()}}) } @@ -400,11 +379,11 @@ const MemberList = ()=>{ onRowClick={handleRowClick} tableClickAccess="system.organization.member.edit" afterNewBtn={[ - memberGroupId &&, - memberGroupId &&, - memberGroupId !== 'disable' &&, - , - , + selectedRowKeys.length > 0 && memberGroupId &&, + selectedRowKeys.length > 0 && memberGroupId &&, + selectedRowKeys.length > 0 && memberGroupId !== 'disable' &&, + selectedRowKeys.length > 0 && , + selectedRowKeys.length > 0 &&, ]} onSearchWordChange={(e) => { setSearchWord(e.target.value) diff --git a/frontend/packages/core/src/pages/member/MemberPage.tsx b/frontend/packages/core/src/pages/member/MemberPage.tsx index fb26cd81..89a83515 100644 --- a/frontend/packages/core/src/pages/member/MemberPage.tsx +++ b/frontend/packages/core/src/pages/member/MemberPage.tsx @@ -17,6 +17,7 @@ import { checkAccess } from "@common/utils/permission.ts"; import { RenameDepModal } from "./Modal/RenameDepModal.tsx"; import { AddDepModal } from "./Modal/AddDepModal.tsx"; import { EditMemberModal } from "./Modal/EditMember.tsx"; +import InsidePage from "@common/components/aoplatform/InsidePage.tsx"; const MemberPage = ()=>{ const [searchWord, setSearchWord] = useState('') @@ -244,56 +245,41 @@ const MemberPage = ()=>{ },[memberGroupId]) return ( - -
-
-

成员

-

设置成员和对应的角色,成员只能够看到权限范围内的功能和数据。

-
- -
-
-
- debounce(onSearchWordChange, 100)(e.target.value)} - allowClear placeholder="搜索部门" - prefix={}/> -
-
-
- } - blockNode={true} - treeData={treeData} - selectedKeys={[selectedDepartmentId]} - expandedKeys={expandedKeys} - onExpand={(expandedKeys:Key[])=>{setExpandedKeys(expandedKeys)}} - onSelect={(selectedKeys,selectedRow) => { - if(selectedKeys.length > 0 ){ - setSelectedDepartmentIds((selectedRow.node as unknown).departmentIds || []) - navigate(`/member/list${selectedKeys[0] === '-1'? '' : `/${selectedKeys[0]}`}`) - } - }} - /> - {/* } + +
+
+
+ debounce(onSearchWordChange, 100)(e.target.value)} + allowClear placeholder="搜索部门" + prefix={}/> +
+
+
+ } blockNode={true} treeData={treeData} selectedKeys={[selectedDepartmentId]} expandedKeys={expandedKeys} - onExpand={(expandedKeys:string[])=>{setExpandedKeys(expandedKeys)}} + onExpand={(expandedKeys:Key[])=>{setExpandedKeys(expandedKeys)}} onSelect={(selectedKeys,selectedRow) => { + if(selectedKeys.length > 0 ){ setSelectedDepartmentIds((selectedRow.node as unknown).departmentIds || []) - navigate(`/member/list${selectedKeys[0] === '-1' ? '' : `/${selectedKeys[0]}`}`) + navigate(`/member/list${selectedKeys[0] === '-1'? '' : `/${selectedKeys[0]}`}`) + } }} - /> */} + /> +
+
+ getDepartmentList()}}/> +
-
- getDepartmentList()}}/> -
-
-
); + ); } export default MemberPage; \ No newline at end of file diff --git a/frontend/packages/core/src/pages/partitions/PartitionInsideCert.tsx b/frontend/packages/core/src/pages/partitions/PartitionInsideCert.tsx index 17693386..2b7d64a0 100644 --- a/frontend/packages/core/src/pages/partitions/PartitionInsideCert.tsx +++ b/frontend/packages/core/src/pages/partitions/PartitionInsideCert.tsx @@ -16,6 +16,7 @@ import TableBtnWithPermission from "@common/components/aoplatform/TableBtnWithPe import { useGlobalContext } from "@common/contexts/GlobalStateContext.tsx"; import { checkAccess } from "@common/utils/permission.ts"; import { PERMISSION_DEFINITION } from "@common/const/permissions.ts"; +import InsidePage from "@common/components/aoplatform/InsidePage.tsx"; const CertConfigModal = forwardRef((props, ref) => { const { message } = App.useApp() @@ -282,11 +283,11 @@ const PartitionInsideCert:FC = ()=>{ },[memberValueEnum]) return ( -
-
-

证书

-

通过为 API 服务配置和管理 SSL 证书,企业可以加密数据传输,防止敏感信息被窃取或篡改。

-
+ { onRowClick={(row:PartitionCertTableListItem)=>openModal('edit',row)} tableClickAccess="system.devops.ssl_certificate.edit" /> -
+ ) } diff --git a/frontend/packages/core/src/pages/partitions/PartitionInsideCluster.tsx b/frontend/packages/core/src/pages/partitions/PartitionInsideCluster.tsx index a41aa03d..7f90100c 100644 --- a/frontend/packages/core/src/pages/partitions/PartitionInsideCluster.tsx +++ b/frontend/packages/core/src/pages/partitions/PartitionInsideCluster.tsx @@ -9,6 +9,7 @@ import { useGlobalContext } from "@common/contexts/GlobalStateContext.tsx"; import { ClusterNodeModal } from "./PartitionInsideClusterNode.tsx"; import { DownOutlined, LoadingOutlined, UpOutlined } from "@ant-design/icons"; import { checkAccess } from "@common/utils/permission.ts"; +import InsidePage from "@common/components/aoplatform/InsidePage.tsx"; const PartitionInsideCluster:FC = ()=> { const {setBreadcrumb} = useBreadcrumb() @@ -79,37 +80,38 @@ const PartitionInsideCluster:FC = ()=> { return ( <> -
- -
-

集群

-

设置访问 API 的集群,让 API 在分布式环境中稳定运行,并且能够根据业务需求进行灵活扩展和优化。

+ +
+
+ } spinning={loading}> +
+ {nodesList && nodesList.length > 0 ? + (isActive? : )} + items={nodesList?.map(x=>{ + return { + label:
{x.status === 1 ? '正常' : '异常'}{x.managerAddress.join(',')}
, + key:x.id, + children:
+ 管理地址:{x.managerAddress.map(m=>(

{m}

))}
+ 服务地址:{x.serviceAddress.map(m=>(

{m}

))}
+ 同步地址:

{x.peerAddress}

+
+ } + })} + activeKey={activeKey} + onChange={(val)=>{setActiveKey(val as string[])}} + />: + } +
+
- -
- } spinning={loading}> -
- {nodesList && nodesList.length > 0 ? - (isActive? : )} - items={nodesList?.map(x=>{ - return { - label:
{x.status === 1 ? '正常' : '异常'}{x.managerAddress.join(',')}
, - key:x.id, - children:
- 管理地址:{x.managerAddress.map(m=>(

{m}

))}
- 服务地址:{x.serviceAddress.map(m=>(

{m}

))}
- 同步地址:

{x.peerAddress}

-
- } - })} - activeKey={activeKey} - onChange={(val)=>{setActiveKey(val as string[])}} - />: - } -
-
-
+ ) } diff --git a/frontend/packages/core/src/pages/role/RoleConfig.tsx b/frontend/packages/core/src/pages/role/RoleConfig.tsx index 21aab980..bdb595ee 100644 --- a/frontend/packages/core/src/pages/role/RoleConfig.tsx +++ b/frontend/packages/core/src/pages/role/RoleConfig.tsx @@ -152,9 +152,7 @@ const RoleConfig = ()=>{ const newPermits = generateNewPermit(data.permits) generateDependenciesMap(newPermits) setPermissionTemplate(newPermits) - console.log(newPermits) }else{ - console.log(message) message.error(msg || '获取权限模板失败') } }) diff --git a/frontend/packages/core/src/pages/role/RoleList.tsx b/frontend/packages/core/src/pages/role/RoleList.tsx index 1af89ffc..0ecde43d 100644 --- a/frontend/packages/core/src/pages/role/RoleList.tsx +++ b/frontend/packages/core/src/pages/role/RoleList.tsx @@ -12,6 +12,7 @@ import { useGlobalContext } from "@common/contexts/GlobalStateContext.tsx"; import { checkAccess } from "@common/utils/permission.ts"; import { useNavigate } from "react-router-dom"; import { RoleTableListItem } from "@core/const/role/type.ts"; +import InsidePage from "@common/components/aoplatform/InsidePage.tsx"; const RoleList = ()=>{ @@ -116,46 +117,49 @@ const RoleList = ()=>{ }, []); return (<> -
-
-

角色

-

设置角色的权限范围。

-
-

系统级别角色

- [], ...operation('system')]} - request={()=>getRoleList('system')} - addNewBtnTitle="添加角色" - showPagination={false} - onAddNewBtnClick={() => { - navigateTo(`/role/system/config`) - }} - noScroll={true} - addNewBtnAccess="system.organization.role.system.add" - onRowClick={(row:RoleTableListItem)=> navigateTo(`/role/system/config/${row.id}`)} - tableClickAccess="system.organization.role.system.edit" - /> -

团队级别角色

- [], ...operation('team')]} - request={()=>getRoleList('team')} - showPagination={false} - addNewBtnTitle="添加角色" - onAddNewBtnClick={() => { - navigateTo(`/role/team/config`) - }} - noScroll={true} - addNewBtnAccess="system.organization.role.team.add" - onRowClick={(row:RoleTableListItem)=> navigateTo(`/role/team/config/${row.id}`)} - tableClickAccess="system.organization.role.team.edit" - /> -
+ +
+

系统级别角色

+ [], ...operation('system')]} + request={()=>getRoleList('system')} + addNewBtnTitle="添加角色" + showPagination={false} + onAddNewBtnClick={() => { + navigateTo(`/role/system/config`) + }} + noScroll={true} + addNewBtnAccess="system.organization.role.system.add" + onRowClick={(row:RoleTableListItem)=> navigateTo(`/role/system/config/${row.id}`)} + tableClickAccess="system.organization.role.system.edit" + /> +

团队级别角色

+ [], ...operation('team')]} + request={()=>getRoleList('team')} + showPagination={false} + addNewBtnTitle="添加角色" + onAddNewBtnClick={() => { + navigateTo(`/role/team/config`) + }} + noScroll={true} + addNewBtnAccess="system.organization.role.team.add" + onRowClick={(row:RoleTableListItem)=> navigateTo(`/role/team/config/${row.id}`)} + tableClickAccess="system.organization.role.team.edit" + /> +
+
) } export default RoleList; \ No newline at end of file diff --git a/frontend/packages/core/src/pages/serviceCategory/ServiceCategory.tsx b/frontend/packages/core/src/pages/serviceCategory/ServiceCategory.tsx index 60449f2a..a41fdfbf 100644 --- a/frontend/packages/core/src/pages/serviceCategory/ServiceCategory.tsx +++ b/frontend/packages/core/src/pages/serviceCategory/ServiceCategory.tsx @@ -5,7 +5,7 @@ import { PERMISSION_DEFINITION } from "@common/const/permissions"; import { useFetch } from "@common/hooks/http"; import { checkAccess } from "@common/utils/permission"; import { CategorizesType, ServiceHubCategoryConfigHandle } from "@market/const/serviceHub/type"; -import { App, Button, Spin, TagType, Tree, TreeDataNode, TreeProps } from "antd"; +import { App, Button, Spin, Tree, TreeDataNode, TreeProps } from "antd"; import { DataNode } from "antd/es/tree"; import { Key, useEffect, useMemo, useRef, useState } from "react"; import { ServiceHubCategoryConfig } from "./ServiceHubCategoryConfig"; @@ -14,6 +14,8 @@ import { useBreadcrumb } from "@common/contexts/BreadcrumbContext"; import { LoadingOutlined } from "@ant-design/icons"; import { cloneDeep } from "lodash-es"; import { Icon } from "@iconify/react/dist/iconify.js"; +import InsidePage from "@common/components/aoplatform/InsidePage"; +import { EntityItem } from "@common/const/type"; export default function ServiceCategory(){ const [gData, setGData] = useState([]); @@ -227,7 +229,7 @@ export default function ServiceCategory(){ const getCategoryList = ()=>{ setLoading(true) - fetchData>('catalogues',{method:'GET'}).then(response=>{ + fetchData>('catalogues',{method:'GET'}).then(response=>{ const {code,data,msg} = response if(code === STATUS_CODE.SUCCESS){ setGData(data.catalogues) @@ -246,11 +248,11 @@ export default function ServiceCategory(){ },[]) return ( -
-
-

服务分类管理

-

设置服务可选择的分类,方便团队成员快速找到API。

-
+
} spinning={loading} className=''>
-
+ ) } \ No newline at end of file diff --git a/frontend/packages/core/src/pages/system/SystemConfig.tsx b/frontend/packages/core/src/pages/system/SystemConfig.tsx index af588182..7b660fbb 100644 --- a/frontend/packages/core/src/pages/system/SystemConfig.tsx +++ b/frontend/packages/core/src/pages/system/SystemConfig.tsx @@ -1,6 +1,6 @@ import {forwardRef, useEffect, useImperativeHandle, useState} from "react"; -import {App, Button, Divider, Form, Input, Radio, Row, Select, TagType, TreeSelect, Upload} from "antd"; +import {App, Button, Form, Input, Radio, Row, Select, TreeSelect, Upload} from "antd"; import { Link, useNavigate, useParams} from "react-router-dom"; import {RouterParams} from "@core/components/aoplatform/RenderRoutes.tsx"; import {BasicResponse, STATUS_CODE} from "@common/const/const.ts"; @@ -93,11 +93,11 @@ const SystemConfig = forwardRef((_,ref) => { const getTagAndServiceClassifyList = ()=>{ setTagOptionList([]) setServiceClassifyOptionList([]) - fetchData>('catalogues',{method:'GET'}).then(response=>{ + fetchData>('catalogues',{method:'GET'}).then(response=>{ const {code,data,msg} = response if(code === STATUS_CODE.SUCCESS){ - setTagOptionList(data.tags?.map((x:TagType)=>{return { - label:x.name, value:x.name + setTagOptionList(data.tags?.map((x:EntityItem)=>{return { + label:x.name, value:x.id }})||[]) setServiceClassifyOptionList(data.catalogues) @@ -127,19 +127,6 @@ const SystemConfig = forwardRef((_,ref) => { } ] }) - console.log({ - ...data.service, - team:data.service.team.id, - catalogue:data.service.catalogue?.id, - logoFile:[ - { - uid: '-1', // 文件唯一标识 - name: 'image.png', // 文件名 - status: 'done', // 状态有:uploading, done, error, removed - url: data.service?.logo || '', // 图片 Base64 数据 - } - ] - }) setImageBase64(data.service.logo) setShowClassify(data.service.serviceType === 'public') },0) @@ -202,7 +189,7 @@ const SystemConfig = forwardRef((_,ref) => { getSystemInfo(); setBreadcrumb([ { - title: 内部数据服务 + title: 服务 }, { title: '设置' @@ -245,7 +232,7 @@ const SystemConfig = forwardRef((_,ref) => { labelAlign='left' scrollToFirstError form={form} - className="mx-auto pb-[20px] " + className="mx-auto pb-PAGE_INSIDE_B " name="systemConfig" onFinish={onFinish} autoComplete="off" diff --git a/frontend/packages/core/src/pages/system/SystemInsidePage.tsx b/frontend/packages/core/src/pages/system/SystemInsidePage.tsx index 774d5c7e..6296ca25 100644 --- a/frontend/packages/core/src/pages/system/SystemInsidePage.tsx +++ b/frontend/packages/core/src/pages/system/SystemInsidePage.tsx @@ -76,7 +76,6 @@ const SystemInsidePage:FC = ()=> { }; useEffect(() => { - console.log(apiId, serviceId, currentUrl) if(apiId !== undefined){ setActiveMenu('api') }else if(serviceId !== currentUrl.split('/')[currentUrl.split('/').length - 1]){ @@ -84,7 +83,6 @@ const SystemInsidePage:FC = ()=> { }else{ setActiveMenu('api') } - console.log(activeMenu) }, [currentUrl]); useEffect(()=>{ @@ -119,7 +117,7 @@ const SystemInsidePage:FC = ()=> { mode="inline" items={menuData as unknown as ItemType[] } /> -
+
diff --git a/frontend/packages/core/src/pages/system/SystemInsideSubscriber.tsx b/frontend/packages/core/src/pages/system/SystemInsideSubscriber.tsx index d04123df..8496c87d 100644 --- a/frontend/packages/core/src/pages/system/SystemInsideSubscriber.tsx +++ b/frontend/packages/core/src/pages/system/SystemInsideSubscriber.tsx @@ -126,7 +126,7 @@ const SystemInsideSubscriber:FC = ()=>{ useEffect(() => { setBreadcrumb([ { - title:内部数据服务 + title:服务 }, { title:'订阅方管理' @@ -160,16 +160,17 @@ export default SystemInsideSubscriber export const SystemSubscriberConfig = forwardRef((props, ref) => { const { message } = App.useApp() - const { serviceId, teamId} = props + const { serviceId, teamId,appId} = props const [form] = Form.useForm(); const {fetchData} = useFetch() const [systemOptionList, setSystemOptionList] = useState() const [memberOptionList, setMemberOptionList] = useState() const [subscriberTeamId, setSubscriberTeamId] = useState() + const [appsList, setAppsList] = useState() const save:()=>Promise = ()=>{ return new Promise((resolve, reject)=>{ form.validateFields().then((value)=>{ - fetchData>('service/subscriber',{method:'POST',eoBody:({...value,service:serviceId}), eoParams:{service:serviceId,team:teamId}}).then(response=>{ + fetchData>('service/subscriber',{method:'POST',eoBody:({...value}), eoParams:{service:serviceId,team:teamId}}).then(response=>{ const {code,msg} = response if(code === STATUS_CODE.SUCCESS){ message.success(msg || '操作成功!') @@ -195,7 +196,7 @@ export const SystemSubscriberConfig = forwardRef(); - + setAppsList(data.apps) data.apps .filter((x:SimpleSystemItem)=>x.id !== serviceId) .forEach((item:SimpleSystemItem) => { @@ -232,10 +233,10 @@ export const SystemSubscriberConfig = forwardRef{ setMemberOptionList([]) - fetchData>('team/members/simple',{method:'GET',eoParams:{team:subscriberTeamId}}).then(response=>{ + fetchData>('team/members/simple',{method:'GET',eoParams:{team:subscriberTeamId}}).then(response=>{ const {code,data,msg} = response if(code === STATUS_CODE.SUCCESS){ - setMemberOptionList(data.members?.map((x:NewSimpleMemberItem)=>{return { + setMemberOptionList(data.teams?.map((x:NewSimpleMemberItem)=>{return { label:x.user.name, value:x.user.id }})) }else{ @@ -262,7 +263,7 @@ export const SystemSubscriberConfig = forwardRef label="订阅方" - name="subscriber" + name="application" rules={[{ required: true, message: '必填项' }]} > {setSubscriberTeamId(_)}} + onSelect={(_:unknown)=>{ setSubscriberTeamId(appsList?.filter(x=>x.id === _)?.[0]?.team.id)}} /> diff --git a/frontend/packages/core/src/pages/system/SystemList.tsx b/frontend/packages/core/src/pages/system/SystemList.tsx index 52c62fc8..edcd32be 100644 --- a/frontend/packages/core/src/pages/system/SystemList.tsx +++ b/frontend/packages/core/src/pages/system/SystemList.tsx @@ -94,7 +94,7 @@ const SystemList:FC = ()=>{ getMemberList() setBreadcrumb([ { - title: '内部数据服务' + title: '服务' }]) }, []); diff --git a/frontend/packages/core/src/pages/system/SystemTopology.tsx b/frontend/packages/core/src/pages/system/SystemTopology.tsx index 04037624..3ef00d39 100644 --- a/frontend/packages/core/src/pages/system/SystemTopology.tsx +++ b/frontend/packages/core/src/pages/system/SystemTopology.tsx @@ -109,7 +109,7 @@ export default function SystemTopology() { getNodeData() setBreadcrumb([ { - title: 内部数据服务 + title: 服务 }, { title: '调用拓扑图' diff --git a/frontend/packages/core/src/pages/system/api/SystemInsideApiList.tsx b/frontend/packages/core/src/pages/system/api/SystemInsideApiList.tsx index ef21f228..5b6ddd60 100644 --- a/frontend/packages/core/src/pages/system/api/SystemInsideApiList.tsx +++ b/frontend/packages/core/src/pages/system/api/SystemInsideApiList.tsx @@ -176,7 +176,7 @@ const SystemInsideApiList:FC = ()=>{ useEffect(() => { setBreadcrumb([ { - title:内部数据服务 + title:服务 }, { title:'API' diff --git a/frontend/packages/core/src/pages/system/approval/SystemInsideApprovalList.tsx b/frontend/packages/core/src/pages/system/approval/SystemInsideApprovalList.tsx index 17118d89..a13cb399 100644 --- a/frontend/packages/core/src/pages/system/approval/SystemInsideApprovalList.tsx +++ b/frontend/packages/core/src/pages/system/approval/SystemInsideApprovalList.tsx @@ -148,7 +148,7 @@ const SystemInsideApprovalList:FC = ()=>{ useEffect(() => { setBreadcrumb([ { - title:内部数据服务 + title:服务 }, { title:'订阅审批' diff --git a/frontend/packages/core/src/pages/system/publish/SystemInsidePublish.tsx b/frontend/packages/core/src/pages/system/publish/SystemInsidePublish.tsx index 0fc84fac..f921259e 100644 --- a/frontend/packages/core/src/pages/system/publish/SystemInsidePublish.tsx +++ b/frontend/packages/core/src/pages/system/publish/SystemInsidePublish.tsx @@ -27,7 +27,7 @@ const SystemInsidePublic:FC = ()=>{ useEffect(() => { setBreadcrumb([ { - title:内部数据服务 + title:服务 }, { title:'发布' diff --git a/frontend/packages/core/src/pages/system/publish/SystemInsidePublishList.tsx b/frontend/packages/core/src/pages/system/publish/SystemInsidePublishList.tsx index 178c47bf..021cf9c3 100644 --- a/frontend/packages/core/src/pages/system/publish/SystemInsidePublishList.tsx +++ b/frontend/packages/core/src/pages/system/publish/SystemInsidePublishList.tsx @@ -354,7 +354,7 @@ const SystemInsidePublicList:FC = ()=>{ useEffect(() => { setBreadcrumb([ { - title:内部数据服务 + title:服务 }, { title:'发布' @@ -444,7 +444,6 @@ const SystemInsidePublicList:FC = ()=>{ onChange={() => { setTableHttpReload(false) }} - besidesTableHeight={58} onRowClick={(row:PublishTableListItem|PublishVersionTableListItem)=>openDrawer('view',row)} tableClickAccess="team.service.release.view" /> diff --git a/frontend/packages/core/src/pages/system/upstream/SystemInsideUpstreamContent.tsx b/frontend/packages/core/src/pages/system/upstream/SystemInsideUpstreamContent.tsx index 958521df..dc02345f 100644 --- a/frontend/packages/core/src/pages/system/upstream/SystemInsideUpstreamContent.tsx +++ b/frontend/packages/core/src/pages/system/upstream/SystemInsideUpstreamContent.tsx @@ -20,7 +20,7 @@ const DEFAULT_FORM_VALUE = { balance:'round-robin', limitPeerSecond:10000, retry:3, - timeout:3, + timeout:10000, } const SystemInsideUpstreamContent= forwardRef((props,ref) => { @@ -107,7 +107,7 @@ const globalConfigNodesRule: FormItemProps['rules'] = [ useEffect(() => { setBreadcrumb([ { - title: 内部数据服务 + title: 服务 }, { title: '上游' diff --git a/frontend/packages/core/src/pages/team/TeamInsidePage.tsx b/frontend/packages/core/src/pages/team/TeamInsidePage.tsx index b0b9dee3..9bb8e3c4 100644 --- a/frontend/packages/core/src/pages/team/TeamInsidePage.tsx +++ b/frontend/packages/core/src/pages/team/TeamInsidePage.tsx @@ -94,7 +94,8 @@ const TeamInsidePage:FC = ()=> { tagList={[{label: 团队 ID:{teamId || '-'} }]} - backUrl="/team/list"> + backUrl="/team/list" + >
{ onClick={onMenuClick} selectedKeys={[activeMenu || '']} /> -
+
diff --git a/frontend/packages/core/src/pages/team/TeamList.tsx b/frontend/packages/core/src/pages/team/TeamList.tsx index 8ec525c4..1122623e 100644 --- a/frontend/packages/core/src/pages/team/TeamList.tsx +++ b/frontend/packages/core/src/pages/team/TeamList.tsx @@ -14,6 +14,7 @@ import TableBtnWithPermission from "@common/components/aoplatform/TableBtnWithPe import { useGlobalContext } from "@common/contexts/GlobalStateContext.tsx"; import { checkAccess } from "@common/utils/permission.ts"; import TeamConfig from "./TeamConfig.tsx"; +import InsidePage from "@common/components/aoplatform/InsidePage.tsx"; const TeamList:FC = ()=>{ const [searchWord, setSearchWord] = useState('') @@ -158,11 +159,11 @@ const TeamList:FC = ()=>{ return ( -
-
-

团队

-

设置团队和成员,然后你可以在团队内创建服务和应用、订阅API,成员只能看到所属团队内的服务和应用。

-
+ { > -
+ ) } diff --git a/frontend/packages/core/tsconfig.json b/frontend/packages/core/tsconfig.json index fc1be9b1..d5e906d2 100644 --- a/frontend/packages/core/tsconfig.json +++ b/frontend/packages/core/tsconfig.json @@ -25,6 +25,6 @@ "@market/*": ["../market/src/*"], }, }, - "include": ["src", "public/iconpark_eolink.js", "public/iconpark_apinto.js", "../common/src/component/aoplatform/EditableTableWithModal.tsx", "../common/src/components/aoplatform/TransferTable.tsx", "../common/src/components/aoplatform/TreeWithMore.tsx", "../common/src/components/aoplatform/DatePicker.tsx", "../common/src/components/aoplatform/TimeRangeSelector.tsx", "../common/src/components/aoplatform/TimePicker.tsx", "../common/src/components/aoplatform/MemberTransfer.tsx", "../common/src/components/aoplatform/Navigation.tsx", "../common/src/components/aoplatform/PageList.tsx", "../common/src/components/aoplatform/GroupTree.tsx", "../common/src/components/aoplatform/ErrorBoundary.tsx", "../common/src/components/aoplatform/ScrollableSection.tsx", "../common/src/utils/postcat.tsx", "../common/src/utils/curl.ts", "../common/src/components/aoplatform/ResetPsw.tsx", "../common/src/components/aoplatform/SubscribeApprovalModalContent.tsx", "../common/src/components/aoplatform/InsidePageForHub.tsx", "src/components/aoplatform/RenderRoutes.tsx", "../common/src/components/aoplatform/PublishApprovalModalContent.tsx", "../common/src/components/aoplatform/InsidePage.tsx", "../common/src/const/type.ts", "../common/src/components/aoplatform/intelligent-plugin", "../common/src/const/domain"], + "include": ["src", "public/iconpark_eolink.js", "public/iconpark_apinto.js", "../common/src/component/aoplatform/EditableTableWithModal.tsx", "../common/src/components/aoplatform/TransferTable.tsx", "../common/src/components/aoplatform/TreeWithMore.tsx", "../common/src/components/aoplatform/DatePicker.tsx", "../common/src/components/aoplatform/TimeRangeSelector.tsx", "../common/src/components/aoplatform/TimePicker.tsx", "../common/src/components/aoplatform/MemberTransfer.tsx", "../common/src/components/aoplatform/Navigation.tsx", "../common/src/components/aoplatform/PageList.tsx", "../common/src/components/aoplatform/GroupTree.tsx", "../common/src/components/aoplatform/ErrorBoundary.tsx", "../common/src/components/aoplatform/ScrollableSection.tsx", "../common/src/utils/postcat.tsx", "../common/src/utils/curl.ts", "../common/src/components/aoplatform/ResetPsw.tsx", "../common/src/components/aoplatform/SubscribeApprovalModalContent.tsx", "src/components/aoplatform/RenderRoutes.tsx", "../common/src/components/aoplatform/PublishApprovalModalContent.tsx", "../common/src/components/aoplatform/InsidePage.tsx", "../common/src/const/type.ts", "../common/src/components/aoplatform/intelligent-plugin", "../common/src/const/domain"], "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/frontend/packages/dashboard/src/const/const.tsx b/frontend/packages/dashboard/src/const/const.tsx index 4920a5a9..21ab14b5 100644 --- a/frontend/packages/dashboard/src/const/const.tsx +++ b/frontend/packages/dashboard/src/const/const.tsx @@ -22,7 +22,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str dataIndex: 'requestSuccess', width: 106, ellipsis:true, - copyable: true, sorter: (a,b)=> { return a.requestSuccess - b.requestSuccess }, @@ -33,7 +32,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str eoTitle:'请求成功率', dataIndex: 'requestRate', valueType:'percent', - copyable: true, ellipsis:true, sorter: (a,b)=> { return a.requestRate - b.requestRate @@ -45,7 +43,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str eoTitle:'转发总数', width: 96, dataIndex: 'proxyTotal', - copyable: true, ellipsis:true, sorter: (a,b)=> { return a.proxyTotal - b.proxyTotal @@ -57,7 +54,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str eoTitle:'转发成功数', width: 106, dataIndex: 'proxySuccess', - copyable: true, ellipsis:true, sorter: (a,b)=> { return a.proxySuccess - b.proxySuccess @@ -70,7 +66,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str width: 106, dataIndex: 'proxyRate', valueType:'percent', - copyable: true, ellipsis:true, sorter: (a,b)=> { return a.proxyRate - b.proxyRate @@ -82,7 +77,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str eoTitle:'失败状态码数', width: 120, dataIndex: 'statusFail', - copyable: true, ellipsis:true, sorter: (a,b)=> { return a.statusFail - b.statusFail @@ -95,7 +89,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str width: 148, dataIndex: 'avgResp', valueType:'digit', - copyable: true, ellipsis:true, sorter: (a,b)=> { return a.avgResp - b.avgResp @@ -108,7 +101,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str width: 148, dataIndex: 'maxResp', valueType:'digit', - copyable: true, ellipsis:true, sorter: (a,b)=> { return a.maxResp - b.maxResp @@ -121,7 +113,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str width: 148, dataIndex: 'minResp', valueType:'digit', - copyable: true, ellipsis:true, sorter: (a,b)=> { return a.minResp - b.minResp @@ -134,7 +125,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str width: 148, dataIndex: 'avgTraffic', valueType:'digit', - copyable: true, ellipsis:true, sorter: (a,b)=> { return a.avgTraffic - b.avgTraffic @@ -147,7 +137,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str width: 148, dataIndex: 'maxTraffic', valueType:'digit', - copyable: true, ellipsis:true, sorter: (a,b)=> { return a.maxTraffic - b.maxTraffic @@ -160,7 +149,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str width: 148, dataIndex: 'minTraffic', valueType:'digit', - copyable: true, ellipsis:true, sorter: (a,b)=> { return a.minTraffic - b.minTraffic @@ -176,7 +164,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str dataIndex: 'name', width:120, ellipsis:true, - copyable:true, fixed: 'left', disable:true }, @@ -185,7 +172,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str eoTitle:'请求路径', dataIndex: 'path', ellipsis:true, - copyable:true, width: 80 }, { @@ -208,7 +194,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str dataIndex: 'name', width:160, ellipsis:true, - copyable:true, fixed: 'left', disable:true }, @@ -218,7 +203,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str dataIndex: 'id', width: 140, ellipsis:true, - copyable:true, fixed: 'left' }, ...DASHBOARD_BASE_COLUMNS_CONFIG as (ProColumns&{eoTitle:string})[] @@ -232,7 +216,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str dataIndex: 'name', width:160, ellipsis:true, - copyable:true, fixed: 'left', disable:true }, @@ -242,7 +225,6 @@ export const DASHBOARD_BASE_COLUMNS_CONFIG:(ProColumns&{eoTitle:str dataIndex: 'id', width: 140, ellipsis:true, - copyable:true, fixed: 'left' }, ...DASHBOARD_BASE_COLUMNS_CONFIG as (ProColumns&{eoTitle:string})[] diff --git a/frontend/packages/market/src/const/serviceHub/const.tsx b/frontend/packages/market/src/const/serviceHub/const.tsx index fe513d47..ee3aa866 100644 --- a/frontend/packages/market/src/const/serviceHub/const.tsx +++ b/frontend/packages/market/src/const/serviceHub/const.tsx @@ -8,7 +8,6 @@ export const SERVICE_HUB_TABLE_COLUMNS: ProColumns[] = { title: '服务名称', dataIndex: 'name', - copyable: true, ellipsis:true, width:160, fixed:'left', @@ -20,7 +19,6 @@ export const SERVICE_HUB_TABLE_COLUMNS: ProColumns[] = title: '服务ID', dataIndex: 'id', width: 140, - copyable: true, ellipsis:true }, { @@ -32,19 +30,16 @@ export const SERVICE_HUB_TABLE_COLUMNS: ProColumns[] = { title: '所属系统', dataIndex: ['app','name'], - copyable: true, ellipsis:true }, { title: '所属团队', dataIndex: ['team','name'], - copyable: true, ellipsis:true }, { title: '服务分类', dataIndex: ['catalogue','name'], - copyable: true, ellipsis:true } ]; diff --git a/frontend/packages/market/src/const/serviceHub/type.ts b/frontend/packages/market/src/const/serviceHub/type.ts index 0a3295f3..758eaaea 100644 --- a/frontend/packages/market/src/const/serviceHub/type.ts +++ b/frontend/packages/market/src/const/serviceHub/type.ts @@ -49,10 +49,6 @@ export type CategorizesType = { children:CategorizesType[] } -export type TagType = { - id:string - name:string -} export type ServiceHubTableListItem = { diff --git a/frontend/packages/market/src/pages/serviceHub/ServiceHubGroup.tsx b/frontend/packages/market/src/pages/serviceHub/ServiceHubGroup.tsx index 51ef2dfa..b16e33a2 100644 --- a/frontend/packages/market/src/pages/serviceHub/ServiceHubGroup.tsx +++ b/frontend/packages/market/src/pages/serviceHub/ServiceHubGroup.tsx @@ -5,8 +5,9 @@ import {useCallback, useEffect, useState} from "react"; import Tree, {DataNode} from "antd/es/tree"; import {BasicResponse, STATUS_CODE} from "@common/const/const.ts"; import {useFetch} from "@common/hooks/http.ts"; -import { CategorizesType, TagType } from "../../const/serviceHub/type.ts"; +import { CategorizesType } from "../../const/serviceHub/type.ts"; import { filterServiceList, initialServiceHubListState, SERVICE_HUB_LIST_ACTIONS, ServiceHubListActionType } from "./ServiceHubList.tsx"; +import { EntityItem } from "@common/const/type.ts"; type ServiceHubGroup = { children:JSX.Element @@ -30,21 +31,21 @@ export const ServiceHubGroup = ({children,filterOption,dispatch}:ServiceHubGroup } const getTagAndServiceClassifyList = ()=>{ - fetchData>('catalogues',{method:'GET'}).then(response=>{ + fetchData>('catalogues',{method:'GET'}).then(response=>{ const {code,data,msg} = response if(code === STATUS_CODE.SUCCESS){ dispatch({type:SERVICE_HUB_LIST_ACTIONS.GET_CATEGORIES,payload:data.catalogues}) dispatch({type:SERVICE_HUB_LIST_ACTIONS.GET_TAGS,payload:[...data.tags,{id:'empty',name:'无标签'}]}) dispatch({type:SERVICE_HUB_LIST_ACTIONS.SET_SELECTED_CATE,payload:[...data.catalogues.map((x:CategorizesType)=>x.id)]}) - dispatch({type:SERVICE_HUB_LIST_ACTIONS.SET_SELECTED_TAG,payload:[...data.tags.map((x:TagType)=>x.id),'empty']}) + dispatch({type:SERVICE_HUB_LIST_ACTIONS.SET_SELECTED_TAG,payload:[...data.tags.map((x:EntityItem)=>x.id),'empty']}) }else{ message.error(msg || '操作失败') } }) } - const transferToTreeData = useCallback((data:CategorizesType[] | TagType[] ):TreeDataNode[]=>{ - const loop = (data: CategorizesType[] | TagType[] ): DataNode[] => + const transferToTreeData = useCallback((data:CategorizesType[] | EntityItem[] ):TreeDataNode[]=>{ + const loop = (data: CategorizesType[] | EntityItem[] ): DataNode[] => data?.map((item) => { if ((item as CategorizesType).children) { return { diff --git a/frontend/packages/market/src/pages/serviceHub/ServiceHubList.tsx b/frontend/packages/market/src/pages/serviceHub/ServiceHubList.tsx index 13ec5421..e45d66a9 100644 --- a/frontend/packages/market/src/pages/serviceHub/ServiceHubList.tsx +++ b/frontend/packages/market/src/pages/serviceHub/ServiceHubList.tsx @@ -6,11 +6,11 @@ import {useBreadcrumb} from "@common/contexts/BreadcrumbContext.tsx"; import {BasicResponse, STATUS_CODE} from "@common/const/const.ts"; import {useFetch} from "@common/hooks/http.ts"; import {RouterParams} from "@core/components/aoplatform/RenderRoutes.tsx"; -import { CategorizesType, ServiceHubTableListItem, TagType } from "../../const/serviceHub/type.ts"; +import { CategorizesType, ServiceHubTableListItem } from "../../const/serviceHub/type.ts"; import { VirtuosoGrid } from 'react-virtuoso'; import { ApiOutlined,LoadingOutlined } from "@ant-design/icons"; import ServiceHubGroup from "./ServiceHubGroup.tsx"; -import { unset } from "lodash-es"; +import { EntityItem } from "@common/const/type.ts"; export enum SERVICE_HUB_LIST_ACTIONS { GET_CATEGORIES = 'GET_CATEGORIES', @@ -26,7 +26,7 @@ export enum SERVICE_HUB_LIST_ACTIONS { export type ServiceHubListActionType = | { type: SERVICE_HUB_LIST_ACTIONS.GET_CATEGORIES, payload: CategorizesType[] } -| { type: SERVICE_HUB_LIST_ACTIONS.GET_TAGS, payload: TagType[] } +| { type: SERVICE_HUB_LIST_ACTIONS.GET_TAGS, payload: EntityItem[] } | { type: SERVICE_HUB_LIST_ACTIONS.GET_SERVICES, payload: ServiceHubTableListItem[] } | { type: SERVICE_HUB_LIST_ACTIONS.SET_SERVICES, payload: ServiceHubTableListItem[] } | { type: SERVICE_HUB_LIST_ACTIONS.SET_SELECTED_CATE, payload: string[] } @@ -37,7 +37,7 @@ export type ServiceHubListActionType = export const initialServiceHubListState = { categoriesList: [] as CategorizesType[], - tagsList: [] as TagType[], + tagsList: [] as EntityItem[], servicesList: [] as ServiceHubTableListItem[], showServicesList: [] as ServiceHubTableListItem[], selectedCate: [] as string[], diff --git a/frontend/packages/systemRunning/src/pages/SystemRunningInstruction.tsx b/frontend/packages/systemRunning/src/pages/SystemRunningInstruction.tsx index 4eb94599..9c72500a 100644 --- a/frontend/packages/systemRunning/src/pages/SystemRunningInstruction.tsx +++ b/frontend/packages/systemRunning/src/pages/SystemRunningInstruction.tsx @@ -19,9 +19,9 @@ export default function SystemRunningInstruction() {

*/}
-

内部数据服务设置

+

服务设置

支持根据权限,拆分人员对 API 添加 、上游设置、鉴权设置等信息发布及管理;同时支持管理 API 调用服务(包含第三方调用)及订阅;

-

添加内部数据服务信息

+

添加服务信息

diff --git a/go.mod b/go.mod index bb62573b..6e7e69c7 100644 --- a/go.mod +++ b/go.mod @@ -66,4 +66,7 @@ require ( gorm.io/driver/mysql v1.5.2 // indirect ) -//replace github.com/eolinker/ap-account => ../../eolinker/ap-account +//replace ( +// github.com/eolinker/ap-account => ../../eolinker/ap-account +// github.com/eolinker/go-common => ../../eolinker/go-common +//) diff --git a/middleware/permit/identity/identity.go b/middleware/permit/identity/identity.go index ab11078d..3922c6eb 100644 --- a/middleware/permit/identity/identity.go +++ b/middleware/permit/identity/identity.go @@ -5,9 +5,8 @@ import ( ) const ( - SystemGroup = "system" - TeamGroup = "team" - ProjectGroup = "project" + SystemGroup = "system" + TeamGroup = "team" ) type IdentityTeamService interface { diff --git a/middleware/permit/permit.go b/middleware/permit/permit.go index a82574e9..41880740 100644 --- a/middleware/permit/permit.go +++ b/middleware/permit/permit.go @@ -51,6 +51,7 @@ func (p *PermitMiddleware) Check(method string, path string) (bool, []gin.Handle func(ginCtx *gin.Context) { userId := utils.UserId(ginCtx) if userId == "" { + // 未开启游客模式 ginCtx.AbortWithStatusJSON(http.StatusForbidden, gin.H{"code": http.StatusForbidden, "msg": "not login", "success": "fail"}) ginCtx.Abort() return @@ -67,6 +68,7 @@ func (p *PermitMiddleware) Check(method string, path string) (bool, []gin.Handle // 当前分组没有配置权限 continue } + domainHandler, has := permit.SelectDomain(group) if !has { // 当前分组没有配置身份handler diff --git a/resources/access/access.yaml b/resources/access/access.yaml index fbed5b8b..2d340289 100644 --- a/resources/access/access.yaml +++ b/resources/access/access.yaml @@ -10,6 +10,7 @@ system: - name: view cname: '查看' value: 'view' + guest_allow: true apis: - "GET:/api/v1/user/accounts" - "GET:/api/v1/user/departments" @@ -38,6 +39,7 @@ system: - name: view cname: '查看' value: 'view' + guest_allow: true apis: - "GET:/api/v1/manager/teams" - "GET:/api/v1/manager/team" @@ -56,12 +58,14 @@ system: children: - name: view system role cname: '查看系统角色' + guest_allow: true value: 'view_system_role' apis: - "GET:/api/v1/system/roles" - "GET:/api/v1/system/role" - name: view team role cname: '查看团队角色' + guest_allow: true value: 'view_team_role' apis: - "GET:/api/v1/team/roles" @@ -77,6 +81,7 @@ system: - name: view cname: '查看' value: 'view' + guest_allow: true # apis: # - "GET:/api/v1/catalogues" - name: manager @@ -100,6 +105,7 @@ system: - name: view cname: 查看 value: 'view' + guest_allow: true apis: - "GET:/api/v1/cluster/nodes" - name: manager @@ -115,6 +121,7 @@ system: - name: view cname: 查看 value: 'view' + guest_allow: true apis: - "GET:/api/v1/certificates" - "GET:/api/v1/certificate" @@ -133,6 +140,7 @@ system: - name: view cname: 查看 value: 'view' + guest_allow: true apis: - "GET:/api/v1/dynamic/{name}/info" - "GET:/api/v1/dynamic/{name}/list" @@ -157,6 +165,7 @@ system: - name: view all cname: 查看所有应用 value: 'view_all' + guest_allow: true apis: - "GET:/api/v1/apps" - name: service @@ -166,6 +175,7 @@ system: - name: view all cname: 查看所有服务 value: 'view_all' + guest_allow: true apis: - "GET:/api/v1/services" - name: team @@ -175,6 +185,7 @@ system: - name: view all cname: 查看所有团队 value: 'view_all' + guest_allow: true apis: - "GET:/api/v1/manager/teams" - name: api market @@ -184,6 +195,7 @@ system: - name: view cname: 查看 value: 'view' + guest_allow: true apis: - "GET:/api/v1/catalogue/services" - "GET:/api/v1/catalogue/service" @@ -199,6 +211,7 @@ team: - name: view cname: 查看 value: 'view' + guest_allow: true apis: - "GET:/api/v1/service/apis" - "GET:/api/v1/service/api/detail" @@ -220,6 +233,7 @@ team: - name: view cname: 查看 value: 'view' + guest_allow: true apis: - "GET:/api/v1/service/upstream" - name: manager @@ -234,6 +248,7 @@ team: - name: view cname: 查看 value: 'view' + guest_allow: true apis: - "GET:/api/v1/service/releases" - "GET:/api/v1/service/release" @@ -255,6 +270,7 @@ team: - name: view cname: 查看 value: 'view' + guest_allow: true apis: - "GET:/api/v1/service/approval/subscribes" - "GET:/api/v1/service/approval/subscribe" @@ -289,6 +305,7 @@ team: - name: view cname: 查看 value: 'view' + guest_allow: true apis: - "GET:/api/v1/application/subscriptions" - name: manager @@ -305,6 +322,7 @@ team: - name: view cname: 查看 value: 'view' + guest_allow: true apis: - "GET:/api/v1/app/authorization" - "GET:/api/v1/app/authorizations" @@ -339,6 +357,7 @@ team: - name: view cname: 查看 value: 'view' + guest_allow: true apis: - "GET:/api/v1/team/members" - "GET:/api/v1/team/members/toadd" @@ -356,6 +375,7 @@ team: - name: view cname: '查看' value: 'view' + guest_allow: true apis: - "GET:/api/v1/manager/teams" - "GET:/api/v1/manager/team" diff --git a/resources/access/role.yaml b/resources/access/role.yaml index 05d8898d..f4e7233d 100644 --- a/resources/access/role.yaml +++ b/resources/access/role.yaml @@ -51,6 +51,21 @@ system: permits: - system.workspace.api_market.view default: true + - name: guest + cname: 只读成员 + permits: + - system.api_market.service_classification.view + - system.devops.cluster.view + - system.devops.log_configuration.view + - system.devops.ssl_certificate.view + - system.organization.member.view + - system.organization.role.view_system_role + - system.organization.role.view_team_role + - system.organization.team.view + - system.workspace.api_market.view + - system.workspace.application.view_all + - system.workspace.service.view_all + - system.workspace.team.view_all team: - name: team_admin cname: 团队管理员 @@ -113,4 +128,15 @@ team: - team.application.subscription.manager - team.application.subscription.view - team.team.member.view - default: true \ No newline at end of file + default: true + - name: guest + cname: 只读成员 + permits: + - team.application.authorization.view + - team.application.subscription.view + - team.service.api.view + - team.service.release.view + - team.service.subscription.view + - team.service.upstream.view + - team.team.member.view + - team.team.team.view \ No newline at end of file