//import cn from 'classnames'; import { getRE } from 'App/utils'; import { Label, NoContent, Input, SlideModal, CloseButton } from 'UI'; import { connectPlayer } from 'Player'; import Autoscroll from '../Autoscroll'; import BottomBlock from '../BottomBlock'; import TimeTable from '../TimeTable'; import FetchDetails from './FetchDetails'; import { renderName, renderDuration } from '../Network'; @connectPlayer(state => ({ list: state.fetchList, })) export default class Fetch extends React.PureComponent { state = { filter: "", current: null, } onFilterChange = (e, { value }) => this.setState({ filter: value }) setCurrent = (item, index) => { this.setState({ current: item, currentIndex: index }); } closeModal = () => this.setState({ current: null}) nextClickHander = () => { const { list } = this.props; const { currentIndex } = this.state; if (currentIndex === list.length - 1) return; const newIndex = currentIndex + 1; this.setCurrent(list[newIndex], newIndex); } prevClickHander = () => { const { list } = this.props; const { currentIndex } = this.state; if (currentIndex === 0) return; const newIndex = currentIndex - 1; this.setCurrent(list[newIndex], newIndex); } render() { const { list } = this.props; const { filter, current, currentIndex } = this.state; const filterRE = getRE(filter, 'i'); const filtered = list .filter(({ name }) => filterRE.test(name)); return (

Fetch Request

Status
} isDisplayed={ current != null } content={ current && } onClose={ this.closeModal } />

Fetch

{[ { label: "Status", dataKey: 'status', width: 70, }, { label: "Method", dataKey: "method", width: 60, }, { label: "Name", width: 130, render: renderName, }, { label: "Time", width: 80, render: renderDuration, } ]}
); } }