aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/FlowTable.jsx
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2017-10-25 15:25:41 +0200
committerMaximilian Hils <git@maximilianhils.com>2017-10-25 15:25:41 +0200
commit42895f4fec0f914d2ca3696c6962830140610e6e (patch)
treeb9834abcf99feaf9ac113820814b4998ef9daba0 /web/src/js/components/FlowTable.jsx
parentf870ccd949ca46e6a1ca48a6d5e40589fad41ce2 (diff)
downloadmitmproxy-42895f4fec0f914d2ca3696c6962830140610e6e.tar.gz
mitmproxy-42895f4fec0f914d2ca3696c6962830140610e6e.tar.bz2
mitmproxy-42895f4fec0f914d2ca3696c6962830140610e6e.zip
[web] minor fixes and cleanup
Diffstat (limited to 'web/src/js/components/FlowTable.jsx')
-rw-r--r--web/src/js/components/FlowTable.jsx20
1 files changed, 17 insertions, 3 deletions
diff --git a/web/src/js/components/FlowTable.jsx b/web/src/js/components/FlowTable.jsx
index 24c1f3a1..e3e3d505 100644
--- a/web/src/js/components/FlowTable.jsx
+++ b/web/src/js/components/FlowTable.jsx
@@ -1,17 +1,20 @@
import React from 'react'
import PropTypes from 'prop-types'
import ReactDOM from 'react-dom'
+import { connect } from 'react-redux'
import shallowEqual from 'shallowequal'
import AutoScroll from './helpers/AutoScroll'
import { calcVScroll } from './helpers/VirtualScroll'
import FlowTableHead from './FlowTable/FlowTableHead'
import FlowRow from './FlowTable/FlowRow'
import Filt from "../filt/filt"
+import * as flowsActions from '../ducks/flows'
+
class FlowTable extends React.Component {
static propTypes = {
- onSelect: PropTypes.func.isRequired,
+ selectFlow: PropTypes.func.isRequired,
flows: PropTypes.array.isRequired,
rowHeight: PropTypes.number,
highlight: PropTypes.string,
@@ -107,7 +110,7 @@ class FlowTable extends React.Component {
flow={flow}
selected={flow === selected}
highlighted={isHighlighted(flow)}
- onSelect={this.props.onSelect}
+ onSelect={this.props.selectFlow}
/>
))}
<tr style={{ height: vScroll.paddingBottom }}></tr>
@@ -118,4 +121,15 @@ class FlowTable extends React.Component {
}
}
-export default AutoScroll(FlowTable)
+FlowTable = AutoScroll(FlowTable)
+
+export default connect(
+ state => ({
+ flows: state.flows.view,
+ highlight: state.flows.highlight,
+ selected: state.flows.byId[state.flows.selected[0]],
+ }),
+ {
+ selectFlow: flowsActions.select,
+ }
+)(FlowTable)