fix: open model in playground
This commit is contained in:
@@ -41,12 +41,10 @@ import {
|
||||
import {
|
||||
InstanceRealtimeLogStatus,
|
||||
modelCategories,
|
||||
modelCategoriesMap,
|
||||
modelSourceMap
|
||||
} from '../config';
|
||||
import {
|
||||
ButtonList,
|
||||
categoryToPathMap,
|
||||
modalConfig,
|
||||
sourceOptions
|
||||
} from '../config/button-actions';
|
||||
@@ -351,26 +349,6 @@ const Models: React.FC<ModelsProps> = ({
|
||||
});
|
||||
};
|
||||
|
||||
const handleOpenPlayGround = (row: any) => {
|
||||
for (const [category, path] of Object.entries(categoryToPathMap)) {
|
||||
if (
|
||||
row.categories?.includes(category) &&
|
||||
[
|
||||
modelCategoriesMap.text_to_speech,
|
||||
modelCategoriesMap.speech_to_text
|
||||
].includes(category)
|
||||
) {
|
||||
navigate(`${path}&model=${row.name}`);
|
||||
return;
|
||||
}
|
||||
if (row.categories?.includes(category)) {
|
||||
navigate(`${path}?model=${row.name}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
navigate(`/playground/chat?model=${row.name}`);
|
||||
};
|
||||
|
||||
const handleViewLogs = async (row: any) => {
|
||||
try {
|
||||
setCurrentInstance({
|
||||
@@ -445,9 +423,6 @@ const Models: React.FC<ModelsProps> = ({
|
||||
if (val === 'edit') {
|
||||
handleEdit(row);
|
||||
}
|
||||
if (val === 'chat') {
|
||||
handleOpenPlayGround(row);
|
||||
}
|
||||
if (val === 'delete') {
|
||||
handleDelete(row);
|
||||
}
|
||||
|
||||
@@ -39,16 +39,6 @@ export const ActionList: ActionItem[] = [
|
||||
key: 'edit',
|
||||
icon: icons.EditOutlined
|
||||
},
|
||||
// {
|
||||
// label: 'common.button.detail',
|
||||
// key: 'details',
|
||||
// icon: icons.FileTextOutlined
|
||||
// },
|
||||
{
|
||||
label: 'models.openinplayground',
|
||||
key: 'chat',
|
||||
icon: icons.ExperimentOutlined
|
||||
},
|
||||
{
|
||||
label: 'common.button.start',
|
||||
key: 'start',
|
||||
@@ -59,11 +49,6 @@ export const ActionList: ActionItem[] = [
|
||||
key: 'api',
|
||||
icon: icons.ApiOutlined
|
||||
},
|
||||
// {
|
||||
// label: 'models.button.accessSettings',
|
||||
// key: 'accessControl',
|
||||
// icon: icons.Permission
|
||||
// },
|
||||
{
|
||||
label: 'common.button.stop',
|
||||
key: 'stop',
|
||||
|
||||
Reference in New Issue
Block a user