2021-12-02 15:21:10 +05:00
|
|
|
import { Redirect, Route, Switch } from 'react-router-dom'
|
|
|
|
import { PrivateRoute } from '../components/Private'
|
|
|
|
import { AdminLayoutPortal, LayoutPortal } from '../components/Layout'
|
|
|
|
import Deposit from './Deposit'
|
|
|
|
import Cluster from './Cluster'
|
|
|
|
import Well from './Well'
|
|
|
|
import AdminPanel from './AdminPanel'
|
2021-04-02 17:22:34 +05:00
|
|
|
|
2021-12-02 15:21:10 +05:00
|
|
|
export const Main = () => (
|
2021-08-27 14:21:48 +05:00
|
|
|
<Switch>
|
2021-12-29 17:48:10 +05:00
|
|
|
<PrivateRoute path={'/admin/:tab?'} permission={'admin_panel'}>
|
2021-12-02 15:21:10 +05:00
|
|
|
<AdminLayoutPortal title={'Администраторская панель'}>
|
|
|
|
<AdminPanel />
|
|
|
|
</AdminLayoutPortal>
|
|
|
|
</PrivateRoute>
|
|
|
|
<Route path={'/deposit'}>
|
|
|
|
<LayoutPortal noSheet title='Месторождение'>
|
|
|
|
<Deposit />
|
|
|
|
</LayoutPortal>
|
|
|
|
</Route>
|
|
|
|
<Route path={'/cluster/:idClaster/:tab?'}>
|
|
|
|
<LayoutPortal title={'Анализ скважин куста'}>
|
|
|
|
<Cluster />
|
|
|
|
</LayoutPortal>
|
|
|
|
</Route>
|
|
|
|
<Route path={'/well/:idWell/:tab?'}>
|
|
|
|
<LayoutPortal>
|
|
|
|
<Well />
|
|
|
|
</LayoutPortal>
|
|
|
|
</Route>
|
|
|
|
<Route path={'/'}>
|
|
|
|
<Redirect to={{ pathname: `/deposit` }} />
|
|
|
|
</Route>
|
2021-08-27 14:21:48 +05:00
|
|
|
</Switch>
|
2021-12-02 15:21:10 +05:00
|
|
|
)
|
|
|
|
|
|
|
|
export default Main
|