Skip to content

Commit

Permalink
hide allocated models when missing
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Oct 26, 2021
1 parent d635dae commit 9d1516e
Showing 1 changed file with 37 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,43 +79,45 @@ export const ExpandedRow: FC<ExpandedRowProps> = ({ item }) => {

<EuiSpacer size={'m'} />

<EuiPanel>
<EuiTitle size={'xs'}>
<h5>
<FormattedMessage
id="xpack.ml.trainedModels.nodesList.expandedRow.allocatedModelsTitle"
defaultMessage="Allocated models"
/>
</h5>
</EuiTitle>
<EuiSpacer size={'m'} />
{allocatedModels.length > 0 ? (
<EuiPanel>
<EuiTitle size={'xs'}>
<h5>
<FormattedMessage
id="xpack.ml.trainedModels.nodesList.expandedRow.allocatedModelsTitle"
defaultMessage="Allocated models"
/>
</h5>
</EuiTitle>
<EuiSpacer size={'m'} />

{allocatedModels.map(({ model_id: modelId, ...rest }) => {
return (
<>
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiTitle size="xxs">
<EuiTextColor color="subdued">
<h5>{modelId}</h5>
</EuiTextColor>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem>
<EuiHorizontalRule size={'full'} margin={'s'} />
</EuiFlexItem>
</EuiFlexGroup>
{allocatedModels.map(({ model_id: modelId, ...rest }) => {
return (
<>
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiTitle size="xxs">
<EuiTextColor color="subdued">
<h5>{modelId}</h5>
</EuiTextColor>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem>
<EuiHorizontalRule size={'full'} margin={'s'} />
</EuiFlexItem>
</EuiFlexGroup>

<EuiDescriptionList
compressed={true}
type="column"
listItems={formatToListItems(rest)}
/>
<EuiSpacer size={'s'} />
</>
);
})}
</EuiPanel>
<EuiDescriptionList
compressed={true}
type="column"
listItems={formatToListItems(rest)}
/>
<EuiSpacer size={'s'} />
</>
);
})}
</EuiPanel>
) : null}
</EuiFlexItem>
</EuiFlexGrid>
</>
Expand Down

0 comments on commit 9d1516e

Please sign in to comment.