MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / addCustomModels

Function addCustomModels

web/src/pages/Channel/EditTagModal.js:243–277  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

241 }, [inputs]);
242
243 const addCustomModels = () => {
244 if (customModel.trim() === '') return;
245 const modelArray = customModel.split(',').map((model) => model.trim());
246
247 let localModels = [...inputs.models];
248 let localModelOptions = [...modelOptions];
249 const addedModels = [];
250
251 modelArray.forEach((model) => {
252 if (model && !localModels.includes(model)) {
253 localModels.push(model);
254 localModelOptions.push({
255 key: model,
256 text: model,
257 value: model,
258 });
259 addedModels.push(model);
260 }
261 });
262
263 setModelOptions(localModelOptions);
264 setCustomModel('');
265 handleInputChange('models', localModels);
266
267 if (addedModels.length > 0) {
268 showSuccess(
269 t('已新增 {{count}} 个模型:{{list}}', {
270 count: addedModels.length,
271 list: addedModels.join(', '),
272 })
273 );
274 } else {
275 showInfo(t('未发现新增模型'));
276 }
277 };
278
279 return (
280 <SideSheet

Callers

nothing calls this directly

Calls 4

showSuccessFunction · 0.90
showInfoFunction · 0.90
handleInputChangeFunction · 0.70
tFunction · 0.50

Tested by

no test coverage detected