Count filtered hosts

pull/299/head
Andrew Watkins 2016-10-26 16:23:11 -07:00
parent e40ea8a836
commit 65babedac2
1 changed files with 2 additions and 1 deletions

View File

@ -66,12 +66,13 @@ const HostsTable = React.createClass({
render() {
const hosts = this.sort(this.state.filteredHosts, this.state.sortKey, this.state.sortDirection);
const hostCount = hosts.length;
const {source} = this.props;
return (
<div className="panel panel-minimal">
<div className="panel-heading u-flex u-ai-center u-jc-space-between">
<h2 className="panel-title">{this.props.hosts.length} Hosts</h2>
<h2 className="panel-title">{hostCount ? `${hostCount} Hosts` : ''}</h2>
<SearchBar onSearch={_.wrap(this.props.hosts, this.filterHosts)} />
</div>
<div className="panel-body">