mirror of https://github.com/rancher/ui.git
Conditionally show node links in CIS Scans
If nodes have been deleted previous reports with missing nodes were breaking. To resolve that we now only show links to nodes that we can find. rancher/rancher#24676
This commit is contained in:
parent
ded77b7208
commit
867239fa1b
|
|
@ -76,11 +76,16 @@ export default Controller.extend({
|
|||
const state = this.getCheckState(test);
|
||||
const nodeNames = get(this, 'model.scan').getNodeNamesFromNodeType(test.node_type);
|
||||
const checkNodes = test.nodes || [];
|
||||
const nodes = nodeNames.map((nodeName) => ({
|
||||
const nodes = nodeNames.map((nodeName) => {
|
||||
const node = get(this, 'model.nodes').findBy('nodeName', nodeName);
|
||||
const nodeId = node ? node.id : null;
|
||||
|
||||
return {
|
||||
state: this.getNodeState(test, nodeName, checkNodes),
|
||||
nodeId: get(this, 'model.nodes').findBy('nodeName', nodeName).id,
|
||||
nodeId,
|
||||
name: nodeName
|
||||
}));
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
state,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
<tr class="main-row">
|
||||
<td width="100" class="pl-15 pr-15 vertical-top pt-15"><BadgeState @model={{badgeState}} class="text-center full-width" /></td>
|
||||
<td><a href="{{href-to 'authenticated.cluster.monitoring.node-detail' scope.currentCluster.id model.nodeId}}">{{model.name}}</a></td>
|
||||
<td>
|
||||
{{#if model.nodeId}}
|
||||
<a href="{{href-to 'authenticated.cluster.monitoring.node-detail' scope.currentCluster.id model.nodeId}}">{{model.name}}</a>
|
||||
{{else}}
|
||||
{{model.name}} - {{t 'cis.scan.detail.table.nodesTable.notAvailable'}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -1074,6 +1074,7 @@ cis:
|
|||
unskip: Unskip
|
||||
nodesTable:
|
||||
title: Nodes
|
||||
notAvailable: Node is not part of the cluster
|
||||
row:
|
||||
remediation: "Remediation: {remediation}"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue