|
1 | 1 | import React, { useEffect, useState } from "react";
|
2 | 2 | import { useSelector } from "react-redux";
|
3 |
| -import { Button, Card, Col, Container, Row, Stack } from "react-bootstrap"; |
4 |
| -import ArtifactListItem from "#/Artifacts/ArtifactListItem"; |
| 3 | +import { Button, Card, Container, Row, Stack } from "react-bootstrap"; |
| 4 | +import ArtifactCol from "#/Artifacts/ArtifactCol"; |
| 5 | +import ArtifactTitle from "#/Artifacts/ArtifactTitle"; |
5 | 6 | import LatestBadge from "#/Artifacts/LatestBadge";
|
6 | 7 | import CertificateModal from "#/CertificateModal";
|
7 | 8 | import LocalDateTime from "#/LocalDateTime";
|
@@ -60,61 +61,56 @@ export default function CardanoDbV2SnapshotsList(props) {
|
60 | 61 | {Object.entries(cardanoDbSnapshots).length === 0 ? (
|
61 | 62 | <p>No cardano database snapshot available</p>
|
62 | 63 | ) : (
|
63 |
| - <Container fluid> |
64 |
| - <Row xs={1} md={2} lg={3} xl={4}> |
65 |
| - {cardanoDbSnapshots.map((cdb_snapshot, index) => ( |
66 |
| - <Col key={cdb_snapshot.hash} className="mb-2"> |
67 |
| - <Card border={index === 0 ? "primary" : ""}> |
68 |
| - <Card.Body> |
69 |
| - <Card.Title>{cdb_snapshot.hash}</Card.Title> |
70 |
| - <ArtifactListItem label="Epoch">{cdb_snapshot.beacon.epoch}</ArtifactListItem> |
71 |
| - <ArtifactListItem label="Immutable file number"> |
| 64 | + <Stack className="mx-2" gap={2}> |
| 65 | + {cardanoDbSnapshots.map((cdb_snapshot, index) => ( |
| 66 | + <Card border={index === 0 ? "primary" : ""} key={cdb_snapshot.hash}> |
| 67 | + <Card.Body className="pt-2 pb-1"> |
| 68 | + <ArtifactTitle hash={cdb_snapshot.hash} index={index} /> |
| 69 | + <Container fluid> |
| 70 | + <Row> |
| 71 | + <ArtifactCol label="Epoch">{cdb_snapshot.beacon.epoch}</ArtifactCol> |
| 72 | + <ArtifactCol label="Immutable file number"> |
72 | 73 | {cdb_snapshot.beacon.immutable_file_number}
|
73 |
| - </ArtifactListItem> |
74 |
| - <ArtifactListItem label="Merkle Root" wordBreak vertical> |
75 |
| - {cdb_snapshot.merkle_root} |
76 |
| - </ArtifactListItem> |
77 |
| - <ArtifactListItem label="Cardano node"> |
78 |
| - {cdb_snapshot.cardano_node_version} |
79 |
| - </ArtifactListItem> |
80 |
| - <ArtifactListItem label="Compression"> |
81 |
| - {cdb_snapshot.compression_algorithm} |
82 |
| - </ArtifactListItem> |
83 |
| - <ArtifactListItem label="Certificate hash" wordBreak vertical> |
84 |
| - {cdb_snapshot.certificate_hash}{" "} |
85 |
| - <Button |
86 |
| - size="sm" |
87 |
| - onClick={() => showCertificate(cdb_snapshot.certificate_hash)}> |
88 |
| - Show |
89 |
| - </Button> |
90 |
| - </ArtifactListItem> |
91 |
| - <ArtifactListItem label="Created"> |
| 74 | + </ArtifactCol> |
| 75 | + <ArtifactCol label="Created"> |
92 | 76 | <LocalDateTime datetime={cdb_snapshot.created_at} />
|
93 |
| - </ArtifactListItem> |
94 |
| - <ArtifactListItem label="DB size"> |
| 77 | + </ArtifactCol> |
| 78 | + <ArtifactCol label="DB size"> |
95 | 79 | {formatBytes(cdb_snapshot.total_db_size_uncompressed)}{" "}
|
96 | 80 | <QuestionTooltip tooltip="Total uncompressed database size" />
|
97 |
| - </ArtifactListItem> |
98 |
| - </Card.Body> |
99 |
| - <Card.Footer> |
100 |
| - <Stack direction="horizontal" gap={1}> |
101 |
| - <LatestBadge show={index === 0} /> |
102 |
| - <DownloadButton |
103 |
| - size="sm" |
104 |
| - className="ms-auto" |
105 |
| - artifactUrl={`${artifactsEndpoint}/${cdb_snapshot.hash}`} |
106 |
| - /> |
107 |
| - <RawJsonButton |
108 |
| - href={`${artifactsEndpoint}/${cdb_snapshot.hash}`} |
109 |
| - size="sm" |
110 |
| - /> |
111 |
| - </Stack> |
112 |
| - </Card.Footer> |
113 |
| - </Card> |
114 |
| - </Col> |
115 |
| - ))} |
116 |
| - </Row> |
117 |
| - </Container> |
| 81 | + </ArtifactCol> |
| 82 | + <ArtifactCol label="Cardano node"> |
| 83 | + {cdb_snapshot.cardano_node_version} |
| 84 | + </ArtifactCol> |
| 85 | + <ArtifactCol label="Compression"> |
| 86 | + {cdb_snapshot.compression_algorithm} |
| 87 | + </ArtifactCol> |
| 88 | + <ArtifactCol label="Merkle Root">{cdb_snapshot.merkle_root}</ArtifactCol> |
| 89 | + <ArtifactCol label="Certificate hash"> |
| 90 | + {cdb_snapshot.certificate_hash} |
| 91 | + </ArtifactCol> |
| 92 | + </Row> |
| 93 | + </Container> |
| 94 | + </Card.Body> |
| 95 | + <Card.Footer> |
| 96 | + <Stack direction="horizontal" gap={1}> |
| 97 | + <LatestBadge show={index === 0} /> |
| 98 | + <Button |
| 99 | + size="sm" |
| 100 | + className="ms-auto" |
| 101 | + onClick={() => showCertificate(cdb_snapshot.certificate_hash)}> |
| 102 | + Show Certificate |
| 103 | + </Button> |
| 104 | + <DownloadButton |
| 105 | + size="sm" |
| 106 | + artifactUrl={`${artifactsEndpoint}/${cdb_snapshot.hash}`} |
| 107 | + /> |
| 108 | + <RawJsonButton href={`${artifactsEndpoint}/${cdb_snapshot.hash}`} size="sm" /> |
| 109 | + </Stack> |
| 110 | + </Card.Footer> |
| 111 | + </Card> |
| 112 | + ))} |
| 113 | + </Stack> |
118 | 114 | )}
|
119 | 115 | </div>
|
120 | 116 | </>
|
|
0 commit comments