Skip to content

Commit 697b60e

Browse files
committed
feat: integrate Redfish node UI tabs into NodeDetails component
1 parent f4ca266 commit 697b60e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/ClusterNodes/NodeDetails.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ const NodeDetails = ({ addTab, lowercaseKindToResourceGroupMap, updateTabUrl }:
259259
label: NODE_DETAILS_TABS.summary,
260260
node: renderSummary,
261261
},
262+
...REDFISH_NODE_UI_TABS,
262263
{
263264
id: getSanitizedNodeTabId(NODE_DETAILS_TABS.yaml),
264265
label: NODE_DETAILS_TABS.yaml,
@@ -270,7 +271,6 @@ const NodeDetails = ({ addTab, lowercaseKindToResourceGroupMap, updateTabUrl }:
270271
label: NODE_DETAILS_TABS.nodeConditions,
271272
node: renderConditions,
272273
},
273-
...REDFISH_NODE_UI_TABS,
274274
]
275275

276276
useEffect(() => {
@@ -824,7 +824,9 @@ const NodeDetails = ({ addTab, lowercaseKindToResourceGroupMap, updateTabUrl }:
824824
}
825825

826826
const renderTabControls = () => {
827-
if (selectedTabIndex == 0) {
827+
const selectedTab = NODE_TABS_INFO[selectedTabIndex]
828+
829+
if (selectedTab.id === getSanitizedNodeTabId(NODE_DETAILS_TABS.summary)) {
828830
return (
829831
<>
830832
<span className="flex left fw-6 cb-5 fs-12 cursor" onClick={showCordonNodeModal}>
@@ -851,7 +853,7 @@ const NodeDetails = ({ addTab, lowercaseKindToResourceGroupMap, updateTabUrl }:
851853
</>
852854
)
853855
}
854-
if (selectedTabIndex == 1) {
856+
if (selectedTab.id === getSanitizedNodeTabId(NODE_DETAILS_TABS.yaml)) {
855857
if (!isEdit) {
856858
return (
857859
<span className="cb-5 fs-12 scb-5 fw-6 cursor flex" onClick={setYAMLEdit}>

0 commit comments

Comments
 (0)