{"version":3,"sources":["webpack:///./app/components/NodeView/k8s/messages.js","webpack:///./app/components/NodeView/k8s/K8sInfrastructure.js","webpack:///./app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/constants.js","webpack:///./app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/reducers.js","webpack:///./app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/actions.js","webpack:///./app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/sagas.js","webpack:///./app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/selectors.js","webpack:///./app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/messages.js","webpack:///./app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/K8sClusterContents.js","webpack:///./app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/index.js"],"names":["defineMessages","clusterInfraLoadError","id","defaultMessage","infrastructureSectionHeader","SquareLoadingAnimation","K8sInfrastructure","props","clusterInfrastructure","get","map","row","_","pick","toJS","DynamicFormattedMessage","messages","tableData","getTableData","DataTable","data","console","warn","BorderedCard","style","height","SectionHeader","this","renderBody","Component","GET_CLUSTER_CONTENTS","GET_CLUSTER_CONTENTS_SUCCESS","GET_CLUSTER_CONTENTS_ERROR","GET_CLUSTER_INFRASTRUCTURE","initialState","fromJS","clusterContents","error","loading","k8sClusterNodeViewReducer","handleActions","state","setIn","payload","getClusterContents","createAction","getClusterContentsSuccess","getClusterContentsError","getClusterInfrastructure","getClusterInfrastructureSuccess","getClusterInfrastructureError","k8sClusterNodeViewSaga","GET_CLUST_CONTENT","gql","action","srn","getClient","client","query","variables","result","path","join","put","GET_CLUSTER_INFRA_QUERY","all","takeLatest","selectK8sClusterNodeView","Map","selectClusterContents","createSelector","selectClusterInfrastructure","errorLoadingClusterContents","Breadcrumb","K8sClusterContents","prevProps","prevState","viewingNamespace","gridAPI","redrawRows","setState","namespace","api","contains","items","item","label","filter","includes","reduce","acc","cur","Workload","NetworkComponent","User","getCountOfContainedStuff","type","viewWorkloads","find","workloads","getIn","gotoNodeView","breadCrumbItems","push","TextLink","color","onClick","clearViewingNamespace","getWorkloadData","getNamespaceData","sortBy","name","onLoad","onGridLoad","customColumnConfig","width","minWidth","headerName","maxWidth","pinned","suppressMenu","cellRendererFramework","params","value","nodeType","getTypeFromSrn","urlParams","getNodeViewPushParams","handleClickViewWorkloads","renderBreadCrumb","K8sClusterNodeViewCardLayout","namespaces","lg","w","h","xs","infrastructure","styled","div","nodeId","NodeViewHeader","onNodeView","horizontal","className","NodeView","renderDetailsTab","layouts","getLayouts","cols","getCols","gridContent","getGridContent","tabs","getTabs","mapStateToProps","createStructuredSelector","withConnect","connect","dispatch","bindActionCreators","withReducer","injectReducer","key","reducer","withSaga","injectSaga","saga","sagas","DAEMON","compose"],"mappings":"6kBAEeA,4BAAe,CAC5BC,sBAAuB,CACrBC,GAAI,oDACJC,eACE,8DAEJC,4BAA6B,CAC3BF,GAAI,0DACJC,eAAgB,4B,upEC4BP,KAACE,uBAAA,EAAD,IArBAC,oCAAb,6E,yIAAA,sI,KAAA,K,MAAA,6G,0FAAA,8DACiB,WACb,OAAO,MAAKC,MAAMC,sBACfC,IAAI,QACJC,KAAI,SAAAC,KACH,O,4aAAA,IACKC,iBAAEC,KAAKF,IAAIG,OAAQ,CACpB,OACA,QACA,OACA,SACA,cACA,YAILA,UAhBP,4DAmBe,WACX,GAAI,MAAKP,MAAMC,sBAAsBC,IAAI,WACvC,YAGF,GAAI,MAAKF,MAAMC,sBAAsBC,IAAI,SACvC,OAAO,8BAACM,wBAAA,EAA4BC,SAASf,uBAG/C,GAAI,MAAKM,MAAMC,sBAAsBC,IAAI,QAAS,CAChD,IAAMQ,UAAY,MAAKC,eACvB,OAAO,KAACC,UAAA,EAAD,CAAWC,KAAMH,YAK1B,OADAI,QAAQC,KAAK,6DACN,QAnCX,M,uCAAA,O,2UAAA,+B,YAAA,mB,WAAA,gCAuCI,OACE,KAACC,aAAA,EAAD,CAAcC,MAAO,CAAEC,OAAQ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OACnBE,YAAU,EACVC,WAAYnH,KAAKpB,MAAMuI,aAEzB,wCAAKC,UAAU,uCAAf,EACE,8BAACC,SAAA,EAAD,YACMrH,KAAKpB,MADX,CAEEuI,WAAYnH,KAAKpB,MAAMuI,WACvBG,kBAAgB,EAChBC,QAASvH,KAAKwH,aACdC,KAAMzH,KAAK0H,UACXC,YAAa3H,KAAK4H,iBAClBC,KAAM7H,KAAK8H,oB,oKAvEvB,8BAAkD5H,iBAyGlD,IAAM6H,gBAAkBC,sBAAyB,CAC/CvH,gBAAiBiC,sBACjB7D,sBAAuB+D,8BAGnBqF,YAAcC,oBAClBH,iBAjBF,SAA4BI,UAC1B,OAAOC,8BACL,CACExD,qCACA3D,sCACAI,mDAEF8G,aAcEE,YAAcC,wBAAc,CAAEC,IAAK,qBAAsBC,mBACzDC,SAAWC,qBAAW,CAC1BH,IAAK,qBACLI,KAAMC,MACNC,qBAGaC,+CACbb,YACAI,YACAI,SAHaK,CAIbvC","file":"39.3ac7e62a1b7013a4731b.chunk.js","sourcesContent":["import { defineMessages } from 'react-intl'\n\nexport default defineMessages({\n clusterInfraLoadError: {\n id: 'app.components.NodeView.k8s.clusterInfraLoadError',\n defaultMessage:\n 'There was an error loading the Cluster Infrastructure data',\n },\n infrastructureSectionHeader: {\n id: 'app.components.NodeView.k8s.infrastructureSectionHeader',\n defaultMessage: 'Cluster Infrastructure',\n },\n})\n","import React, { Component } from 'react'\nimport _ from 'lodash'\nimport PropTypes from 'prop-types'\nimport ImmutablePropTypes from 'react-immutable-proptypes'\n\nimport BorderedCard from 'components/BorderedCard'\nimport DataTable from 'components/DataTable'\nimport DynamicFormattedMessage from 'components/DynamicFormattedMessage'\nimport SectionHeader from 'components/SectionHeader'\nimport SquareLoadingAnimation from 'components/SquareLoadingAnimation'\n\nimport messages from './messages'\n\n/**\n * This component displays a table of Infrastructure (nodes, disks, etc.) in a\n * kubernetes cluster.\n */\nexport class K8sInfrastructure extends Component {\n getTableData = () => {\n return this.props.clusterInfrastructure\n .get('data')\n .map(row => {\n return {\n ..._.pick(row.toJS(), [\n 'name',\n 'label',\n 'type',\n 'active',\n 'createdDate',\n 'srn',\n ]),\n }\n })\n .toJS()\n }\n\n renderBody = () => {\n if (this.props.clusterInfrastructure.get('loading')) {\n return \n }\n\n if (this.props.clusterInfrastructure.get('error')) {\n return \n }\n\n if (this.props.clusterInfrastructure.get('data')) {\n const tableData = this.getTableData()\n return \n }\n\n // eslint-disable-next-line no-console\n console.warn('K8sInfrastructure: received invalid clusterInfrastructure')\n return null\n }\n\n render() {\n return (\n \n \n \n \n {this.renderBody()}
\n \n )\n }\n}\n\nK8sInfrastructure.propTypes = {\n clusterInfrastructure: ImmutablePropTypes.contains({\n data: ImmutablePropTypes.list,\n error: PropTypes.bool,\n loading: PropTypes.bool,\n }).isRequired,\n}\n\nexport default K8sInfrastructure\n","export const GET_CLUSTER_CONTENTS = `app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/GET_CLUSTER_CONTENTS`\nexport const GET_CLUSTER_CONTENTS_SUCCESS = `app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/GET_CLUSTER_CONTENTS_SUCCESS`\nexport const GET_CLUSTER_CONTENTS_ERROR = `app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/GET_CLUSTER_CONTENTS_ERROR`\n\nexport const GET_CLUSTER_INFRASTRUCTURE = `app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/GET_CLUSTER_INFRASTRUCTURE`\nexport const GET_CLUSTER_INFRASTRUCTURE_SUCCESS = `app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/GET_CLUSTER_INFRASTRUCTURE_SUCCESS`\nexport const GET_CLUSTER_INFRASTRUCTURE_ERROR = `app/containers/NodeViewLayouts/K8sClusterNodeViewCardLayout/GET_CLUSTER_INFRASTRUCTURE_ERROR`\n","import { handleActions } from 'redux-actions'\nimport { fromJS } from 'immutable'\n\nimport {\n GET_CLUSTER_CONTENTS,\n GET_CLUSTER_CONTENTS_SUCCESS,\n GET_CLUSTER_CONTENTS_ERROR,\n GET_CLUSTER_INFRASTRUCTURE,\n GET_CLUSTER_INFRASTRUCTURE_SUCCESS,\n GET_CLUSTER_INFRASTRUCTURE_ERROR,\n} from './constants'\n\nexport const initialState = fromJS({\n clusterContents: {\n data: null,\n error: false,\n loading: false,\n },\n clusterInfrastructure: {\n data: null,\n error: false,\n loading: false,\n },\n})\n\nconst k8sClusterNodeViewReducer = handleActions(\n {\n [GET_CLUSTER_CONTENTS]: state =>\n state\n .setIn(['clusterContents', 'loading'], true)\n .setIn(['clusterContents', 'error'], false),\n [GET_CLUSTER_CONTENTS_ERROR]: state =>\n state\n .setIn(['clusterContents', 'loading'], false)\n .setIn(['clusterContents', 'error'], true),\n\n [GET_CLUSTER_CONTENTS_SUCCESS]: (state, { payload }) =>\n state\n .setIn(['clusterContents', 'loading'], false)\n .setIn(['clusterContents', 'error'], false)\n .setIn(['clusterContents', 'data'], fromJS(payload.data)),\n [GET_CLUSTER_INFRASTRUCTURE]: state =>\n state\n .setIn(['clusterInfrastructure', 'loading'], true)\n .setIn(['clusterInfrastructure', 'error'], false),\n [GET_CLUSTER_INFRASTRUCTURE_ERROR]: state =>\n state\n .setIn(['clusterInfrastructure', 'loading'], false)\n .setIn(['clusterInfrastructure', 'error'], true),\n\n [GET_CLUSTER_INFRASTRUCTURE_SUCCESS]: (state, { payload }) =>\n state\n .setIn(['clusterInfrastructure', 'loading'], false)\n .setIn(['clusterInfrastructure', 'error'], false)\n .setIn(['clusterInfrastructure', 'data'], fromJS(payload.data)),\n },\n initialState\n)\n\nexport default k8sClusterNodeViewReducer\n","import { createAction } from 'redux-actions'\nimport {\n GET_CLUSTER_CONTENTS,\n GET_CLUSTER_CONTENTS_SUCCESS,\n GET_CLUSTER_CONTENTS_ERROR,\n GET_CLUSTER_INFRASTRUCTURE,\n GET_CLUSTER_INFRASTRUCTURE_SUCCESS,\n GET_CLUSTER_INFRASTRUCTURE_ERROR,\n} from './constants'\n\nexport const getClusterContents = createAction(GET_CLUSTER_CONTENTS)\nexport const getClusterContentsSuccess = createAction(\n GET_CLUSTER_CONTENTS_SUCCESS\n)\nexport const getClusterContentsError = createAction(GET_CLUSTER_CONTENTS_ERROR)\n\nexport const getClusterInfrastructure = createAction(GET_CLUSTER_INFRASTRUCTURE)\nexport const getClusterInfrastructureSuccess = createAction(\n GET_CLUSTER_INFRASTRUCTURE_SUCCESS\n)\nexport const getClusterInfrastructureError = createAction(\n GET_CLUSTER_INFRASTRUCTURE_ERROR\n)\n","import { all, put, takeLatest } from 'redux-saga/effects'\nimport gql from 'graphql-tag'\nimport _ from 'lodash'\n\nimport { getClient } from 'apolloClient'\nimport {\n getClusterContentsError,\n getClusterContentsSuccess,\n getClusterInfrastructureError,\n getClusterInfrastructureSuccess,\n} from './actions'\nimport { GET_CLUSTER_CONTENTS, GET_CLUSTER_INFRASTRUCTURE } from './constants'\n\nconst GET_CLUST_CONTENT = gql`\n query getClusterContent($srn: String!) {\n Accounts(where: { srn: { value: $srn } }) {\n items {\n srn\n ...containedNamespaces\n }\n }\n }\n\n fragment containedNamespaces on Resource {\n contains {\n items {\n srn\n account\n createdDate\n observedDate\n active\n name\n friendlyName\n tagSet\n ... on Resourcegroup {\n type\n }\n ...containedWorkloads\n }\n }\n }\n\n fragment containedWorkloads on Resource {\n contains {\n items {\n srn\n name\n friendlyName\n label\n ... on Workload {\n type\n }\n ... on User {\n type\n }\n ... on Networkcomponent {\n type\n }\n ... on Identityreference {\n type\n }\n ... on Secretstore {\n type\n }\n }\n }\n }\n`\n\nfunction* getClusterContents(action) {\n try {\n const { srn } = action.payload\n const client = yield getClient()\n const result = yield client.query({\n query: GET_CLUST_CONTENT,\n variables: { srn },\n })\n const path = ['data', 'Accounts', 'items', 0, 'contains', 'items']\n const data = _.get(result, path, null)\n if (data === null) {\n throw 'result did not contain data at: ' + path.join('/')\n }\n yield put(getClusterContentsSuccess({ data }))\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('There was an error fetching cluster contents: ', e)\n yield put(getClusterContentsError())\n }\n}\n\nconst GET_CLUSTER_INFRA_QUERY = gql`\n query getK8sClusterContentsForAccount($srn: String) {\n Accounts(\n where: {\n srn: { value: $srn }\n type: { value: K8SCluster }\n name: { value: \"rascalsakscluster\" }\n }\n ) {\n items {\n name\n isIn(\n where: {\n label: { value: \"Compute\" }\n on__Compute: { type: { value: AzureKubernetesCluster } }\n }\n ) {\n items {\n contains {\n items {\n srn\n label\n active\n createdDate\n ... on Resource {\n name\n }\n ... on Network {\n type\n }\n ... on Networksubnet {\n type\n }\n ... on Networkpolicy {\n type\n }\n ... on Blockstorage {\n type\n }\n }\n }\n }\n }\n }\n }\n }\n`\n\nfunction* getClusterInfrastructure(action) {\n try {\n const { srn } = action.payload\n const client = yield getClient()\n const result = yield client.query({\n variables: { srn },\n query: GET_CLUSTER_INFRA_QUERY,\n })\n\n const path = [\n 'data',\n 'Accounts',\n 'items',\n 0,\n 'isIn',\n 'items',\n 0,\n 'contains',\n 'items',\n ]\n const data = _.get(result, path, null)\n if (data === null) {\n throw 'no data at path ' + path.join('/')\n }\n yield put(getClusterInfrastructureSuccess({ data }))\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('There was an error fetching cluster infrastructure: ', e)\n yield put(getClusterInfrastructureError())\n }\n}\n\nfunction* k8sClusterNodeViewSaga() {\n yield all([\n takeLatest(GET_CLUSTER_CONTENTS, getClusterContents),\n takeLatest(GET_CLUSTER_INFRASTRUCTURE, getClusterInfrastructure),\n ])\n}\n\nexport default k8sClusterNodeViewSaga\n","import { createSelector } from 'reselect'\nimport { Map } from 'immutable'\n\nconst selectK8sClusterNodeView = state =>\n state.get('k8sClusterNodeView') || Map()\n\nexport const selectClusterContents = createSelector(\n selectK8sClusterNodeView,\n state => {\n return state.get('clusterContents') || Map()\n }\n)\nexport const selectClusterInfrastructure = createSelector(\n selectK8sClusterNodeView,\n state => {\n return state.get('clusterInfrastructure') || Map()\n }\n)\n","import { defineMessages } from 'react-intl'\n\nexport default defineMessages({\n errorLoadingClusterContents: {\n id:\n 'app.containers.NodeViewLayouts.K8sClusterNodeViewCardLayout.errorLoadingClusterContents',\n defaultMessage: 'There was an error loading cluster contents.',\n },\n})\n","import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport ImmutablePropTypes from 'react-immutable-proptypes'\nimport _ from 'lodash'\n\nimport BorderedCard from 'components/BorderedCard'\nimport Breadcrumb, { BreadcrumbItem } from 'components/Breadcrumb'\nimport DataTable from 'components/DataTable'\nimport DynamicFormattedMessage from 'components/DynamicFormattedMessage'\nimport SectionHeader from 'components/SectionHeader'\nimport SquareLoadingAnimation from 'components/SquareLoadingAnimation'\nimport TextLink from 'components/TextLink'\n\nimport { getTypeFromSrn } from 'utils/graphDataUtils'\nimport { getNodeViewPushParams } from 'utils/sonraiUtils'\n\nimport messages from './messages'\n\nexport class K8sClusterContents extends Component {\n constructor(props) {\n super(props)\n this.state = {\n gridAPI: null,\n viewingNamespace: null,\n }\n }\n\n componentDidUpdate = (prevProps, prevState) => {\n if (this.state.viewingNamespace != prevState.viewingNamespace) {\n if (this.gridAPI != null) {\n this.gridAPI.redrawRows()\n }\n }\n }\n\n clearViewingNamespace = () => {\n this.setState({ viewingNamespace: null })\n }\n\n handleClickViewWorkloads = namespace => {\n this.setState({ viewingNamespace: namespace.srn })\n }\n\n onGridLoad = ({ api }) => {\n this.setState({ gridAPI: api })\n }\n\n getCountOfContainedStuff = row => {\n const containsCounts = row\n .toJS()\n .contains.items.map(item => item.label)\n .filter(label => ['Workload', 'NetworkComponent', 'User'].includes(label))\n .reduce(\n (acc, cur) => ({\n ...acc,\n [cur]: acc[cur] + 1,\n }),\n {\n Workload: 0,\n NetworkComponent: 0,\n User: 0,\n }\n )\n return containsCounts\n }\n\n getNamespaceData = () => {\n return this.props.clusterContents\n .get('data')\n .filter(row => {\n return 'K8SNamespace' === row.get('type')\n })\n .map(row => {\n return {\n ..._.pick(row.toJS(), [\n 'name',\n 'active',\n 'createdDate',\n 'observedDate',\n ]),\n ...this.getCountOfContainedStuff(row),\n srn: row.get('srn'),\n type: row.get('type'),\n viewWorkloads: true,\n }\n })\n .toJS()\n }\n\n getWorkloadData = () => {\n const namespace = this.props.clusterContents\n .get('data')\n .find(namespace => this.state.viewingNamespace === namespace.get('srn'))\n\n if (!namespace) {\n // eslint-disable-next-line no-console\n console.warn(\n 'K8sClusterContents has entered an invalid state - no namespace with SRN: ' +\n this.state.viewingNamespace\n )\n }\n\n const workloads = namespace.getIn(['contains', 'items'])\n if (!workloads) {\n // eslint-disable-next-line no-console\n console.warn(\n 'K8sClusterContent received namespace w/out workloads ' +\n this.state.viewingNamespace\n )\n return []\n }\n\n return workloads\n .map(row => {\n return {\n ..._.pick(row.toJS(), ['name', 'label', 'type', 'srn']),\n gotoNodeView: row.get('srn'),\n }\n })\n .toJS()\n }\n\n renderBody() {\n if (this.props.clusterContents.get('loading')) {\n return \n }\n\n if (this.props.clusterContents.get('error')) {\n return (\n \n )\n }\n\n let tableData =\n this.state.viewingNamespace != null\n ? this.getWorkloadData()\n : this.getNamespaceData()\n tableData = _.sortBy(tableData, row => row.name)\n if (this.state.viewingNamespace) {\n tableData = _.sortBy(tableData, row => row.label)\n }\n\n return (\n {\n const srn = params.value\n const nodeType = getTypeFromSrn(srn)\n const urlParams = getNodeViewPushParams(srn, nodeType)\n\n return (\n {\n this.props.push(urlParams)\n }}\n >\n Go To Details\n \n )\n },\n },\n viewWorkloads: {\n width: 150,\n minWidth: 150,\n pinned: 'right',\n headerName: '',\n suppressMenu: true,\n cellRendererFramework: params => {\n return (\n {\n this.handleClickViewWorkloads(params.data)\n }}\n >\n View Contents\n \n )\n },\n },\n }}\n />\n )\n }\n\n renderBreadCrumb = () => {\n const breadCrumbItems = []\n\n if (this.state.viewingNamespace) {\n breadCrumbItems.push(\n \n \n Namespaces\n \n \n )\n const namespace = this.props.clusterContents\n .get('data')\n .find(namespace => this.state.viewingNamespace === namespace.get('srn'))\n\n if (!namespace) {\n // eslint-disable-next-line no-console\n console.warn(\n 'K8sClusterContents has entered an invalid state - no namespace with SRN: ' +\n this.state.viewingNamespace\n )\n } else {\n breadCrumbItems.push(\n \n {namespace.get('name')}\n \n )\n }\n } else {\n breadCrumbItems.push(\n Namespaces\n )\n }\n\n return {breadCrumbItems}\n }\n\n render() {\n return (\n \n Contents\n {this.renderBreadCrumb()}\n {this.renderBody()}
\n \n )\n }\n}\n\nK8sClusterContents.propTypes = {\n clusterContents: ImmutablePropTypes.contains({\n data: ImmutablePropTypes.list,\n error: PropTypes.error,\n loading: PropTypes.bool,\n }),\n push: PropTypes.func.isRequired,\n}\n\nexport default K8sClusterContents\n","import React, { Component, Fragment } from 'react'\nimport PropTypes from 'prop-types'\nimport ImmutablePropTypes from 'react-immutable-proptypes'\nimport { connect } from 'react-redux'\nimport { compose, bindActionCreators } from 'redux'\nimport { createStructuredSelector } from 'reselect'\nimport styled from 'styled-components'\n\nimport injectReducer from 'utils/injectReducer'\nimport injectSaga from 'utils/injectSaga'\nimport { DAEMON } from 'utils/constants'\nimport reducer from './reducers'\nimport sagas from './sagas'\n\nimport { push } from 'connected-react-router'\nimport { getClusterContents, getClusterInfrastructure } from './actions'\nimport { selectClusterContents, selectClusterInfrastructure } from './selectors'\n\nimport NodeViewHeader from 'containers/NodeViewHeader'\nimport NodeView from 'containers/NodeSolutionCenter/NodeView'\nimport K8sInfrastructure from 'components/NodeView/k8s/K8sInfrastructure'\nimport K8sClusterContents from './K8sClusterContents'\n\nexport class K8sClusterNodeViewCardLayout extends Component {\n componentDidMount() {\n this.props.getClusterContents({ srn: this.props.nodeId })\n this.props.getClusterInfrastructure({ srn: this.props.nodeId })\n }\n\n getGridContent = () => {\n return [\n \n \n
,\n ]\n }\n\n getLayouts = () => {\n const layouts = {\n namespaces: {\n lg: { w: 2, h: 3.5 },\n xs: { w: 2, h: 3.5 },\n },\n infrastructure: {\n lg: { w: 2, h: 3.5 },\n xs: { w: 2, h: 3.5 },\n },\n }\n\n return layouts\n }\n\n getCols = () => {\n return {\n lg: 2,\n xs: 2,\n }\n }\n\n getTabs = () => {\n const InfrastructureContainer = styled.div`\n height: 650px;\n `\n return [\n \n \n \n \n
,\n ]\n }\n\n render() {\n return (\n \n \n \n \n
\n \n )\n }\n}\n\nK8sClusterNodeViewCardLayout.propTypes = {\n horizontal: PropTypes.bool,\n nodeId: PropTypes.string,\n nodeData: PropTypes.object.isRequired,\n\n // ~~ bound action creators ~~\n push: PropTypes.func,\n getClusterContents: PropTypes.func,\n getClusterInfrastructure: PropTypes.func,\n\n // ~~~ props from redux ~~~\n clusterContents: ImmutablePropTypes.map,\n clusterInfrastructure: ImmutablePropTypes.map,\n}\n\nfunction mapDispatchToProps(dispatch) {\n return bindActionCreators(\n {\n push,\n getClusterContents,\n getClusterInfrastructure,\n },\n dispatch\n )\n}\n\nconst mapStateToProps = createStructuredSelector({\n clusterContents: selectClusterContents,\n clusterInfrastructure: selectClusterInfrastructure,\n})\n\nconst withConnect = connect(\n mapStateToProps,\n mapDispatchToProps\n)\n\nconst withReducer = injectReducer({ key: 'k8sClusterNodeView', reducer })\nconst withSaga = injectSaga({\n key: 'k8sClusterNodeView',\n saga: sagas,\n DAEMON,\n})\n\nexport default compose(\n withConnect,\n withReducer,\n withSaga\n)(K8sClusterNodeViewCardLayout)\n"],"sourceRoot":""}