Skip to content

Commit

Permalink
fix non-matched rule also show matched node
Browse files Browse the repository at this point in the history
Signed-off-by: a110605 <[email protected]>
  • Loading branch information
a110605 authored and torchiaf committed Jul 5, 2024
1 parent eafc5ad commit 01f7298
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions pkg/harvester/edit/network.harvesterhci.io.vlanconfig/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ export default {
matchNICs = allNICs.filter(n => matchNodes.includes(n.nodeName));
commonNodes = matchNodes.map(n => n.id);
}
this.matchNICs = this.intersection(matchNICs, commonNodes) || [];
}, 250, { leading: true }),
Expand Down Expand Up @@ -314,12 +313,21 @@ export default {
} else if (selector[HOSTNAME] && Object.keys(selector).length === 1) {
const matchNode = allNodes.find(n => n.id === selector[HOSTNAME]);
this.matchingNodes = {
matched: 1,
total: allNodes.length,
none: false,
sample: matchNode ? matchNode.nameDisplay : selector[HOSTNAME],
};
if (matchNode) {
this.matchingNodes = {
matched: 1,
total: allNodes.length,
none: false,
sample: matchNode.nameDisplay,
};
} else {
this.matchingNodes = {
matched: 0,
total: 0,
none: true,
sample: null,
};
}
} else {
const match = matching(allNodes, selector);
Expand Down

0 comments on commit 01f7298

Please sign in to comment.