fix: model instances update when tab active

This commit is contained in:
jialin
2025-01-17 23:16:38 +08:00
parent faa13f58e0
commit 1df3a0b8cb
5 changed files with 78 additions and 49 deletions
+14 -2
View File
@@ -21,6 +21,16 @@ const setProxyUrl = (url: string) => {
};
// ===================== Models =====================
export async function queryModelsInstances(options?: any) {
return request<Global.PageResponse<ModelInstanceListItem>>(
MODEL_INSTANCE_API,
{
method: 'GET',
cancelToken: options?.token
}
);
}
export async function queryModelsList(
params: Global.SearchParams,
options?: any
@@ -69,13 +79,15 @@ export async function queryModelDetail(id: number) {
// ===================== Model Instances start =====================
export async function queryModelInstancesList(
params: Global.Pagination & { query?: string; id: number }
params: Global.Pagination & { query?: string; id: number },
options?: any
) {
return request<Global.PageResponse<ModelInstanceListItem>>(
`${MODELS_API}/${params.id}/instances`,
{
method: 'GET',
params
params,
cancelToken: options?.token
}
);
}