fix(web): height calculate

This commit is contained in:
zhaoying
2026-03-27 12:02:50 +08:00
parent 9ae1d2f0d9
commit 6f7fee18c9
64 changed files with 545 additions and 569 deletions

View File

@@ -3,7 +3,6 @@ import {
Row,
Col,
App,
List,
Space,
Flex,
Tooltip,
@@ -69,11 +68,12 @@ const Custom = forwardRef<CustomRef, { getStatusTag: (status: string) => ReactNo
return (
<>
<BodyWrapper loading={loading} empty={data.length === 0}>
<List
grid={{ gutter: 16, column: 3 }}
dataSource={data}
renderItem={(item) => (
<List.Item key={item.id}>
<Row
gutter={[16, 16]}
className="rb:max-h-[calc(100%-48px)] rb:overflow-y-auto"
>
{data.map((item) => (
<Col span={8} key={item.id}>
<RbCard
title={
<Flex justify="space-between" gap={16}>
@@ -109,7 +109,6 @@ const Custom = forwardRef<CustomRef, { getStatusTag: (status: string) => ReactNo
}
isNeedTooltip={false}
>
{item.tags?.length > 0
? <Flex gap={8} wrap align="center">
<Flex gap={6}>
@@ -142,10 +141,9 @@ const Custom = forwardRef<CustomRef, { getStatusTag: (status: string) => ReactNo
</Col>
</Row>
</RbCard>
</List.Item>
)}
className="rb:h-[calc(100vh-178px)] rb:overflow-y-auto rb:overflow-x-hidden"
/>
</Col>
))}
</Row>
</BodyWrapper>
{/* 添加服务弹窗组件 */}

View File

@@ -1,6 +1,5 @@
import React, { useState, useRef, useEffect, type ReactNode } from 'react';
import {
List,
Flex,
Space,
Tooltip,
@@ -68,13 +67,14 @@ const Inner: React.FC<{ getStatusTag: (status: string) => ReactNode; keyword?: s
}
return (
<div>
<>
<BodyWrapper loading={loading} empty={data.length === 0}>
<List
grid={{ gutter: 16, column: 3 }}
dataSource={data}
renderItem={(item) => (
<List.Item key={item.id} className='rb:h-full!'>
<Row
gutter={[12, 12]}
className="rb:max-h-[calc(100%-48px)] rb:overflow-y-auto"
>
{data.map((item) => (
<Col span={8} key={item.id}>
<RbCard
title={
<Flex justify="space-between" gap={16}>
@@ -130,21 +130,20 @@ const Inner: React.FC<{ getStatusTag: (status: string) => ReactNode; keyword?: s
</Col>
</>
: item.config_data.tool_class === 'JsonTool'
? <Col span={24}>
? <Col span={24}>
<div className="rb:text-[#5B6167] rb:mb-1">{t('tool.jsonEg')}</div>
{InnerConfigData[item.config_data.tool_class].eg}
</Col>
: <Col span={24}>
<div className="rb:text-[#5B6167] rb:mb-1">{t('configStatus')}</div>
{t(`tool.${item.status}_desc`)}
</Col>
: <Col span={24}>
<div className="rb:text-[#5B6167] rb:mb-1">{t('configStatus')}</div>
{t(`tool.${item.status}_desc`)}
</Col>
}
</Row>
</RbCard>
</List.Item>
)}
className="rb:h-[calc(100vh-178px)] rb:overflow-y-auto rb:overflow-x-hidden"
/>
</Col>
))}
</Row>
</BodyWrapper>
<TimeToolModal
@@ -157,7 +156,7 @@ const Inner: React.FC<{ getStatusTag: (status: string) => ReactNode; keyword?: s
ref={innerToolModalRef}
refreshTable={getData}
/>
</div>
</>
);
};

View File

@@ -434,7 +434,7 @@ const Market: React.FC<{ getStatusTag?: (status: string) => ReactNode }> = () =>
footer={<Flex justify="space-between" align="center" className="rb:text-[#5B6167] rb:text-[12px] rb:mb-1!">
{mcp.publisher && <span>{mcp.publisher.startsWith('@') ? mcp.publisher : `@${mcp.publisher}`}</span>}
{mcp.view_count && <Space size={4}>
<div className="rb:size-4 rb:bg-cover rb:bg-[url('src/assets/images/common/global_outline.svg')]"></div>
<div className="rb:size-4 rb:bg-cover rb:bg-[url('@/assets/images/common/global_outline.svg')]"></div>
{mcp.view_count.toLocaleString()}
</Space>}
</Flex>}

View File

@@ -1,11 +1,11 @@
import { useState, useRef, useEffect, forwardRef, useImperativeHandle, type ReactNode } from 'react';
import {
App,
List,
Space,
Tooltip,
Dropdown,
Flex,
Row, Col,
} from 'antd';
import { useTranslation } from 'react-i18next';
@@ -84,11 +84,12 @@ const Mcp = forwardRef<McpRef, { getStatusTag: (status: string) => ReactNode; ke
return (
<>
<BodyWrapper loading={loading} empty={data?.length === 0}>
<List
grid={{ gutter: 16, column: 3 }}
dataSource={data}
renderItem={(item) => (
<List.Item key={item.id}>
<Row
gutter={[16, 16]}
className="rb:max-h-[calc(100%-48px)] rb:overflow-y-auto"
>
{data.map((item) => (
<Col span={8} key={item.id}>
<RbCard
title={
<Flex justify="space-between" gap={16}>
@@ -137,12 +138,12 @@ const Mcp = forwardRef<McpRef, { getStatusTag: (status: string) => ReactNode; ke
</div>
</Flex>
<div className="rb:text-[#5B6167] rb:leading-4.5 rb:text-[12px] rb:mt-4">{t('tool.last_health_check')}: {formatDateTime(item.config_data?.last_health_check)}</div>
</RbCard>
</List.Item>
)}
className="rb:h-[calc(100vh-124px)] rb:overflow-y-auto rb:overflow-x-hidden"
/>
</Col>
))}
<Col span={8}></Col>
</Row>
</BodyWrapper>
{/* 添加服务弹窗组件 */}