aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/views/Header.js
blob: 5118ec3bcb1d9ce636680c0071779ea04fa9e137 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import React, {Component} from 'react';
import Typed from 'typed.js';
import './Header.scss';
import {Button} from "react-bootstrap";
import ServicePortFilter from "../components/ServicePortFilter";

class Header extends Component {

    constructor(props) {
        super(props);
        this.state = {
            servicesShow: false
        };
    }

    componentDidMount() {
        const options = {
            strings: ["caronte$ "],
            typeSpeed: 50,
            cursorChar: "❚"
        };
        this.typed = new Typed(this.el, options);
    }

    componentWillUnmount() {
        this.typed.destroy();
    }

    render() {
        return (
            <header className="header container-fluid">
                <div className="row">
                    <div className="col-auto">
                        <h1 className="header-title type-wrap">
                            <span style={{whiteSpace: 'pre'}} ref={(el) => {
                                this.el = el;
                            }}/>
                        </h1>
                    </div>

                    <div className="col-auto">
                        <div className="filters-bar-wrapper">
                            <div className="filters-bar">
                                <ServicePortFilter />
                                {/*<ServicePortFilter name="started_before" default="infinity" />*/}
                                {/*<ServicePortFilter name="started_after" default="-infinity" />*/}

                            </div>
                        </div>
                    </div>

                    <div className="col">
                        <div className="header-buttons">
                            <Button variant="yellow" size="sm">pcaps</Button>
                            <Button variant="blue">rules</Button>
                            <Button variant="red" onClick={this.props.onOpenServices}>
                                services
                            </Button>
                        </div>
                    </div>
                </div>
            </header>
        );
    }
}

export default Header;