diff --git a/web/src/components/ChannelsTable.js b/web/src/components/ChannelsTable.js index 71914c4e..94cd6ba8 100644 --- a/web/src/components/ChannelsTable.js +++ b/web/src/components/ChannelsTable.js @@ -15,7 +15,7 @@ import { getQuotaPerUnit, renderGroup, renderNumberWithPoint, - renderQuota, renderQuotaWithPrompt + renderQuota, renderQuotaWithPrompt, stringToColor } from '../helpers/render'; import { Button, Divider, @@ -378,17 +378,15 @@ const ChannelsTable = () => { > {t('测试')} - - - + { const [enableTagMode, setEnableTagMode] = useState(false); const [showBatchSetTag, setShowBatchSetTag] = useState(false); const [batchSetTagValue, setBatchSetTagValue] = useState(''); + const [showModelTestModal, setShowModelTestModal] = useState(false); + const [currentTestChannel, setCurrentTestChannel] = useState(null); + const [modelSearchKeyword, setModelSearchKeyword] = useState(''); const removeRecord = (record) => { @@ -1289,6 +1290,77 @@ const ChannelsTable = () => { onChange={(v) => setBatchSetTagValue(v)} /> + + {/* 模型测试弹窗 */} + { + setShowModelTestModal(false); + setModelSearchKeyword(''); + }} + footer={null} + maskClosable={true} + centered={true} + width={600} + > +
+ {currentTestChannel && ( +
+ + {t('渠道')}: {currentTestChannel.name} + + + {/* 搜索框 */} + setModelSearchKeyword(value)} + style={{ marginBottom: '16px' }} + showClear + /> + +
+ {currentTestChannel.models.split(',') + .filter(model => model.toLowerCase().includes(modelSearchKeyword.toLowerCase())) + .map((model, index) => { + + return ( + + ); + })} +
+ + {/* 显示搜索结果数量 */} + {modelSearchKeyword && ( + + {t('找到')} {currentTestChannel.models.split(',').filter(model => + model.toLowerCase().includes(modelSearchKeyword.toLowerCase()) + ).length} {t('个模型')} + + )} +
+ )} +
+
); };