import { BatchStep } from '@/types'; import { suspendModeTypes, deployModeTypes } from '@/enums'; export interface IParameter { description: string; name: string; overridable: boolean; predefined: boolean; rule?: string; type: string; value: string; valueSource: 'VARIABLE' | 'CONSTANT' | 'NULL'; } export interface IFieldItem { disabled: boolean; value: string | number; label?: string; min?: number; max?: number; description?: string; dataSource: Array<{ label: string; value: string; disabled?: boolean; tips?: string; }>; tips?: string; } export interface IDeployComponent { name: string; kind: string; taskName: string; envName?: string; behavior?: string; strategy?: { images: string[]; deployType: IFieldItem; batchMode: IFieldItem; batches: IFieldItem; targetReplicas: IFieldItem; timeout: IFieldItem; }; values?: IDeployValues; } export interface IDeployValues { targetReplicas?: number; fromReplica?: number; batchSteps: BatchStep[]; timeout?: number; batchMode: keyof typeof suspendModeTypes; deployType: keyof typeof deployModeTypes; deleteDeployGroup?: boolean; restraint?: { type: string; action: 'scale-up' | 'scale-down'; targetSnList: string[]; }; } export interface IDeploymentComponnet { fromReplica: IFieldItem; targetReplicas: IFieldItem; timeout: IFieldItem; images: string[]; deployMode: IFieldItem & { dataSource: IFieldItem[]; }; batchMode: IFieldItem & { dataSource: IFieldItem[]; }; batchSteps: BatchStep[]; batch: IFieldItem; envName: string; onChange: (values: Record) => void; }