/* * @Author: 赵伟 * @Date: 2024-04-08 09:54:39 * @Description: 定义全局类型,比如无关联的页面都需要要的类型 */ import { ExperimentStatus, TensorBoardStatus } from '@/enums'; import type { Settings as LayoutSettings } from '@ant-design/pro-components'; // 全局初始状态类型 export type GlobalInitialState = { settings?: Partial; currentUser?: API.CurrentUser; fetchUserInfo?: () => Promise; loading?: boolean; collapsed?: boolean; }; // 流水线全局参数 export type PipelineGlobalParam = { param_name: string; description: string; param_type: number; param_value: number | string | boolean; is_sensitive: number; }; // 实验实例 export type ExperimentInstance = { id: number; experiment_id: number; workflow_id: number; create_time: string; finish_time: string; update_time: string; status: string; argo_ins_name: string; argo_ins_ns: string; nodes_result: { [key: string]: any; }; nodes_status: string; global_param: PipelineGlobalParam[]; tensorBoardStatus?: TensorBoardStatus; tensorboardUrl?: string; }; // 流水线节点 export type PipelineNodeModel = { id: string; experimentStatus: ExperimentStatus; label: string; experimentStartTime: string; experimentEndTime?: string | null; control_strategy: string; in_parameters: string; out_parameters: string; component_label: string; icon_path: string; workflowId?: string; }; // 流水线节点模型数据 export type PipelineNodeModelParameter = { type: string; item_type: string; label: string; value: any; require?: number; placeholder?: string; describe?: string; fromSelect?: boolean; showValue?: any; editable?: number; activeTab?: string; // ResourceSelectorModal tab expandedKeys?: string[]; // ResourceSelectorModal expandedKeys checkedKeys?: string[]; // ResourceSelectorModal checkedKeys }; // 修改属性类型 export type ChangePropertyType = Omit & { [P in K]: NewType }; // export type PascalCaseType = { // [K in keyof T as `${Capitalize}`]: T[K]; // } // 序列化后的流水线节点 export type PipelineNodeModelSerialize = Omit< PipelineNodeModel, 'control_strategy' | 'in_parameters' | 'out_parameters' > & { control_strategy: Record; in_parameters: Record; out_parameters: Record; }; // 资源规格 export type ComputingResource = { id: number; computing_resource: string; description: string; standard: string; create_by: string; };