-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui): make data process instance visible in container in V2& fix m…
…odel/modelgroup names (#12513)
- Loading branch information
1 parent
d2b0e57
commit 469cc4f
Showing
11 changed files
with
142 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
...hub-web-react/src/app/entityV2/dataProcessInstance/profile/DataProcessInstanceSummary.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { Space, Table, Typography } from 'antd'; | ||
import { formatDetailedDuration } from '@src/app/shared/time/timeUtils'; | ||
import { capitalize } from 'lodash'; | ||
import moment from 'moment'; | ||
import { MlHyperParam, MlMetric, DataProcessInstanceRunResultType } from '../../../../types.generated'; | ||
import { useBaseEntity } from '../../../entity/shared/EntityContext'; | ||
import { InfoItem } from '../../shared/components/styled/InfoItem'; | ||
import { GetDataProcessInstanceQuery } from '../../../../graphql/dataProcessInstance.generated'; | ||
import { Pill } from '../../../../alchemy-components/components/Pills'; | ||
|
||
const TabContent = styled.div` | ||
padding: 16px; | ||
`; | ||
|
||
const InfoItemContainer = styled.div<{ justifyContent }>` | ||
display: flex; | ||
position: relative; | ||
justify-content: ${(props) => props.justifyContent}; | ||
padding: 0px 2px; | ||
`; | ||
|
||
const InfoItemContent = styled.div` | ||
padding-top: 8px; | ||
width: 100px; | ||
`; | ||
|
||
const propertyTableColumns = [ | ||
{ | ||
title: 'Name', | ||
dataIndex: 'name', | ||
width: 450, | ||
}, | ||
{ | ||
title: 'Value', | ||
dataIndex: 'value', | ||
}, | ||
]; | ||
|
||
export default function DataProcessInstanceSummary() { | ||
const baseEntity = useBaseEntity<GetDataProcessInstanceQuery>(); | ||
const dpi = baseEntity?.dataProcessInstance; | ||
|
||
const formatStatus = (state) => { | ||
if (!state || state.length === 0) return '-'; | ||
const result = state[0]?.result?.resultType; | ||
const statusColor = result === DataProcessInstanceRunResultType.Success ? 'green' : 'red'; | ||
return <Pill label={capitalize(result)} colorScheme={statusColor} clickable={false} />; | ||
}; | ||
|
||
const formatDuration = (state) => { | ||
if (!state || state.length === 0) return '-'; | ||
return formatDetailedDuration(state[0]?.durationMillis); | ||
}; | ||
|
||
return ( | ||
<TabContent> | ||
<Space direction="vertical" style={{ width: '100%' }} size="large"> | ||
<Typography.Title level={3}>Details</Typography.Title> | ||
<InfoItemContainer justifyContent="left"> | ||
<InfoItem title="Created At"> | ||
<InfoItemContent> | ||
{dpi?.properties?.created?.time | ||
? moment(dpi.properties.created.time).format('YYYY-MM-DD HH:mm:ss') | ||
: '-'} | ||
</InfoItemContent> | ||
</InfoItem> | ||
<InfoItem title="Status"> | ||
<InfoItemContent>{formatStatus(dpi?.state)}</InfoItemContent> | ||
</InfoItem> | ||
<InfoItem title="Duration"> | ||
<InfoItemContent>{formatDuration(dpi?.state)}</InfoItemContent> | ||
</InfoItem> | ||
<InfoItem title="Run ID"> | ||
<InfoItemContent>{dpi?.mlTrainingRunProperties?.id}</InfoItemContent> | ||
</InfoItem> | ||
<InfoItem title="Created By"> | ||
<InfoItemContent>{dpi?.properties?.created?.actor}</InfoItemContent> | ||
</InfoItem> | ||
</InfoItemContainer> | ||
<InfoItemContainer justifyContent="left"> | ||
<InfoItem title="Artifacts Location"> | ||
<InfoItemContent>{dpi?.mlTrainingRunProperties?.outputUrls}</InfoItemContent> | ||
</InfoItem> | ||
</InfoItemContainer> | ||
<Typography.Title level={3}>Training Metrics</Typography.Title> | ||
<Table | ||
pagination={false} | ||
columns={propertyTableColumns} | ||
dataSource={dpi?.mlTrainingRunProperties?.trainingMetrics as MlMetric[]} | ||
/> | ||
<Typography.Title level={3}>Hyper Parameters</Typography.Title> | ||
<Table | ||
pagination={false} | ||
columns={propertyTableColumns} | ||
dataSource={dpi?.mlTrainingRunProperties?.hyperParams as MlHyperParam[]} | ||
/> | ||
</Space> | ||
</TabContent> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters