import React, {Component} from 'react'; import './PcapPane.scss'; import Table from "react-bootstrap/Table"; import backend from "../../backend"; import {formatSize, timestampToTime2} from "../../utils"; import {Container, Row, Col, Form} from "react-bootstrap"; import StringField from "../fields/StringField"; class PcapPane extends Component { constructor(props) { super(props); this.state = { sessions: [], }; this.loadSessions = this.loadSessions.bind(this); } componentDidMount() { this.loadSessions(); } loadSessions() { backend.get("/api/pcap/sessions").then(res => this.setState({sessions: res})); } render() { let sessions = this.state.sessions.map(s => {s["id"].substring(0, 8)} {timestampToTime2(s["started_at"])} {((new Date(s["completed_at"]) - new Date(s["started_at"])) / 1000).toFixed(3)}s {formatSize(s["size"])} {s["processed_packets"]} {s["invalid_packets"]} undefined download ); return (
GET /api/pcap/sessions 200 OK
{sessions}
id started_at duration size processed_packets invalid_packets packets_per_service actions
POST /api/pcap/upload




POST /api/pcap/file
); } } export default PcapPane;