diff --git a/src/fireedge/src/client/components/Tabs/index.js b/src/fireedge/src/client/components/Tabs/index.js index 6bd4302751..6e232e6893 100644 --- a/src/fireedge/src/client/components/Tabs/index.js +++ b/src/fireedge/src/client/components/Tabs/index.js @@ -49,6 +49,8 @@ const Content = ({ renderContent: RenderContent, hidden, addBorder = false, + setTab, + logTabId, }) => ( {typeof RenderContent === 'function' ? ( - + ) : ( RenderContent )} @@ -129,6 +131,12 @@ const Tabs = ({ [tabSelected] ) + const logTabId = tabs + .map(function (tabProps) { + return tabProps.name + }) + .indexOf('log') + return ( @@ -139,7 +147,9 @@ const Tabs = ({ ) : ( (value ?? idx) === tabSelected)} + logTabId={logTabId} /> )} @@ -162,6 +172,8 @@ Content.propTypes = { renderContent: PropTypes.oneOfType([PropTypes.object, PropTypes.func]), hidden: PropTypes.bool, addBorder: PropTypes.bool, + setTab: PropTypes.func, + logTabId: PropTypes.number, } export default Tabs diff --git a/src/fireedge/src/client/containers/Provisions/DialogInfo/hosts.js b/src/fireedge/src/client/containers/Provisions/DialogInfo/hosts.js index edcb983406..c73fff4696 100644 --- a/src/fireedge/src/client/containers/Provisions/DialogInfo/hosts.js +++ b/src/fireedge/src/client/containers/Provisions/DialogInfo/hosts.js @@ -38,7 +38,7 @@ import { SubmitButton } from 'client/components/FormControl' import { Translate } from 'client/components/HOC' import { T } from 'client/constants' -const Hosts = memo(({ id }) => { +const Hosts = memo(({ id, setTab, logTabId }) => { const [amount, setAmount] = useState(() => 1) const { enqueueInfo } = useGeneralApi() @@ -113,6 +113,7 @@ const Hosts = memo(({ id }) => { onClick={async () => { configureHost({ provision: id, id: host.ID }) enqueueInfo(`Configuring host - ID: ${host.ID}`) + setTab(logTabId) }} /> { ) }) -Hosts.propTypes = { id: PropTypes.string.isRequired } +Hosts.propTypes = { + id: PropTypes.string.isRequired, + setTab: PropTypes.func, + logTabId: PropTypes.number, +} Hosts.displayName = 'Hosts' export default Hosts diff --git a/src/fireedge/src/client/containers/Provisions/DialogInfo/index.js b/src/fireedge/src/client/containers/Provisions/DialogInfo/index.js index 3d187478ee..e79dc8bcaa 100644 --- a/src/fireedge/src/client/containers/Provisions/DialogInfo/index.js +++ b/src/fireedge/src/client/containers/Provisions/DialogInfo/index.js @@ -63,7 +63,9 @@ const DialogInfo = ({ id }) => { name: 'hosts', label: T.Hosts, icon: HostIcon, - renderContent: () => , + renderContent: ({ setTab, logTabId }) => ( + + ), }, { name: 'log',