diff --git a/web/src/components/common/ui/CardPro.js b/web/src/components/common/ui/CardPro.js index 2c8f7d30..fc57cd53 100644 --- a/web/src/components/common/ui/CardPro.js +++ b/web/src/components/common/ui/CardPro.js @@ -139,7 +139,6 @@ const CardPro = ({ )} - ); }; diff --git a/web/src/components/layout/SiderBar.js b/web/src/components/layout/SiderBar.js index 714e556e..c7f7df31 100644 --- a/web/src/components/layout/SiderBar.js +++ b/web/src/components/layout/SiderBar.js @@ -440,7 +440,7 @@ const SiderBar = ({ onNavigate = () => { } }) => { /> } onClick={toggleCollapsed} - iconOnly={collapsed} + icononly={collapsed} style={collapsed ? { padding: '4px', width: '100%' } : { padding: '4px 12px', width: '100%' }} > {!collapsed ? t('收起侧边栏') : null} diff --git a/web/src/components/table/channels/modals/ModelTestModal.jsx b/web/src/components/table/channels/modals/ModelTestModal.jsx index b59e9ab6..1d159473 100644 --- a/web/src/components/table/channels/modals/ModelTestModal.jsx +++ b/web/src/components/table/channels/modals/ModelTestModal.jsx @@ -49,15 +49,15 @@ const ModelTestModal = ({ isMobile, t }) => { - if (!showModelTestModal || !currentTestChannel) { - return null; - } + const hasChannel = Boolean(currentTestChannel); - const filteredModels = currentTestChannel.models - .split(',') - .filter((model) => - model.toLowerCase().includes(modelSearchKeyword.toLowerCase()) - ); + const filteredModels = hasChannel + ? currentTestChannel.models + .split(',') + .filter((model) => + model.toLowerCase().includes(modelSearchKeyword.toLowerCase()) + ) + : []; const handleCopySelected = () => { if (selectedModelKeys.length === 0) { @@ -158,6 +158,7 @@ const ModelTestModal = ({ ]; const dataSource = (() => { + if (!hasChannel) return []; const start = (modelTablePage - 1) * MODEL_TABLE_PAGE_SIZE; const end = start + MODEL_TABLE_PAGE_SIZE; return filteredModels.slice(start, end).map((model) => ({ @@ -168,7 +169,7 @@ const ModelTestModal = ({ return (
@@ -179,10 +180,10 @@ const ModelTestModal = ({
- } + ) : null} visible={showModelTestModal} onCancel={handleCloseModal} - footer={ + footer={hasChannel ? (
{isBatchTesting ? (
- } + ) : null} maskClosable={!isBatchTesting} className="!rounded-lg" size={isMobile ? 'full-width' : 'large'} > -
+ {hasChannel && (
{/* 搜索与操作按钮 */}
setModelTablePage(page), }} /> -
+
)} ); };