feat: add instance view

This commit is contained in:
jialin
2026-03-26 18:20:55 +08:00
committed by jialin
parent 33fe180997
commit adde7fba37
31 changed files with 1171 additions and 702 deletions
@@ -0,0 +1,35 @@
import { ListItem as WorkerListItem } from '@/pages/resources/config/types';
import { createContext, useContext } from 'react';
import { ListItem as ModelListItem } from '../config/types';
interface DeploymentsContextProps {
clusterList: Global.BaseOption<
number,
{
provider: string;
state: string;
is_default: boolean;
}
>[];
workerList: WorkerListItem[];
generateFormValues: (
data: ModelListItem,
gpuOptions: any
) => Record<string, any>;
}
export const DeploymentsContext = createContext<DeploymentsContextProps>({
clusterList: [],
workerList: [],
generateFormValues: () => ({})
});
export const useDeploymentsContext = () => {
const context = useContext(DeploymentsContext);
if (!context) {
throw new Error(
'useDeploymentsContext must be used within a DeploymentsProvider'
);
}
return context;
};
+1
View File
@@ -119,6 +119,7 @@ export interface ModelInstanceListItem {
cluster_id: number;
backend_version?: string;
source: string;
categories?: string[];
huggingface_repo_id: string;
huggingface_filename: string;
ollama_library_model_name: string;