chore: test by api

This commit is contained in:
jialin
2025-10-13 14:40:26 +08:00
parent 54703c67c1
commit a5c1b8e15f
29 changed files with 683 additions and 298 deletions
+13 -49
View File
@@ -20,7 +20,7 @@ export const MODEL_INSTANCE_API = '/model-instances';
export const MODEL_EVALUATIONS = '/model-evaluations';
export const BACKEND_LIST_API = '/inference-backend/list';
export const BACKEND_LIST_API = '/inference-backends/list';
const setProxyUrl = (url: string) => {
return `/proxy?url=${encodeURIComponent(url)}`;
@@ -400,52 +400,16 @@ export async function evaluationsModelSpec(
}
export async function queryBackendList() {
// return request<{
// items: {
// backend_name: string;
// backend_show_name: string;
// from_config: boolean;
// default_version: string;
// default_backend_param: string[];
// versions: string[];
// }[];
// }>(BACKEND_LIST_API, {
// method: 'GET'
// });
return {
items: [
{
backend_name: 'vllm',
backend_show_name: 'vLLM',
from_config: false,
default_version: '0.10.1.1',
default_backend_param: null,
versions: ['0.10.1.1', '0.10.0', '0.9.2', '0.8.5', '0.8.3']
},
{
backend_name: 'ascend-mindie',
backend_show_name: 'Ascend MindIE',
from_config: false,
default_version: null,
default_backend_param: null,
versions: null
},
{
backend_name: 'custom',
backend_show_name: 'Custom',
from_config: false,
default_version: null,
default_backend_param: null,
versions: null
},
{
backend_name: 'test',
backend_show_name: null,
from_config: true,
default_version: 'v1',
default_backend_param: ['--host=0.0.0.0'],
versions: ['v1']
}
]
};
return request<{
items: {
backend_name: string;
backend_show_name: string;
from_config: boolean;
default_version: string;
default_backend_param: string[];
versions: string[];
}[];
}>(BACKEND_LIST_API, {
method: 'GET'
});
}
+3 -3
View File
@@ -61,7 +61,7 @@ import useQueryBackends from '../hooks/use-query-backends';
import APIAccessInfoModal from './api-access-info';
import DeployModal from './deploy-modal';
import Instances from './instances';
import UpdateModel from './update-modal';
import UpdateModelModal from './update-modal';
import ViewLogsModal from './view-logs-modal';
interface ModelsProps {
handleSearch: (params?: any) => void;
@@ -685,7 +685,7 @@ const Models: React.FC<ModelsProps> = ({
}}
></SealTable>
</PageContainer>
<UpdateModel
<UpdateModelModal
open={openAddModal}
action={PageAction.EDIT}
title={intl.formatMessage({ id: 'models.title.edit' })}
@@ -694,7 +694,7 @@ const Models: React.FC<ModelsProps> = ({
onCancel={handleModalCancel}
onOk={handleModalOk}
backendOptions={backendOptions}
></UpdateModel>
></UpdateModelModal>
<DeployModal
open={openDeployModal.show}
action={PageAction.CREATE}