feat: pass model_type (vendor_id) from model detail to playground settings panel

This commit is contained in:
xiezhouwei 2026-06-19 10:30:32 +08:00
parent 977e9e8bf5
commit 2165430d87
2 changed files with 12 additions and 2 deletions

View File

@ -70,8 +70,14 @@ const ModelDetailSideSheet = ({
const handleExperience = () => {
const modelName = modelData?.model_name;
const vendorId = modelData?.vendor_id;
if (modelName) {
navigate(`/console/playground?model=${encodeURIComponent(modelName)}`);
const params = new URLSearchParams();
params.set('model', modelName);
if (vendorId != null && vendorId !== 0) {
params.set('model_type', vendorId);
}
navigate(`/console/playground?${params.toString()}`);
}
};

View File

@ -589,10 +589,14 @@ const Playground = () => {
Toast.warning(t('登录过期,请重新登录!'));
}
const modelParam = searchParams.get('model');
const modelTypeParam = searchParams.get('model_type');
if (modelTypeParam) {
handleInputChange('model_type', modelTypeParam);
}
if (modelParam) {
handleInputChange('model', modelParam);
}
}, [searchParams, t]);
}, [searchParams, t, handleInputChange]);
// Playground isMobile useIsMobile Hook