2019-11-04 00:17:50 -08:00
|
|
|
import React, { FC } from 'react';
|
2019-10-28 07:02:42 -07:00
|
|
|
import Navigation from './Navbar';
|
2019-10-27 14:03:39 -07:00
|
|
|
import { Container } from 'reactstrap';
|
2019-10-17 05:38:09 -07:00
|
|
|
|
|
|
|
import './App.css';
|
2019-11-04 00:17:50 -08:00
|
|
|
import { Router, Redirect } from '@reach/router';
|
2020-02-03 06:14:25 -08:00
|
|
|
import { Alerts, Config, Flags, Rules, ServiceDiscovery, Status, Targets, TSDBStatus, PanelList } from './pages';
|
2020-01-14 10:34:48 -08:00
|
|
|
import PathPrefixProps from './types/PathPrefixProps';
|
2019-10-17 05:38:09 -07:00
|
|
|
|
2019-11-04 00:17:50 -08:00
|
|
|
const App: FC<PathPrefixProps> = ({ pathPrefix }) => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Navigation pathPrefix={pathPrefix} />
|
|
|
|
<Container fluid style={{ paddingTop: 70 }}>
|
|
|
|
<Router basepath={`${pathPrefix}/new`}>
|
|
|
|
<Redirect from="/" to={`${pathPrefix}/new/graph`} />
|
|
|
|
|
2019-11-20 06:50:52 -08:00
|
|
|
{/*
|
|
|
|
NOTE: Any route added here needs to also be added to the list of
|
|
|
|
React-handled router paths ("reactRouterPaths") in /web/web.go.
|
|
|
|
*/}
|
2019-11-04 00:17:50 -08:00
|
|
|
<PanelList path="/graph" pathPrefix={pathPrefix} />
|
|
|
|
<Alerts path="/alerts" pathPrefix={pathPrefix} />
|
|
|
|
<Config path="/config" pathPrefix={pathPrefix} />
|
|
|
|
<Flags path="/flags" pathPrefix={pathPrefix} />
|
|
|
|
<Rules path="/rules" pathPrefix={pathPrefix} />
|
2020-02-03 06:14:25 -08:00
|
|
|
<ServiceDiscovery path="/service-discovery" pathPrefix={pathPrefix} />
|
2019-11-04 00:17:50 -08:00
|
|
|
<Status path="/status" pathPrefix={pathPrefix} />
|
2019-11-12 02:15:20 -08:00
|
|
|
<TSDBStatus path="/tsdb-status" pathPrefix={pathPrefix} />
|
2019-11-04 00:17:50 -08:00
|
|
|
<Targets path="/targets" pathPrefix={pathPrefix} />
|
|
|
|
</Router>
|
|
|
|
</Container>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
2019-10-17 05:38:09 -07:00
|
|
|
|
|
|
|
export default App;
|