2019-11-04 00:17:50 -08:00
|
|
|
import React, { FC, useState } from 'react';
|
2019-10-28 07:02:42 -07:00
|
|
|
import { Link } from '@reach/router';
|
2019-10-27 14:03:39 -07:00
|
|
|
import {
|
|
|
|
Collapse,
|
|
|
|
Navbar,
|
|
|
|
NavbarToggler,
|
|
|
|
Nav,
|
|
|
|
NavItem,
|
|
|
|
NavLink,
|
|
|
|
UncontrolledDropdown,
|
|
|
|
DropdownToggle,
|
|
|
|
DropdownMenu,
|
|
|
|
DropdownItem,
|
|
|
|
} from 'reactstrap';
|
2020-01-14 10:34:48 -08:00
|
|
|
import PathPrefixProps from './types/PathPrefixProps';
|
2019-10-27 14:03:39 -07:00
|
|
|
|
2019-11-04 00:17:50 -08:00
|
|
|
const Navigation: FC<PathPrefixProps> = ({ pathPrefix }) => {
|
2019-10-27 14:03:39 -07:00
|
|
|
const [isOpen, setIsOpen] = useState(false);
|
|
|
|
const toggle = () => setIsOpen(!isOpen);
|
|
|
|
return (
|
2019-11-02 08:53:32 -07:00
|
|
|
<Navbar className="mb-3" dark color="dark" expand="md" fixed="top">
|
2019-10-28 07:02:42 -07:00
|
|
|
<NavbarToggler onClick={toggle} />
|
2019-11-04 00:17:50 -08:00
|
|
|
<Link className="pt-0 navbar-brand" to={`${pathPrefix}/new/graph`}>
|
2019-10-28 07:02:42 -07:00
|
|
|
Prometheus
|
|
|
|
</Link>
|
2019-10-27 14:03:39 -07:00
|
|
|
<Collapse isOpen={isOpen} navbar style={{ justifyContent: 'space-between' }}>
|
|
|
|
<Nav className="ml-0" navbar>
|
|
|
|
<NavItem>
|
2019-11-04 00:17:50 -08:00
|
|
|
<NavLink tag={Link} to={`${pathPrefix}/new/alerts`}>
|
2019-10-28 07:02:42 -07:00
|
|
|
Alerts
|
|
|
|
</NavLink>
|
2019-10-27 14:03:39 -07:00
|
|
|
</NavItem>
|
|
|
|
<NavItem>
|
2019-11-04 00:17:50 -08:00
|
|
|
<NavLink tag={Link} to={`${pathPrefix}/new/graph`}>
|
2019-10-28 07:02:42 -07:00
|
|
|
Graph
|
|
|
|
</NavLink>
|
2019-10-27 14:03:39 -07:00
|
|
|
</NavItem>
|
|
|
|
<UncontrolledDropdown nav inNavbar>
|
2019-10-28 07:02:42 -07:00
|
|
|
<DropdownToggle nav caret>
|
|
|
|
Status
|
|
|
|
</DropdownToggle>
|
2019-10-27 14:03:39 -07:00
|
|
|
<DropdownMenu>
|
2019-11-04 00:17:50 -08:00
|
|
|
<DropdownItem tag={Link} to={`${pathPrefix}/new/status`}>
|
2019-10-28 07:02:42 -07:00
|
|
|
Runtime & Build Information
|
|
|
|
</DropdownItem>
|
2019-11-12 02:15:20 -08:00
|
|
|
<DropdownItem tag={Link} to={`${pathPrefix}/new/tsdb-status`}>
|
|
|
|
TSDB Status
|
|
|
|
</DropdownItem>
|
2019-11-04 00:17:50 -08:00
|
|
|
<DropdownItem tag={Link} to={`${pathPrefix}/new/flags`}>
|
2019-10-28 07:02:42 -07:00
|
|
|
Command-Line Flags
|
|
|
|
</DropdownItem>
|
2019-11-04 00:17:50 -08:00
|
|
|
<DropdownItem tag={Link} to={`${pathPrefix}/new/config`}>
|
2019-10-28 07:02:42 -07:00
|
|
|
Configuration
|
|
|
|
</DropdownItem>
|
2019-11-04 00:17:50 -08:00
|
|
|
<DropdownItem tag={Link} to={`${pathPrefix}/new/rules`}>
|
2019-10-28 07:02:42 -07:00
|
|
|
Rules
|
|
|
|
</DropdownItem>
|
2019-11-04 00:17:50 -08:00
|
|
|
<DropdownItem tag={Link} to={`${pathPrefix}/new/targets`}>
|
2019-10-28 07:02:42 -07:00
|
|
|
Targets
|
|
|
|
</DropdownItem>
|
2019-11-04 00:17:50 -08:00
|
|
|
<DropdownItem tag={Link} to={`${pathPrefix}/new/service-discovery`}>
|
2019-10-28 07:02:42 -07:00
|
|
|
Service Discovery
|
|
|
|
</DropdownItem>
|
2019-10-27 14:03:39 -07:00
|
|
|
</DropdownMenu>
|
|
|
|
</UncontrolledDropdown>
|
|
|
|
<NavItem>
|
|
|
|
<NavLink href="https://prometheus.io/docs/prometheus/latest/getting_started/">Help</NavLink>
|
|
|
|
</NavItem>
|
|
|
|
<NavItem>
|
2019-11-14 09:46:39 -08:00
|
|
|
<NavLink href={`${pathPrefix}/`}>Classic UI</NavLink>
|
2019-10-27 14:03:39 -07:00
|
|
|
</NavItem>
|
|
|
|
</Nav>
|
|
|
|
</Collapse>
|
|
|
|
</Navbar>
|
|
|
|
);
|
2019-10-28 07:02:42 -07:00
|
|
|
};
|
2019-10-27 14:03:39 -07:00
|
|
|
|
|
|
|
export default Navigation;
|