Browse Source

chore: 代码优化

pull/101/head
cp3hnu 1 year ago
parent
commit
58bed49279
4 changed files with 12 additions and 11 deletions
  1. +2
    -0
      react-ui/src/pages/Experiment/Info/index.jsx
  2. +2
    -9
      react-ui/src/pages/Experiment/Info/props.tsx
  3. +1
    -1
      react-ui/src/pages/Experiment/components/LogGroup/index.tsx
  4. +7
    -1
      react-ui/src/pages/Experiment/components/LogList/index.tsx

+ 2
- 0
react-ui/src/pages/Experiment/Info/index.jsx View File

@@ -112,6 +112,8 @@ function ExperimentText() {
}, 5 * 1000);
}

// 如果状态是 Pending, 打开第一个节点
// 如果状态是 Running,打开第一个运行中的节点,如果没有运行中的节点,打开第一个节点
if (first && status === ExperimentStatus.Pending) {
const node = workflowData.nodes[0];
if (node) {


+ 2
- 9
react-ui/src/pages/Experiment/Info/props.tsx View File

@@ -10,13 +10,6 @@ import LogList from '../components/LogList';
import { experimentStatusInfo } from '../status';
import styles from './props.less';

export type ExperimentLog = {
log_type: 'normal' | 'resource'; // 日志类型
pod_name?: string; // 分布式名称
log_content?: string; // 日志内容
start_time?: string; // 日志开始时间
};

type ExperimentDrawerProps = {
open: boolean;
onClose: () => void;
@@ -25,8 +18,8 @@ type ExperimentDrawerProps = {
instanceNamespace?: string; // 实验实例 namespace
instanceNodeData: PipelineNodeModelSerialize; // 节点数据,在定时刷新实验实例状态中不会变化
workflowId?: string; // 实验实例工作流 id
instanceNodeStatus?: ExperimentStatus; // 在定时刷新实验实例状态中,变化一两次
instanceNodeStartTime?: string; // 在定时刷新实验实例状态中,变化一两次
instanceNodeStatus?: ExperimentStatus; // 实例节点状态
instanceNodeStartTime?: string; // 开始时间
instanceNodeEndTime?: string; // 在定时刷新实验实例状态中,会经常变化
};



+ 1
- 1
react-ui/src/pages/Experiment/components/LogGroup/index.tsx View File

@@ -6,12 +6,12 @@

import { ExperimentStatus } from '@/enums';
import { useStateRef } from '@/hooks';
import { ExperimentLog } from '@/pages/Experiment/Info/props';
import { getExperimentPodsLog } from '@/services/experiment/index.js';
import { DoubleRightOutlined, DownOutlined, UpOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import classNames from 'classnames';
import { useEffect, useRef, useState } from 'react';
import { ExperimentLog } from '../LogList';
import styles from './index.less';

export type LogGroupProps = ExperimentLog & {


+ 7
- 1
react-ui/src/pages/Experiment/components/LogList/index.tsx View File

@@ -1,5 +1,4 @@
import { ExperimentStatus } from '@/enums';
import { ExperimentLog } from '@/pages/Experiment/Info/props';
import { getQueryByExperimentLog } from '@/services/experiment/index.js';
import { to } from '@/utils/promise';
import dayjs from 'dayjs';
@@ -7,6 +6,13 @@ import { useEffect, useState } from 'react';
import LogGroup from '../LogGroup';
import styles from './index.less';

export type ExperimentLog = {
log_type: 'normal' | 'resource'; // 日志类型
pod_name?: string; // 分布式名称
log_content?: string; // 日志内容
start_time?: string; // 日志开始时间
};

type LogListProps = {
instanceName?: string; // 实验实例 name
instanceNamespace?: string; // 实验实例 namespace


Loading…
Cancel
Save