diff --git a/src/global.less b/src/global.less index 4a502045..9f8decac 100644 --- a/src/global.less +++ b/src/global.less @@ -708,6 +708,10 @@ body { .ant-pro-page-container { background: transparent; + + .ant-page-header-heading { + min-width: max-content; + } } @keyframes skeleton-loading { diff --git a/src/pages/dashboard/components/active-table.tsx b/src/pages/dashboard/components/active-table.tsx index 67d7c69c..3d63de4b 100644 --- a/src/pages/dashboard/components/active-table.tsx +++ b/src/pages/dashboard/components/active-table.tsx @@ -1,3 +1,4 @@ +import AutoTooltip from '@/components/auto-tooltip'; import PageTools from '@/components/page-tools'; import { convertFileSize } from '@/utils'; import { useIntl } from '@umijs/max'; @@ -12,18 +13,27 @@ const ActiveTable = () => { { title: intl.formatMessage({ id: 'common.table.name' }), dataIndex: 'name', - key: 'name' + key: 'name', + ellipsis: true, + render: (text: any, record: any) => { + return ( + + {text} + + ); + } }, { title: intl.formatMessage({ id: 'dashboard.allocatevram' }), dataIndex: 'resource_claim.memory', key: 'vram', + ellipsis: true, render: (text: any, record: any) => { return ( - + {convertFileSize(record.resource_claim?.vram || 0)} /{' '} {convertFileSize(record.resource_claim?.ram || 0)} - + ); } }, @@ -35,7 +45,15 @@ const ActiveTable = () => { { title: intl.formatMessage({ id: 'dashboard.tokens' }), dataIndex: 'token_count', - key: 'token_count' + key: 'token_count', + ellipsis: true, + render: (text: any, record: any) => { + return ( + + {text} + + ); + } } ]; return ( diff --git a/src/pages/playground/components/ground-left.tsx b/src/pages/playground/components/ground-left.tsx index 6da09c16..02513fd0 100644 --- a/src/pages/playground/components/ground-left.tsx +++ b/src/pages/playground/components/ground-left.tsx @@ -62,7 +62,8 @@ const GroundLeft: React.FC = forwardRef((props, ref) => { }, setCollapse() { setCollapse(!collapse); - } + }, + collapse: collapse }; }); diff --git a/src/pages/playground/components/multiple-chat/index.tsx b/src/pages/playground/components/multiple-chat/index.tsx index 8de3c1f2..a900f923 100644 --- a/src/pages/playground/components/multiple-chat/index.tsx +++ b/src/pages/playground/components/multiple-chat/index.tsx @@ -29,7 +29,6 @@ const MultiCompare: React.FC = ({ modelList, loaded }) => { stop: null, temperature: 1, top_p: 1, - top_n: 0, max_tokens: 1024 }); const [spans, setSpans] = useState<{ diff --git a/src/pages/playground/index.tsx b/src/pages/playground/index.tsx index 7f925efe..4834ebcf 100644 --- a/src/pages/playground/index.tsx +++ b/src/pages/playground/index.tsx @@ -1,5 +1,7 @@ import IconFont from '@/components/icon-font'; +import breakpoints from '@/config/breakpoints'; import HotKeys from '@/config/hotkeys'; +import useWindowResize from '@/hooks/use-window-resize'; import { MessageOutlined, OneToOneOutlined } from '@ant-design/icons'; import { PageContainer } from '@ant-design/pro-components'; import { useIntl } from '@umijs/max'; @@ -16,6 +18,7 @@ import './style/play-ground.less'; const Playground: React.FC = () => { const intl = useIntl(); + const { size } = useWindowResize(); const [activeKey, setActiveKey] = useState('chat'); const groundLeftRef = useRef(null); const groundRerankerRef = useRef(null); @@ -80,6 +83,14 @@ const Playground: React.FC = () => { } ]; + useEffect(() => { + if (size.width < breakpoints.lg) { + if (!groundLeftRef.current?.collapse) { + groundLeftRef.current?.setCollapse?.(); + } + } + }, [size.width]); + useEffect(() => { const getModelList = async () => { try {