import React from 'react'; import { NoContent, Input, QuestionMarkHint } from 'UI' import { getRE } from 'App/utils'; import { connectPlayer, jump } from 'Player'; import BottomBlock from '../BottomBlock'; import TimeTable from '../TimeTable'; const CONTEXTS = [ "unknown", "self", "same-origin-ancestor", "same-origin-descendant", "same-origin", "cross-origin-ancestor", "cross-origin-descendant", "cross-origin-unreachable", "multiple-contexts" ]; const CONTAINER_TYPES = [ "window", "iframe", "embed", "object" ]; function renderContext({ context }) { return CONTEXTS[ context ]; } function renderDuration({ duration }) { return `${ duration }ms`; } function renderContainerType({ containerType }) { return CONTAINER_TYPES[ containerType ] } @connectPlayer(state => ({ list: state.longtasksList, time: state.time, })) export default class GraphQL extends React.PureComponent { state = { filter: "", } onFilterChange = (e, { value }) => this.setState({ filter: value }) jump = ({ time }) => { jump(time); } render() { const { list, time} = this.props; const { filter, current } = this.state; const filterRE = getRE(filter, 'i'); const filtered = list .filter(({ containerType, context, containerName = "", containerId = "", containerSrc="" }) => filterRE.test(containerName) || filterRE.test(containerId) || filterRE.test(containerSrc) || filterRE.test(CONTEXTS[ context ]) || filterRE.test(CONTAINER_TYPES[ containerType ])); const lastIndex = filtered.filter(item => item.time <= time).length - 1; return (

Long Tasks

Learn more about Long Tasks API } // className="mr-4" />
{[ { label: "Context", render: renderContext, width: 140, }, { label: "Container Type", width: 110, render: renderContainerType, }, // { // label: "ID", // width: 70, // dataKey: "containerId" // }, { // label: "Name", // width: 70, // dataKey: "containerName" // }, { // label: "SRC", // width: 70, // dataKey: "containerSrc" // }, { label: "Duration", width: 100, render: renderDuration, } ]}
); } }