/*
 * @Author: 赵伟
 * @Date: 2024-06-07 11:22:28
 * @Description: 接口返回的枚举值和共用的枚举值定义在这里
 */

// 公开还是私有 TabKey
export enum CommonTabKeys {
  Private = 'Private', // 私有
  Public = 'Public', // 公开
}

// 公开还是私有
export enum AvailableRange {
  Public = 1, // 公开
  Private = 0, // 私有
}

// 实验状态
export enum ExperimentStatus {
  Pending = 'Pending', // 启动中
  Running = 'Running', // 运行中
  Succeeded = 'Succeeded', // 成功
  Failed = 'Failed', // 失败
  Error = 'Error', // 错误
  Terminated = 'Terminated', // 终止
  Skipped = 'Skipped', // 跳过
  Omitted = 'Omitted', // 忽略
}

// TensorBoard 状态
export enum TensorBoardStatus {
  Unknown = 'Unknown', // 未知
  Pending = 'Pending', // 启动中
  Running = 'Running', // 运行中
  Terminated = 'Terminated', // 未启动
  Failed = 'Failed', // 失败
}

// 镜像版本状态
export enum MirrorVersionStatus {
  Available = 'Available', // 可用
  Building = 'Building', // 构建中
  Failed = 'Failed', // 失败
}

// 服务运行状态
export enum ServiceRunStatus {
  Init = 'Init', // 启动中
  Running = 'Running', // 运行中
  Stopped = 'Stopped', // 已停止
  Failed = 'Failed', // 失败
  Pending = 'Pending', // 挂起中
}

// 服务运行状态选项列表
export const serviceStatusOptions = [
  { label: '启动中', value: ServiceRunStatus.Init },
  { label: '运行中', value: ServiceRunStatus.Running },
  { label: '已停止', value: ServiceRunStatus.Stopped },
  { label: '失败', value: ServiceRunStatus.Failed },
  { label: '挂起中', value: ServiceRunStatus.Pending },
];

// 开发环境编辑器状态
export enum DevEditorStatus {
  Pending = 'Pending', // 启动中
  Running = 'Running', // 运行中
  Terminated = 'Terminated', // 已终止
  Failed = 'Failed', // 失败
  Unknown = 'Unknown', // 未启动
}

// 服务类型
export enum ServiceType {
  Video = 'video',
  Image = 'image',
  Audio = 'audio',
  Text = 'text',
}

export const serviceTypeOptions = [
  { label: '视频', value: ServiceType.Video },
  { label: '图片', value: ServiceType.Image },
  { label: '音频', value: ServiceType.Audio },
  { label: '文本', value: ServiceType.Text },
];

// 自动化类型
export enum AutoMLType {
  Table = 'auto_ml',
  Text = 'text_classification',
  Video = 'video_classification',
}

export const autoMLTypeOptions = [
  { label: '表格', value: AutoMLType.Table },
  { label: '文本分类', value: AutoMLType.Text },
  { label: '视频分类', value: AutoMLType.Video },
];

// 自动化任务类型
export enum AutoMLTaskType {
  Classification = 'classification',
  Regression = 'regression',
}

export const autoMLTaskTypeOptions = [
  { label: '分类', value: AutoMLTaskType.Classification },
  { label: '回归', value: AutoMLTaskType.Regression },
];

// 自动化任务集成策略
export enum AutoMLEnsembleClass {
  Default = 'default',
  SingleBest = 'SingleBest',
}

export const autoMLEnsembleClassOptions = [
  { label: '集成模型', value: AutoMLEnsembleClass.Default },
  { label: '单一最佳模型', value: AutoMLEnsembleClass.SingleBest },
];

// 自动化任务重采样策略
export enum AutoMLResamplingStrategy {
  Holdout = 'holdout',
  CrossValid = 'crossValid',
}

export const autoMLResamplingStrategyOptions = [
  { label: 'holdout', value: AutoMLResamplingStrategy.Holdout },
  { label: 'crossValid', value: AutoMLResamplingStrategy.CrossValid },
];

// 超参数自动寻优优化方向
export enum hyperParameterOptimizedMode {
  Min = 'min',
  Max = 'max',
}

export const hyperParameterOptimizedModeOptions = [
  { label: '越大越好', value: hyperParameterOptimizedMode.Max },
  { label: '越小越好', value: hyperParameterOptimizedMode.Min },
];

// 超参数 Trail 运行状态
export enum HyperParameterTrailStatus {
  PENDING = 'PENDING', // 挂起
  RUNNING = 'RUNNING', // 运行中
  TERMINATED = 'TERMINATED', // 成功
  ERROR = 'ERROR', // 错误
  PAUSED = 'PAUSED', // 暂停
  RESTORING = 'RESTORING', // 恢复中
}

// 自动 Trail 运行状态
export enum AutoMLTrailStatus {
  TIMEOUT = 'TIMEOUT', // 超时
  SUCCESS = 'SUCCESS', // 成功
  FAILURE = 'FAILURE', // 失败
  CRASHED = 'CRASHED', // 崩溃
  STOP = 'STOP', // 停止
  CANCELLED = 'CANCELLED', // 取消
  MEMOUT = 'MEMOUT', // 内存溢出
}
