Skip to content

Commit cef548c

Browse files
authored
Merge pull request #299 from APIParkLab/feature/1.8-cx
Feature/1.8 cx
2 parents a227591 + a0f4ef4 commit cef548c

File tree

83 files changed

+4524
-768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+4524
-768
lines changed

frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
"vite-tsconfig-paths": "^4.3.2",
5151
"react-json-view": "^1.21.3",
5252
"zod": "^3.23.8",
53-
"@modelcontextprotocol/sdk": "^1.9.0"
53+
"@modelcontextprotocol/sdk": "^1.9.0",
54+
"echarts-for-react": "^3.0.2"
5455
},
5556
"devDependencies": {
5657
"@ant-design/cssinjs": "^1.18.2",

frontend/packages/common/src/components/aoplatform/BasicLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function BasicLayout({ project = 'core' }: { project: string }) {
3636
const { state, accessData, checkPermission, accessInit, dispatch, resetAccess, getGlobalAccessData, menuList } =
3737
useGlobalContext()
3838
const [pathname, setPathname] = useState(currentUrl)
39-
const mainPage = project === 'core' ? '/service/list' : '/serviceHub/list'
39+
const mainPage = project === 'core' ? '/service/list' : '/portal/list'
4040
const [menuItems, setMenuItems] = useState<MenuProps['items']>()
4141
const pluginSlotHub = usePluginSlotHub()
4242

frontend/packages/common/src/components/aoplatform/InsidePage.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class InsidePageProps {
2626
scrollInsidePage?: boolean = false
2727
customPadding?: boolean
2828
customBtn?: ReactNode
29+
customBanner?: ReactNode
2930
}
3031

3132
const InsidePage: FC<InsidePageProps> = ({
@@ -46,7 +47,8 @@ const InsidePage: FC<InsidePageProps> = ({
4647
scrollPage = true,
4748
scrollInsidePage = false,
4849
customPadding = false,
49-
customBtn
50+
customBtn,
51+
customBanner
5052
}) => {
5153
const navigate = useNavigate()
5254

@@ -61,8 +63,13 @@ const InsidePage: FC<InsidePageProps> = ({
6163
<div
6264
className={`border-[0px] mr-PAGE_INSIDE_X ${showBorder ? 'border-solid border-b-[1px] border-BORDER' : ''} ${headerClassName}`}
6365
>
64-
{!pageTitle && !description && !backUrl && !customBtn ? (
66+
{!pageTitle && !description && !backUrl && !customBtn && !customBanner ? (
6567
<></>
68+
) : customBanner ? (
69+
<div className={customPadding ? '' : 'mb-[15px]'}>
70+
{backUrl && <TopBreadcrumb handleBackCallback={() => goBack()} />}
71+
{customBanner}
72+
</div>
6673
) : (
6774
<div className={customPadding ? '' : 'mb-[30px]'}>
6875
{backUrl && <TopBreadcrumb handleBackCallback={() => goBack()} />}

frontend/packages/common/src/components/aoplatform/PageList.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ interface PageListProps<T> extends ProTableProps<T, unknown>, RefAttributes<Acti
5858
delayLoading?: boolean
5959
noScroll?: boolean
6060
/* 前端分页的表格,需要传入该字段以支持后端搜索 */
61-
manualReloadTable?: () => void,
61+
manualReloadTable?: () => void
6262
customEmptyRender?: () => React.ReactNode
6363
}
6464

@@ -109,6 +109,7 @@ const PageList = <T extends Record<string, unknown>>(
109109
const [allowTableClick, setAllowTableClick] = useState<boolean>(false)
110110
const { accessData, checkPermission, accessInit, state } = useGlobalContext()
111111
const [minTableWidth, setMinTableWidth] = useState<number>(0)
112+
const [enableVirtual, setEnableVirtual] = useState(false)
112113

113114
useImperativeHandle(ref, () => actionRef.current!)
114115

@@ -301,7 +302,7 @@ const PageList = <T extends Record<string, unknown>>(
301302
<ProTable<T>
302303
actionRef={actionRef}
303304
columns={newColumns}
304-
virtual
305+
virtual={enableVirtual}
305306
scroll={noScroll ? undefined : { x: tableWidth, y: tableHeight }}
306307
size="middle"
307308
rowSelection={rowSelection}
@@ -328,6 +329,10 @@ const PageList = <T extends Record<string, unknown>>(
328329
}
329330
: false
330331
}}
332+
postData={(data: any) => {
333+
setEnableVirtual(!!data?.length)
334+
return data
335+
}}
331336
showSorterTooltip={false}
332337
columnsState={{ persistenceType: 'localStorage', persistenceKey: id }}
333338
pagination={

frontend/packages/common/src/components/aoplatform/TimeRangeSelector.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type TimeRangeSelectorProps = {
2727
bindRef?: any
2828
hideBtns?: TimeRangeButton[]
2929
defaultTimeButton?: TimeRangeButton
30+
customClassNames?: string
3031
}
3132
const TimeRangeSelector = (props: TimeRangeSelectorProps) => {
3233
const {
@@ -38,7 +39,8 @@ const TimeRangeSelector = (props: TimeRangeSelectorProps) => {
3839
labelSize = 'default',
3940
bindRef,
4041
hideBtns = [],
41-
defaultTimeButton = 'hour'
42+
defaultTimeButton = 'hour',
43+
customClassNames = 'pt-btnybase'
4244
} = props
4345
const [timeButton, setTimeButton] = useState(initialTimeButton || '')
4446
const [datePickerValue, setDatePickerValue] = useState<RangeValue>(initialDatePickerValue || [null, null])
@@ -110,8 +112,12 @@ const TimeRangeSelector = (props: TimeRangeSelectorProps) => {
110112
return current && current.valueOf() > dayjs().startOf('day').valueOf()
111113
}
112114

115+
useEffect(() => {
116+
setTimeButton(initialTimeButton || '')
117+
}, [initialTimeButton])
118+
113119
return (
114-
<div className="flex flex-nowrap items-center pt-btnybase mr-btnybase">
120+
<div className={`flex flex-nowrap items-center ${customClassNames} mr-btnybase`}>
115121
{!hideTitle && <label className={`whitespace-nowrap `}>{$t('时间')}</label>}
116122
<Radio.Group className="whitespace-nowrap" value={timeButton} onChange={handleRadioChange} buttonStyle="solid">
117123
{hideBtns?.length && hideBtns.includes('hour') ? null : (

frontend/packages/common/src/components/aoplatform/UnUsedWordForTranslate.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ export const TranslateWord = () => {
187187
{$t('调用地址')}
188188
{$t('消费者 IP')}
189189
{$t('鉴权名称')}
190+
{$t('日志输出')}
191+
{$t('响应时间')}
192+
{$t('时间戳')}
190193
</>
191194
)
192195
}

0 commit comments

Comments
 (0)