feat: pass model_type (vendor_id) from model detail to playground settings panel
This commit is contained in:
parent
977e9e8bf5
commit
2165430d87
|
|
@ -70,8 +70,14 @@ const ModelDetailSideSheet = ({
|
||||||
|
|
||||||
const handleExperience = () => {
|
const handleExperience = () => {
|
||||||
const modelName = modelData?.model_name;
|
const modelName = modelData?.model_name;
|
||||||
|
const vendorId = modelData?.vendor_id;
|
||||||
if (modelName) {
|
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()}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -589,10 +589,14 @@ const Playground = () => {
|
||||||
Toast.warning(t('登录过期,请重新登录!'));
|
Toast.warning(t('登录过期,请重新登录!'));
|
||||||
}
|
}
|
||||||
const modelParam = searchParams.get('model');
|
const modelParam = searchParams.get('model');
|
||||||
|
const modelTypeParam = searchParams.get('model_type');
|
||||||
|
if (modelTypeParam) {
|
||||||
|
handleInputChange('model_type', modelTypeParam);
|
||||||
|
}
|
||||||
if (modelParam) {
|
if (modelParam) {
|
||||||
handleInputChange('model', modelParam);
|
handleInputChange('model', modelParam);
|
||||||
}
|
}
|
||||||
}, [searchParams, t]);
|
}, [searchParams, t, handleInputChange]);
|
||||||
|
|
||||||
// Playground 组件无需再监听窗口变化,isMobile 由 useIsMobile Hook 自动更新
|
// Playground 组件无需再监听窗口变化,isMobile 由 useIsMobile Hook 自动更新
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue