ui: show available Fedora versions per package in the list
All checks were successful
deploy-ui / build-and-deploy (push) Successful in 30s
All checks were successful
deploy-ui / build-and-deploy (push) Successful in 30s
This commit is contained in:
@@ -14,12 +14,14 @@ export function PackageList() {
|
|||||||
const summaries = [...byName.entries()].map(([name, versions]) => {
|
const summaries = [...byName.entries()].map(([name, versions]) => {
|
||||||
const stable = versions.filter((v) => v.channel === "stable");
|
const stable = versions.filter((v) => v.channel === "stable");
|
||||||
const unstable = versions.filter((v) => v.channel === "unstable");
|
const unstable = versions.filter((v) => v.channel === "unstable");
|
||||||
|
const releasevers = [...new Set(versions.map((v) => v.releasever))].sort();
|
||||||
const latest = versions.reduce((a, b) =>
|
const latest = versions.reduce((a, b) =>
|
||||||
a.buildTime >= b.buildTime ? a : b,
|
a.buildTime >= b.buildTime ? a : b,
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
latest,
|
latest,
|
||||||
|
releasevers,
|
||||||
stableCount: stable.length,
|
stableCount: stable.length,
|
||||||
unstableCount: unstable.length,
|
unstableCount: unstable.length,
|
||||||
versionCount: versions.length,
|
versionCount: versions.length,
|
||||||
@@ -35,35 +37,45 @@ export function PackageList() {
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Package</th>
|
<th>Package</th>
|
||||||
<th>Latest version</th>
|
<th>Latest version</th>
|
||||||
|
<th>Fedora</th>
|
||||||
<th>Versions</th>
|
<th>Versions</th>
|
||||||
<th>Summary</th>
|
<th>Summary</th>
|
||||||
<th>Built</th>
|
<th>Built</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{summaries.map(({ name, latest, stableCount, unstableCount }) => (
|
{summaries.map(
|
||||||
<tr key={name}>
|
({ name, latest, releasevers, stableCount, unstableCount }) => (
|
||||||
<td>
|
<tr key={name}>
|
||||||
<Link to={`/packages/${name}`}>{name}</Link>
|
<td>
|
||||||
</td>
|
<Link to={`/packages/${name}`}>{name}</Link>
|
||||||
<td>
|
</td>
|
||||||
{latest.version}-{latest.release}{" "}
|
<td>
|
||||||
<Badge bg={latest.channel === "stable" ? "success" : "warning"} className="ms-1">
|
{latest.version}-{latest.release}{" "}
|
||||||
{latest.channel}
|
<Badge bg={latest.channel === "stable" ? "success" : "warning"} className="ms-1">
|
||||||
</Badge>
|
{latest.channel}
|
||||||
</td>
|
</Badge>
|
||||||
<td>
|
</td>
|
||||||
{stableCount > 0 && (
|
<td>
|
||||||
<Badge bg="success" className="me-1">{stableCount} stable</Badge>
|
{releasevers.map((rv) => (
|
||||||
)}
|
<Badge key={rv} bg="secondary" className="me-1">
|
||||||
{unstableCount > 0 && (
|
fc{rv}
|
||||||
<Badge bg="warning">{unstableCount} unstable</Badge>
|
</Badge>
|
||||||
)}
|
))}
|
||||||
</td>
|
</td>
|
||||||
<td>{latest.summary}</td>
|
<td>
|
||||||
<td>{new Date(latest.buildTime * 1000).toLocaleDateString()}</td>
|
{stableCount > 0 && (
|
||||||
</tr>
|
<Badge bg="success" className="me-1">{stableCount} stable</Badge>
|
||||||
))}
|
)}
|
||||||
|
{unstableCount > 0 && (
|
||||||
|
<Badge bg="warning">{unstableCount} unstable</Badge>
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
<td>{latest.summary}</td>
|
||||||
|
<td>{new Date(latest.buildTime * 1000).toLocaleDateString()}</td>
|
||||||
|
</tr>
|
||||||
|
),
|
||||||
|
)}
|
||||||
</tbody>
|
</tbody>
|
||||||
</Table>
|
</Table>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user