2017-05-16 13:34:00 +02:00
|
|
|
|
2018-07-30 21:57:43 +02:00
|
|
|
import {debounce} from 'underscore'
|
|
|
|
|
2017-05-16 13:34:00 +02:00
|
|
|
import React from 'react'
|
|
|
|
import {connect} from 'react-redux'
|
|
|
|
|
|
|
|
import PageHeader from 'components/page-header'
|
|
|
|
import Details from './details'
|
|
|
|
import Status from './status'
|
|
|
|
|
|
|
|
import SearchInput from 'components/search-input'
|
|
|
|
|
|
|
|
import Protocols from './protocols'
|
2018-09-09 19:19:47 +02:00
|
|
|
import QuickLinks from './protocols/quick-links'
|
2017-05-16 13:34:00 +02:00
|
|
|
|
2018-07-30 21:57:43 +02:00
|
|
|
import {setProtocolsFilterValue,
|
|
|
|
setProtocolsFilter} from './actions'
|
2017-05-16 13:34:00 +02:00
|
|
|
|
|
|
|
class RouteserversPage extends React.Component {
|
|
|
|
|
2018-07-30 21:57:43 +02:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.dispatchDebounced = debounce(this.props.dispatch, 350);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-05-16 13:34:00 +02:00
|
|
|
setFilter(value) {
|
2018-07-30 21:57:43 +02:00
|
|
|
// Set filter value (for input rendering)
|
|
|
|
this.props.dispatch(setProtocolsFilterValue(value));
|
|
|
|
|
|
|
|
// Set filter delayed
|
|
|
|
this.dispatchDebounced(setProtocolsFilter(value));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
// Reset Filters
|
|
|
|
this.props.dispatch(setProtocolsFilterValue(""));
|
|
|
|
this.props.dispatch(setProtocolsFilter(""));
|
2017-05-16 13:34:00 +02:00
|
|
|
}
|
|
|
|
|
2018-07-30 21:57:43 +02:00
|
|
|
|
2017-05-16 13:34:00 +02:00
|
|
|
render() {
|
|
|
|
return(
|
|
|
|
<div className="routeservers-page">
|
|
|
|
<PageHeader>
|
|
|
|
<Details routeserverId={this.props.params.routeserverId} />
|
|
|
|
</PageHeader>
|
|
|
|
|
|
|
|
<div className="row details-main">
|
2018-07-06 15:03:22 +02:00
|
|
|
<div className="col-lg-9 col-xs-12 col-md-8">
|
2017-05-16 13:34:00 +02:00
|
|
|
<div className="card">
|
|
|
|
<SearchInput
|
|
|
|
value={this.props.protocolsFilterValue}
|
|
|
|
placeholder="Filter by Neighbour, ASN or Description"
|
|
|
|
onChange={(e) => this.setFilter(e.target.value)}
|
|
|
|
/>
|
|
|
|
</div>
|
2018-09-09 19:19:47 +02:00
|
|
|
<QuickLinks />
|
2017-05-16 13:34:00 +02:00
|
|
|
|
|
|
|
<Protocols protocol="bgp" routeserverId={this.props.params.routeserverId} />
|
|
|
|
</div>
|
2018-07-06 15:03:22 +02:00
|
|
|
<div className="col-lg-3 col-md-4 col-xs-12">
|
2017-05-16 13:34:00 +02:00
|
|
|
<div className="card">
|
|
|
|
<Status routeserverId={this.props.params.routeserverId} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
(state) => {
|
|
|
|
return {
|
|
|
|
protocolsFilterValue: state.routeservers.protocolsFilterValue
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)(RouteserversPage);
|
|
|
|
|
|
|
|
|