Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/components/allocationReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ function stableSort(array, comparator) {
return stabilizedThis.map((el) => el[0]);
}

// ✅ Helper function to build display name with namespace
function getDisplayName(row) {
if (row.namespace) {
return `${row.namespace}:${row.name}`;
}
return row.name;
}

const headCells = [
{ id: "name", numeric: false, label: "Name", width: "auto" },
{ id: "cpuCost", numeric: true, label: "CPU", width: 90 },
Expand Down Expand Up @@ -159,6 +167,7 @@ const AllocationReport = ({
);
})}
</TableRow>

{pageRows.map((row, key) => {
if (row.name === "__unmounted__") {
row.name = "Unmounted PVs";
Expand All @@ -178,11 +187,10 @@ const AllocationReport = ({
efficiency = "Inf";
}

// Do not allow drill-down for idle and unallocated rows
if (isIdle || isUnallocated || isUnmounted) {
return (
<TableRow key={key}>
<TableCell align="left">{row.name}</TableCell>
<TableCell align="left">{getDisplayName(row)}</TableCell>
<TableCell align="right">
{toCurrency(row.cpuCost, currency)}
</TableCell>
Expand All @@ -209,7 +217,7 @@ const AllocationReport = ({

return (
<TableRow key={key}>
<TableCell align="left">{row.name}</TableCell>
<TableCell align="left">{getDisplayName(row)}</TableCell>
<TableCell align="right">
{toCurrency(row.cpuCost, currency)}
</TableCell>
Expand Down