diff --git a/ui/src/hosts/components/HostsTable.js b/ui/src/hosts/components/HostsTable.js index bfbdfbf4e9..3cdc700685 100644 --- a/ui/src/hosts/components/HostsTable.js +++ b/ui/src/hosts/components/HostsTable.js @@ -12,8 +12,8 @@ const HostsTable = React.createClass({ }; }, - filterHosts() { - const hosts = this.props.hosts.filter((h) => h.name.search(this.refs.filter.value) !== -1); + filterHosts(searchTerm) { + const hosts = this.props.hosts.filter((h) => h.name.search(searchTerm) !== -1); this.setState({filteredHosts: hosts}); }, @@ -22,9 +22,7 @@ const HostsTable = React.createClass({ return (
Hostname | @@ -52,4 +50,31 @@ const HostsTable = React.createClass({ }, }); +const SearchBar = React.createClass({ + propTypes: { + onSearch: PropTypes.func.isRequired, + }, + + handleChange() { + this.props.onSearch(this.refs.searchInput.value); + }, + + render() { + return ( +
---|