blob: 5022152e3b18636c8cf87f3d752aac751b485c6f [file] [log] [blame]
sebdetc8d61302019-07-04 15:50:34 +02001/*-
2 * ============LICENSE_START=======================================================
3 * ONAP CLAMP
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights
6 * reserved.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
21 *
22 */
23import React from 'react';
xuegao5fe750c2019-08-06 13:03:53 +020024import Nav from 'react-bootstrap/Nav';
sebdetc8d61302019-07-04 15:50:34 +020025import Navbar from 'react-bootstrap/Navbar';
26import NavDropdown from 'react-bootstrap/NavDropdown';
27import 'bootstrap-css-only/css/bootstrap.min.css';
28import styled from 'styled-components';
sebdet8a02dd72019-07-31 17:11:11 +020029import { Link } from 'react-router-dom'
sebdetc8d61302019-07-04 15:50:34 +020030
sebdet8a02dd72019-07-31 17:11:11 +020031const StyledLink = styled(Link)`
32 color: ${props => props.theme.menuColor};
33 background-color: ${props => props.theme.menuBackgroundColor};
34 font-weight: normal;
35 display: block;
36 width: 100%;
37 padding: .25rem 1.5rem;
38 clear: both;
39 text-align: inherit;
40 white-space: nowrap;
41 border: 0;
42 :hover {
43 text-decoration: none;
sebdetc8d61302019-07-04 15:50:34 +020044 background-color: ${props => props.theme.loopViewerHeaderBackgroundColor};
sebdet8a02dd72019-07-31 17:11:11 +020045 color: ${props => props.theme.loopViewerHeaderFontColor};
sebdetc8d61302019-07-04 15:50:34 +020046 }
47`;
xuegao5fe750c2019-08-06 13:03:53 +020048const StyledNavLink = styled(Nav.Link)`
49 color: ${props => props.theme.menuColor};
50 background-color: ${props => props.theme.menuBackgroundColor};
51 font-weight: normal;
52 padding: .25rem 1.5rem;
53 :hover {
54 background-color: ${props => props.theme.loopViewerHeaderBackgroundColor};
55 color: ${props => props.theme.loopViewerHeaderFontColor}
56 }
57`;
sebdetc8d61302019-07-04 15:50:34 +020058export default class MenuBar extends React.Component {
xuegao5fe750c2019-08-06 13:03:53 +020059
sebdetc8d61302019-07-04 15:50:34 +020060 render () {
sebdet8a02dd72019-07-31 17:11:11 +020061 return (
xuegao5fe750c2019-08-06 13:03:53 +020062 <Navbar.Collapse>
63 <NavDropdown title="Closed Loop">
64 <NavDropdown.Item as={StyledLink} to="/openLoop">Open CL</NavDropdown.Item>
65 <NavDropdown.Item as={StyledLink} to="/loopProperties">Properties CL</NavDropdown.Item>
66 <NavDropdown.Item as={StyledLink} to="/closeLoop">Close Model</NavDropdown.Item>
sebdet8a02dd72019-07-31 17:11:11 +020067 </NavDropdown>
xuegao5fe750c2019-08-06 13:03:53 +020068 <NavDropdown title="Manage">
69 <NavDropdown.Item as={StyledLink} to="/submit">Submit</NavDropdown.Item>
70 <NavDropdown.Item as={StyledLink} to="/stop">Stop</NavDropdown.Item>
71 <NavDropdown.Item as={StyledLink} to="/restart">Restart</NavDropdown.Item>
72 <NavDropdown.Item as={StyledLink} to="/delete">Delete</NavDropdown.Item>
73 <NavDropdown.Item as={StyledLink} to="/deploy">Deploy</NavDropdown.Item>
74 <NavDropdown.Item as={StyledLink} to="/undeploy">UnDeploy</NavDropdown.Item>
sebdetc8d61302019-07-04 15:50:34 +020075 </NavDropdown>
xuegao5fe750c2019-08-06 13:03:53 +020076 <NavDropdown title="View">
77 <NavDropdown.Item as={StyledLink} to="/refreshStatus">Refresh Status</NavDropdown.Item>
sebdetc8d61302019-07-04 15:50:34 +020078 </NavDropdown>
xuegao5fe750c2019-08-06 13:03:53 +020079 <NavDropdown title="Help">
80 <StyledNavLink href="https://wiki.onap.org/" target="_blank">Wiki</StyledNavLink>
81 <StyledNavLink href="mailto:onap-discuss@lists.onap.org?subject=CLAMP&body=Please send us suggestions or feature enhancements or defect. If possible, please send us the steps to replicate any defect.">Contact Us</StyledNavLink>
82 <NavDropdown.Item as={StyledLink} to="/userInfo">User Info</NavDropdown.Item>
sebdet8a02dd72019-07-31 17:11:11 +020083 </NavDropdown>
84 </Navbar.Collapse>
85 );
86 }
sebdetc8d61302019-07-04 15:50:34 +020087}