|
|
|
@@ -379,149 +379,153 @@ function Experiment() { |
|
|
|
}, |
|
|
|
]; |
|
|
|
return ( |
|
|
|
<div> |
|
|
|
<div className={Styles.experimentBox}> |
|
|
|
<div className={Styles.pipelineTopBox}> |
|
|
|
<Button type="default" onClick={createExperiment} icon={<KFIcon type="icon-xinjian2" />}> |
|
|
|
新建实验 |
|
|
|
</Button> |
|
|
|
</div> |
|
|
|
<Table |
|
|
|
columns={columns} |
|
|
|
dataSource={experimentList} |
|
|
|
pagination={paginationProps} |
|
|
|
rowKey="id" |
|
|
|
expandable={{ |
|
|
|
expandedRowRender: (record) => ( |
|
|
|
<div> |
|
|
|
{experimentInList && experimentInList.length > 0 ? ( |
|
|
|
<div className={Styles.tableExpandBox} style={{ paddingBottom: '16px' }}> |
|
|
|
<div className={Styles.index}>序号</div> |
|
|
|
<div className={Styles.tensorBoard}>可视化</div> |
|
|
|
<div className={Styles.description}> |
|
|
|
<div style={{ width: '50%' }}>运行时长</div> |
|
|
|
<div style={{ width: '50%' }}>开始时间</div> |
|
|
|
<div className={classNames('vertical-scroll-table', Styles.experimentTable)}> |
|
|
|
<Table |
|
|
|
columns={columns} |
|
|
|
dataSource={experimentList} |
|
|
|
pagination={paginationProps} |
|
|
|
rowKey="id" |
|
|
|
scroll={{ y: 'calc(100% - 55px)' }} |
|
|
|
expandable={{ |
|
|
|
expandedRowRender: (record) => ( |
|
|
|
<div> |
|
|
|
{experimentInList && experimentInList.length > 0 ? ( |
|
|
|
<div className={Styles.tableExpandBox} style={{ paddingBottom: '16px' }}> |
|
|
|
<div className={Styles.index}>序号</div> |
|
|
|
<div className={Styles.tensorBoard}>可视化</div> |
|
|
|
<div className={Styles.description}> |
|
|
|
<div style={{ width: '50%' }}>运行时长</div> |
|
|
|
<div style={{ width: '50%' }}>开始时间</div> |
|
|
|
</div> |
|
|
|
<div className={Styles.status}>状态</div> |
|
|
|
<div className={Styles.operation}>操作</div> |
|
|
|
</div> |
|
|
|
<div className={Styles.status}>状态</div> |
|
|
|
<div className={Styles.operation}>操作</div> |
|
|
|
</div> |
|
|
|
) : ( |
|
|
|
'' |
|
|
|
)} |
|
|
|
) : ( |
|
|
|
'' |
|
|
|
)} |
|
|
|
|
|
|
|
{experimentInList && experimentInList.length > 0 |
|
|
|
? experimentInList.map((item, index) => ( |
|
|
|
<div |
|
|
|
key={item.id} |
|
|
|
className={classNames(Styles.tableExpandBox, Styles.tableExpandBoxContent)} |
|
|
|
> |
|
|
|
<a |
|
|
|
className={Styles.index} |
|
|
|
style={{ padding: '0 16px' }} |
|
|
|
onClick={(e) => routerToText(e, item, record)} |
|
|
|
{experimentInList && experimentInList.length > 0 |
|
|
|
? experimentInList.map((item, index) => ( |
|
|
|
<div |
|
|
|
key={item.id} |
|
|
|
className={classNames(Styles.tableExpandBox, Styles.tableExpandBoxContent)} |
|
|
|
> |
|
|
|
{index + 1} |
|
|
|
</a> |
|
|
|
<div className={Styles.tensorBoard}> |
|
|
|
{item.nodes_result?.tensorboard_log ? ( |
|
|
|
<TensorBoardStatus |
|
|
|
status={item.tensorBoardStatus} |
|
|
|
onClick={() => handleTensorboard(item)} |
|
|
|
></TensorBoardStatus> |
|
|
|
) : ( |
|
|
|
'-' |
|
|
|
)} |
|
|
|
</div> |
|
|
|
<div className={Styles.description}> |
|
|
|
<div style={{ width: '50%' }}> |
|
|
|
{item.finish_time |
|
|
|
? elapsedTime(new Date(item.create_time), new Date(item.finish_time)) |
|
|
|
: elapsedTime(new Date(item.create_time), new Date())} |
|
|
|
<a |
|
|
|
className={Styles.index} |
|
|
|
style={{ padding: '0 16px' }} |
|
|
|
onClick={(e) => routerToText(e, item, record)} |
|
|
|
> |
|
|
|
{index + 1} |
|
|
|
</a> |
|
|
|
<div className={Styles.tensorBoard}> |
|
|
|
{item.nodes_result?.tensorboard_log ? ( |
|
|
|
<TensorBoardStatus |
|
|
|
status={item.tensorBoardStatus} |
|
|
|
onClick={() => handleTensorboard(item)} |
|
|
|
></TensorBoardStatus> |
|
|
|
) : ( |
|
|
|
'-' |
|
|
|
)} |
|
|
|
</div> |
|
|
|
<div style={{ width: '50%' }}> |
|
|
|
{momnet(item.create_time).format('YYYY-MM-DD HH:mm:ss')} |
|
|
|
<div className={Styles.description}> |
|
|
|
<div style={{ width: '50%' }}> |
|
|
|
{item.finish_time |
|
|
|
? elapsedTime(new Date(item.create_time), new Date(item.finish_time)) |
|
|
|
: elapsedTime(new Date(item.create_time), new Date())} |
|
|
|
</div> |
|
|
|
<div style={{ width: '50%' }}> |
|
|
|
{momnet(item.create_time).format('YYYY-MM-DD HH:mm:ss')} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className={Styles.statusBox}> |
|
|
|
<img |
|
|
|
style={{ width: '17px', marginRight: '7px' }} |
|
|
|
src={experimentStatusInfo[item.status]?.icon} |
|
|
|
/>{' '} |
|
|
|
<span |
|
|
|
style={{ color: experimentStatusInfo[item.status]?.color }} |
|
|
|
className={Styles.statusIcon} |
|
|
|
> |
|
|
|
{experimentStatusInfo[item.status]?.label} |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<div className={Styles.operation}> |
|
|
|
<Button |
|
|
|
type="link" |
|
|
|
size="small" |
|
|
|
key="stop" |
|
|
|
disabled={ |
|
|
|
item.status === 'Succeeded' || |
|
|
|
item.status === 'Failed' || |
|
|
|
item.status === 'Terminated' |
|
|
|
} |
|
|
|
icon={<KFIcon type="icon-zhongzhi" />} |
|
|
|
onClick={async () => { |
|
|
|
putQueryByExperimentInsId(item.id).then((ret) => { |
|
|
|
if (ret.code === 200) { |
|
|
|
message.success('终止成功'); |
|
|
|
getQueryByExperiment(record.id); |
|
|
|
} else { |
|
|
|
message.error(ret.msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}} |
|
|
|
> |
|
|
|
终止 |
|
|
|
</Button> |
|
|
|
<ConfigProvider |
|
|
|
theme={{ |
|
|
|
token: { |
|
|
|
colorLink: themes['warningColor'], |
|
|
|
}, |
|
|
|
}} |
|
|
|
> |
|
|
|
<div className={Styles.statusBox}> |
|
|
|
<img |
|
|
|
style={{ width: '17px', marginRight: '7px' }} |
|
|
|
src={experimentStatusInfo[item.status]?.icon} |
|
|
|
/>{' '} |
|
|
|
<span |
|
|
|
style={{ color: experimentStatusInfo[item.status]?.color }} |
|
|
|
className={Styles.statusIcon} |
|
|
|
> |
|
|
|
{experimentStatusInfo[item.status]?.label} |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<div className={Styles.operation}> |
|
|
|
<Button |
|
|
|
type="link" |
|
|
|
size="small" |
|
|
|
key="batchRemove" |
|
|
|
disabled={item.status === 'Running' || item.status === 'Pending'} |
|
|
|
icon={<KFIcon type="icon-shanchu" />} |
|
|
|
onClick={() => { |
|
|
|
modalConfirm({ |
|
|
|
title: '确定删除该条实例吗?', |
|
|
|
onOk: () => { |
|
|
|
deleteQueryByExperimentInsId(item.id).then((ret) => { |
|
|
|
if (ret.code === 200) { |
|
|
|
message.success('删除成功'); |
|
|
|
getQueryByExperiment(record.id); |
|
|
|
} else { |
|
|
|
message.error(ret.msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
key="stop" |
|
|
|
disabled={ |
|
|
|
item.status === 'Succeeded' || |
|
|
|
item.status === 'Failed' || |
|
|
|
item.status === 'Terminated' |
|
|
|
} |
|
|
|
icon={<KFIcon type="icon-zhongzhi" />} |
|
|
|
onClick={async () => { |
|
|
|
putQueryByExperimentInsId(item.id).then((ret) => { |
|
|
|
if (ret.code === 200) { |
|
|
|
message.success('终止成功'); |
|
|
|
getQueryByExperiment(record.id); |
|
|
|
} else { |
|
|
|
message.error(ret.msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}} |
|
|
|
> |
|
|
|
删除 |
|
|
|
终止 |
|
|
|
</Button> |
|
|
|
</ConfigProvider> |
|
|
|
<ConfigProvider |
|
|
|
theme={{ |
|
|
|
token: { |
|
|
|
colorLink: themes['warningColor'], |
|
|
|
}, |
|
|
|
}} |
|
|
|
> |
|
|
|
<Button |
|
|
|
type="link" |
|
|
|
size="small" |
|
|
|
key="batchRemove" |
|
|
|
disabled={item.status === 'Running' || item.status === 'Pending'} |
|
|
|
icon={<KFIcon type="icon-shanchu" />} |
|
|
|
onClick={() => { |
|
|
|
modalConfirm({ |
|
|
|
title: '确定删除该条实例吗?', |
|
|
|
onOk: () => { |
|
|
|
deleteQueryByExperimentInsId(item.id).then((ret) => { |
|
|
|
if (ret.code === 200) { |
|
|
|
message.success('删除成功'); |
|
|
|
getQueryByExperiment(record.id); |
|
|
|
} else { |
|
|
|
message.error(ret.msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}); |
|
|
|
}} |
|
|
|
> |
|
|
|
删除 |
|
|
|
</Button> |
|
|
|
</ConfigProvider> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)) |
|
|
|
: ''} |
|
|
|
</div> |
|
|
|
), |
|
|
|
onExpand: (e, a) => { |
|
|
|
expandChange(e, a); |
|
|
|
}, |
|
|
|
expandedRowKeys: [expandedRowKeys], |
|
|
|
rowExpandable: (record) => true, |
|
|
|
}} |
|
|
|
/> |
|
|
|
)) |
|
|
|
: ''} |
|
|
|
</div> |
|
|
|
), |
|
|
|
onExpand: (e, a) => { |
|
|
|
expandChange(e, a); |
|
|
|
}, |
|
|
|
expandedRowKeys: [expandedRowKeys], |
|
|
|
rowExpandable: (record) => true, |
|
|
|
}} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
{isModalOpen && ( |
|
|
|
<AddExperimentModal |
|
|
|
isAdd={isAdd} |
|
|
|
|