chore: change yaml rendering to be an option and enable for kubernetes plugin FE components

Signed-off-by: Chris Langhout <clanghout@bol.com>
This commit is contained in:
Chris Langhout
2025-01-04 16:01:35 +02:00
committed by blam
parent 58e1383241
commit b6c5ea2aba
9 changed files with 131 additions and 24 deletions
@@ -58,6 +58,7 @@ export const ClusterOverview = () => {
'OIDC Token Provider': value.oidcTokenProvider ?? 'N/A',
'Dashboard Link': value.dashboardUrl ?? 'N/A',
}}
options={{ nestedValuesAsYaml: true }}
/>
)}
</InfoCard>
@@ -50,7 +50,10 @@ const defaultColumns: TableColumn<INode>[] = [
<Grid container>
<Grid item xs={12}>
<Typography variant="h5">Node Info</Typography>
<StructuredMetadataTable metadata={node.status?.nodeInfo ?? {}} />
<StructuredMetadataTable
metadata={node.status?.nodeInfo ?? {}}
options={{ nestedValuesAsYaml: true }}
/>
</Grid>
<Grid item xs={12}>
<Typography variant="h5">Addresses</Typography>
@@ -61,6 +64,7 @@ const defaultColumns: TableColumn<INode>[] = [
return accum;
}, {} as any) ?? {}
}
options={{ nestedValuesAsYaml: true }}
/>
</Grid>
<Grid item xs={12}>
@@ -72,6 +76,7 @@ const defaultColumns: TableColumn<INode>[] = [
return accum;
}, {} as any) ?? {}
}
options={{ nestedValuesAsYaml: true }}
/>
</Grid>
</Grid>
@@ -84,7 +84,10 @@ const DefaultCustomResourceAccordion = ({
</AccordionSummary>
<AccordionDetails>
{Object.prototype.hasOwnProperty.call(customResource, 'status') && (
<StructuredMetadataTable metadata={customResource.status} />
<StructuredMetadataTable
metadata={customResource.status}
options={{ nestedValuesAsYaml: true }}
/>
)}
</AccordionDetails>
</Accordion>
@@ -65,6 +65,9 @@ const IngressCard = ({ ingress }: IngressCardProps) => {
metadata={{
...ingress.spec,
}}
options={{
nestedValuesAsYaml: true,
}}
/>
);
};
@@ -237,6 +237,7 @@ const KubernetesStructuredMetadataTableDrawerContent = <
{!isYaml && (
<StructuredMetadataTable
metadata={renderObject(replaceNullsWithUndefined(object))}
options={{ nestedValuesAsYaml: true }}
/>
)}
</div>
@@ -176,6 +176,7 @@ export const ContainerCard: React.FC<ContainerCardProps> = ({
containerSpec,
containerStatus,
)}
options={{ nestedValuesAsYaml: true }}
/>
</Grid>
{containerMetrics && (
@@ -77,6 +77,7 @@ const ServiceCard = ({ service }: ServiceCardProps) => {
ports: service.spec?.ports,
...metadata,
}}
options={{ nestedValuesAsYaml: true }}
/>
);
};