From c9a1999f5fa74cf0369f70756e9930c9f6d7af24 Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Mon, 25 Jul 2022 10:38:43 +0800 Subject: [PATCH] fix: fix the heat tab in the system info When the heat service is diabled, hide the heat tab in the system info Change-Id: I87cd2dbdc7c3213accd6f6944a3cd84683fcbba7 --- .../containers/SystemInfo/index.jsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/pages/configuration/containers/SystemInfo/index.jsx b/src/pages/configuration/containers/SystemInfo/index.jsx index 8c2fd793..7b996679 100644 --- a/src/pages/configuration/containers/SystemInfo/index.jsx +++ b/src/pages/configuration/containers/SystemInfo/index.jsx @@ -25,6 +25,10 @@ export class Service extends Base { return this.props.rootStore.checkEndpoint('cinder'); } + get enableHeat() { + return this.props.rootStore.checkEndpoint('heat'); + } + get tabs() { const tabs = [ { @@ -42,19 +46,21 @@ export class Service extends Base { key: 'neutronAgent', component: NeutronAgent, }, - { - title: t('Orchestration Services'), - key: 'heatService', - component: HeatService, - }, ]; if (this.enableCinder) { - tabs.splice(3, 0, { + tabs.push({ title: t('Block Storage Services'), key: 'cinderService', component: CinderService, }); } + if (this.enableHeat) { + tabs.push({ + title: t('Orchestration Services'), + key: 'heatService', + component: HeatService, + }); + } return tabs; } }