| @@ -153,7 +153,7 @@ function ActiveLearnInstance() { | |||||
| className={styles['active-learn-instance__basic']} | className={styles['active-learn-instance__basic']} | ||||
| info={experimentInfo} | info={experimentInfo} | ||||
| runStatus={workflowStatus} | runStatus={workflowStatus} | ||||
| instanceStatus={instanceInfo?.status} | |||||
| instanceStatus={instanceInfo?.status as ExperimentStatus} | |||||
| isInstance | isInstance | ||||
| /> | /> | ||||
| ), | ), | ||||
| @@ -1,5 +1,6 @@ | |||||
| import { ExperimentStatus } from '@/enums'; | import { ExperimentStatus } from '@/enums'; | ||||
| import { ActiveLearnInstanceData } from '@/pages/ActiveLearn/types'; | import { ActiveLearnInstanceData } from '@/pages/ActiveLearn/types'; | ||||
| import EmptyLog from '@/pages/AutoML/components/ExperimentLog/empty'; | |||||
| import LogList from '@/pages/Experiment/components/LogList'; | import LogList from '@/pages/Experiment/components/LogList'; | ||||
| import { NodeStatus } from '@/types'; | import { NodeStatus } from '@/types'; | ||||
| import { Tabs } from 'antd'; | import { Tabs } from 'antd'; | ||||
| @@ -64,7 +65,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| // icon: <KFIcon type="icon-rizhi1" />, | // icon: <KFIcon type="icon-rizhi1" />, | ||||
| children: ( | children: ( | ||||
| <div className={styles['experiment-log__tabs__log']}> | <div className={styles['experiment-log__tabs__log']}> | ||||
| {trainCloneNodeStatus && ( | |||||
| {trainCloneNodeStatus ? ( | |||||
| <LogList | <LogList | ||||
| instanceName={instanceInfo.argo_ins_name} | instanceName={instanceInfo.argo_ins_name} | ||||
| instanceNamespace={instanceInfo.argo_ins_ns} | instanceNamespace={instanceInfo.argo_ins_ns} | ||||
| @@ -73,6 +74,8 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| instanceNodeStartTime={trainCloneNodeStatus.startedAt} | instanceNodeStartTime={trainCloneNodeStatus.startedAt} | ||||
| instanceNodeStatus={trainCloneNodeStatus.phase as ExperimentStatus} | instanceNodeStatus={trainCloneNodeStatus.phase as ExperimentStatus} | ||||
| ></LogList> | ></LogList> | ||||
| ) : ( | |||||
| <EmptyLog /> | |||||
| )} | )} | ||||
| </div> | </div> | ||||
| ), | ), | ||||
| @@ -83,7 +86,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| // icon: <KFIcon type="icon-rizhi1" />, | // icon: <KFIcon type="icon-rizhi1" />, | ||||
| children: ( | children: ( | ||||
| <div className={styles['experiment-log__tabs__log']}> | <div className={styles['experiment-log__tabs__log']}> | ||||
| {hpoNodeStatus && ( | |||||
| {hpoNodeStatus ? ( | |||||
| <LogList | <LogList | ||||
| instanceName={instanceInfo.argo_ins_name} | instanceName={instanceInfo.argo_ins_name} | ||||
| instanceNamespace={instanceInfo.argo_ins_ns} | instanceNamespace={instanceInfo.argo_ins_ns} | ||||
| @@ -92,6 +95,8 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| instanceNodeStartTime={hpoNodeStatus.startedAt} | instanceNodeStartTime={hpoNodeStatus.startedAt} | ||||
| instanceNodeStatus={hpoNodeStatus.phase as ExperimentStatus} | instanceNodeStatus={hpoNodeStatus.phase as ExperimentStatus} | ||||
| ></LogList> | ></LogList> | ||||
| ) : ( | |||||
| <EmptyLog /> | |||||
| )} | )} | ||||
| </div> | </div> | ||||
| ), | ), | ||||
| @@ -95,7 +95,10 @@ function AutoMLInstance() { | |||||
| }; | }; | ||||
| const setupSSE = (name: string, namespace: string) => { | const setupSSE = (name: string, namespace: string) => { | ||||
| const { origin } = location; | |||||
| let { origin } = location; | |||||
| if (process.env.NODE_ENV === 'development') { | |||||
| origin = 'http://172.20.32.235:31213'; | |||||
| } | |||||
| const params = encodeURIComponent(`metadata.namespace=${namespace},metadata.name=${name}`); | const params = encodeURIComponent(`metadata.namespace=${namespace},metadata.name=${name}`); | ||||
| const evtSource = new EventSource( | const evtSource = new EventSource( | ||||
| `${origin}/api/v1/realtimeStatus?listOptions.fieldSelector=${params}`, | `${origin}/api/v1/realtimeStatus?listOptions.fieldSelector=${params}`, | ||||
| @@ -156,7 +159,7 @@ function AutoMLInstance() { | |||||
| className={styles['auto-ml-instance__basic']} | className={styles['auto-ml-instance__basic']} | ||||
| info={autoMLInfo} | info={autoMLInfo} | ||||
| runStatus={workflowStatus} | runStatus={workflowStatus} | ||||
| instanceStatus={instanceInfo?.status} | |||||
| instanceStatus={instanceInfo?.status as ExperimentStatus} | |||||
| isInstance | isInstance | ||||
| /> | /> | ||||
| ), | ), | ||||
| @@ -0,0 +1,7 @@ | |||||
| import styles from './index.less'; | |||||
| function EmptyLog() { | |||||
| return <div className={styles['empty-log']}>暂无日志</div>; | |||||
| } | |||||
| export default EmptyLog; | |||||
| @@ -5,3 +5,14 @@ | |||||
| height: 100%; | height: 100%; | ||||
| } | } | ||||
| } | } | ||||
| .empty-log { | |||||
| height: 100%; | |||||
| padding: 15px; | |||||
| color: white; | |||||
| font-size: 14px; | |||||
| white-space: pre-line; | |||||
| text-align: center; | |||||
| word-break: break-all; | |||||
| background: #19253b; | |||||
| } | |||||
| @@ -2,6 +2,7 @@ import { ExperimentStatus } from '@/enums'; | |||||
| import { AutoMLInstanceData } from '@/pages/AutoML/types'; | import { AutoMLInstanceData } from '@/pages/AutoML/types'; | ||||
| import LogList from '@/pages/Experiment/components/LogList'; | import LogList from '@/pages/Experiment/components/LogList'; | ||||
| import { NodeStatus } from '@/types'; | import { NodeStatus } from '@/types'; | ||||
| import EmptyLog from './empty'; | |||||
| import styles from './index.less'; | import styles from './index.less'; | ||||
| const NodePrefix = 'auto-ml'; | const NodePrefix = 'auto-ml'; | ||||
| @@ -19,7 +20,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| return ( | return ( | ||||
| <div className={styles['experiment-log']}> | <div className={styles['experiment-log']}> | ||||
| <div className={styles['experiment-log__log']}> | <div className={styles['experiment-log__log']}> | ||||
| {nodeStatus && ( | |||||
| {nodeStatus ? ( | |||||
| <LogList | <LogList | ||||
| instanceName={instanceInfo.argo_ins_name} | instanceName={instanceInfo.argo_ins_name} | ||||
| instanceNamespace={instanceInfo.argo_ins_ns} | instanceNamespace={instanceInfo.argo_ins_ns} | ||||
| @@ -28,6 +29,8 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| instanceNodeStartTime={nodeStatus.startedAt} | instanceNodeStartTime={nodeStatus.startedAt} | ||||
| instanceNodeStatus={nodeStatus.phase as ExperimentStatus} | instanceNodeStatus={nodeStatus.phase as ExperimentStatus} | ||||
| ></LogList> | ></LogList> | ||||
| ) : ( | |||||
| <EmptyLog /> | |||||
| )} | )} | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -54,7 +54,10 @@ function LogGroup({ | |||||
| useEffect(() => { | useEffect(() => { | ||||
| // 建立 socket 连接 | // 建立 socket 连接 | ||||
| const setupSockect = () => { | const setupSockect = () => { | ||||
| const { host } = location; | |||||
| let { host } = location; | |||||
| if (process.env.NODE_ENV === 'development') { | |||||
| host = '172.20.32.235:31213'; | |||||
| } | |||||
| const socket = new WebSocket( | const socket = new WebSocket( | ||||
| `ws://${host}/newlog/realtimeLog?start=${start_time}&query={pod="${pod_name}"}`, | `ws://${host}/newlog/realtimeLog?start=${start_time}&query={pod="${pod_name}"}`, | ||||
| ); | ); | ||||
| @@ -168,7 +168,7 @@ function HyperParameterInstance() { | |||||
| className={styles['hyper-parameter-instance__basic']} | className={styles['hyper-parameter-instance__basic']} | ||||
| info={experimentInfo} | info={experimentInfo} | ||||
| runStatus={workflowStatus} | runStatus={workflowStatus} | ||||
| instanceStatus={instanceInfo?.status} | |||||
| instanceStatus={instanceInfo?.status as ExperimentStatus} | |||||
| isInstance | isInstance | ||||
| /> | /> | ||||
| ), | ), | ||||
| @@ -1,4 +1,5 @@ | |||||
| import { ExperimentStatus } from '@/enums'; | import { ExperimentStatus } from '@/enums'; | ||||
| import EmptyLog from '@/pages/AutoML/components/ExperimentLog/empty'; | |||||
| import LogList from '@/pages/Experiment/components/LogList'; | import LogList from '@/pages/Experiment/components/LogList'; | ||||
| import { HyperParameterInstanceData } from '@/pages/HyperParameter/types'; | import { HyperParameterInstanceData } from '@/pages/HyperParameter/types'; | ||||
| import { NodeStatus } from '@/types'; | import { NodeStatus } from '@/types'; | ||||
| @@ -64,7 +65,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| // icon: <KFIcon type="icon-rizhi1" />, | // icon: <KFIcon type="icon-rizhi1" />, | ||||
| children: ( | children: ( | ||||
| <div className={styles['experiment-log__tabs__log']}> | <div className={styles['experiment-log__tabs__log']}> | ||||
| {trainCloneNodeStatus && ( | |||||
| {trainCloneNodeStatus ? ( | |||||
| <LogList | <LogList | ||||
| instanceName={instanceInfo.argo_ins_name} | instanceName={instanceInfo.argo_ins_name} | ||||
| instanceNamespace={instanceInfo.argo_ins_ns} | instanceNamespace={instanceInfo.argo_ins_ns} | ||||
| @@ -73,6 +74,8 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| instanceNodeStartTime={trainCloneNodeStatus.startedAt} | instanceNodeStartTime={trainCloneNodeStatus.startedAt} | ||||
| instanceNodeStatus={trainCloneNodeStatus.phase as ExperimentStatus} | instanceNodeStatus={trainCloneNodeStatus.phase as ExperimentStatus} | ||||
| ></LogList> | ></LogList> | ||||
| ) : ( | |||||
| <EmptyLog /> | |||||
| )} | )} | ||||
| </div> | </div> | ||||
| ), | ), | ||||
| @@ -83,7 +86,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| // icon: <KFIcon type="icon-rizhi1" />, | // icon: <KFIcon type="icon-rizhi1" />, | ||||
| children: ( | children: ( | ||||
| <div className={styles['experiment-log__tabs__log']}> | <div className={styles['experiment-log__tabs__log']}> | ||||
| {hpoNodeStatus && ( | |||||
| {hpoNodeStatus ? ( | |||||
| <LogList | <LogList | ||||
| instanceName={instanceInfo.argo_ins_name} | instanceName={instanceInfo.argo_ins_name} | ||||
| instanceNamespace={instanceInfo.argo_ins_ns} | instanceNamespace={instanceInfo.argo_ins_ns} | ||||
| @@ -92,6 +95,8 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| instanceNodeStartTime={hpoNodeStatus.startedAt} | instanceNodeStartTime={hpoNodeStatus.startedAt} | ||||
| instanceNodeStatus={hpoNodeStatus.phase as ExperimentStatus} | instanceNodeStatus={hpoNodeStatus.phase as ExperimentStatus} | ||||
| ></LogList> | ></LogList> | ||||
| ) : ( | |||||
| <EmptyLog /> | |||||
| )} | )} | ||||
| </div> | </div> | ||||
| ), | ), | ||||