| 1 |
import { |
| 2 |
Card, |
| 3 |
CardTitle, |
| 4 |
CardBody, |
| 5 |
CardFooter, |
| 6 |
Title, |
| 7 |
Gallery, |
| 8 |
GalleryItem, |
| 9 |
Flex, |
| 10 |
FlexItem, |
| 11 |
Stack, |
| 12 |
Divider |
| 13 |
} from '@patternfly/react-core'; |
| 14 |
import { ChartArea, ChartGroup, ChartVoronoiContainer } from '@patternfly/react-charts/victory'; |
| 15 |
|
| 16 |
export const CardUtilizationDemo1: React.FunctionComponent = () => ( |
| 17 |
<Gallery hasGutter minWidths={{ default: '360px' }}> |
| 18 |
<GalleryItem> |
| 19 |
<Card id="utilization-card-1-card" component="div"> |
| 20 |
<CardTitle> |
| 21 |
<Title headingLevel="h4" size="lg"> |
| 22 |
Top Utilized Clusters |
| 23 |
</Title> |
| 24 |
</CardTitle> |
| 25 |
<CardBody> |
| 26 |
<Flex direction={{ default: 'column' }}> |
| 27 |
<FlexItem> |
| 28 |
<Stack> |
| 29 |
<b>Cluster-1204</b> |
| 30 |
<span>27.3 cores available</span> |
| 31 |
</Stack> |
| 32 |
</FlexItem> |
| 33 |
<FlexItem> |
| 34 |
<ChartGroup |
| 35 |
ariaDesc="Mock average cluster utilization" |
| 36 |
ariaTitle="Mock cluster sparkline chart" |
| 37 |
containerComponent={ |
| 38 |
<ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}`} constrainToVisibleArea /> |
| 39 |
} |
| 40 |
height={100} |
| 41 |
maxDomain={{ y: 9 }} |
| 42 |
padding={0} |
| 43 |
width={400} |
| 44 |
> |
| 45 |
<ChartArea |
| 46 |
data={[ |
| 47 |
{ name: 'Cluster', x: '2015', y: 7 }, |
| 48 |
{ name: 'Cluster', x: '2016', y: 6 }, |
| 49 |
{ name: 'Cluster', x: '2017', y: 8 }, |
| 50 |
{ name: 'Cluster', x: '2018', y: 3 }, |
| 51 |
{ name: 'Cluster', x: '2019', y: 4 }, |
| 52 |
{ name: 'Cluster', x: '2020', y: 1 }, |
| 53 |
{ name: 'Cluster', x: '2021', y: 0 } |
| 54 |
]} |
| 55 |
/> |
| 56 |
</ChartGroup> |
| 57 |
</FlexItem> |
| 58 |
<FlexItem> |
| 59 |
<a href="#">View details</a> |
| 60 |
</FlexItem> |
| 61 |
</Flex> |
| 62 |
</CardBody> |
| 63 |
<CardBody> |
| 64 |
<Flex direction={{ default: 'column' }}> |
| 65 |
<FlexItem> |
| 66 |
<Stack> |
| 67 |
<b>Abcdef-1204</b> |
| 68 |
<span>50.6 cores available</span> |
| 69 |
</Stack> |
| 70 |
</FlexItem> |
| 71 |
<FlexItem> |
| 72 |
<ChartGroup |
| 73 |
ariaDesc="Mock average cluster utilization" |
| 74 |
ariaTitle="Mock cluster sparkline chart" |
| 75 |
containerComponent={ |
| 76 |
<ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}`} constrainToVisibleArea /> |
| 77 |
} |
| 78 |
height={100} |
| 79 |
maxDomain={{ y: 9 }} |
| 80 |
padding={0} |
| 81 |
width={400} |
| 82 |
> |
| 83 |
<ChartArea |
| 84 |
data={[ |
| 85 |
{ name: 'Cluster', x: '2015', y: 7 }, |
| 86 |
{ name: 'Cluster', x: '2016', y: 6 }, |
| 87 |
{ name: 'Cluster', x: '2017', y: 8 }, |
| 88 |
{ name: 'Cluster', x: '2018', y: 3 }, |
| 89 |
{ name: 'Cluster', x: '2019', y: 4 }, |
| 90 |
{ name: 'Cluster', x: '2020', y: 1 }, |
| 91 |
{ name: 'Cluster', x: '2021', y: 0 } |
| 92 |
]} |
| 93 |
/> |
| 94 |
</ChartGroup> |
| 95 |
</FlexItem> |
| 96 |
<FlexItem> |
| 97 |
<a href="#">View details</a> |
| 98 |
</FlexItem> |
| 99 |
</Flex> |
| 100 |
</CardBody> |
| 101 |
<Divider /> |
| 102 |
<CardFooter> |
| 103 |
<a href="#">View all clusters</a> |
| 104 |
</CardFooter> |
| 105 |
</Card> |
| 106 |
</GalleryItem> |
| 107 |
</Gallery> |
| 108 |
); |