import _ from 'lodash'; import ApiHelpers from './components/util/ApiHelpers.jsx'; import AppContext from './components/util/AppContext.jsx'; import { Layout } from 'antd'; import Namespace from './components/Namespace.jsx'; import NoMatch from './components/NoMatch.jsx'; import React from 'react'; import ReactDOM from 'react-dom'; import ResourceList from './components/ResourceList.jsx'; import ServiceMesh from './components/ServiceMesh.jsx'; import Sidebar from './components/Sidebar.jsx'; import { BrowserRouter, Redirect, Route, Switch } from 'react-router-dom'; import './../css/styles.css'; let appMain = document.getElementById('main'); let appData = !appMain ? {} : appMain.dataset; let pathPrefix = ""; let proxyPathMatch = window.location.pathname.match(/\/api\/v1\/namespaces\/.*\/proxy/g); if (proxyPathMatch) { pathPrefix = proxyPathMatch[0]; } if (_.isEmpty(appData.controllerNamespace)) { appData.controllerNamespace = 'conduit'; } const context = { ...appData, api: ApiHelpers(pathPrefix), pathPrefix: pathPrefix, }; let applicationHtml = (
} /> } /> } /> } />
); ReactDOM.render(applicationHtml, appMain);