Browse Source

[WebUI/ScrapePoolList] Case-insensitive search of "Scrape Pools" (#12207)

Signed-off-by: hayk96 <hayko5999@gmail.com>
pull/12220/head
Hayk Davtyan 2 years ago committed by GitHub
parent
commit
408f31f786
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      web/ui/react-app/src/pages/targets/ScrapePoolList.tsx

6
web/ui/react-app/src/pages/targets/ScrapePoolList.tsx

@ -31,6 +31,8 @@ const ScrapePoolDropDown: FC<ScrapePoolDropDownProps> = ({ selectedPool, scrapeP
const [filter, setFilter] = useState<string>('');
const filteredPools = scrapePools.filter((pool) => pool.toLowerCase().includes(filter.toLowerCase()));
return (
<Dropdown isOpen={dropdownOpen} toggle={toggle}>
<DropdownToggle caret className="mw-100 text-truncate">
@ -51,9 +53,7 @@ const ScrapePoolDropDown: FC<ScrapePoolDropDownProps> = ({ selectedPool, scrapeP
{scrapePools.length === 0 ? (
<DropdownItem disabled>No scrape pools configured</DropdownItem>
) : (
scrapePools
.filter((name) => filter === '' || name.includes(filter))
.map((name) => (
filteredPools.map((name) => (
<DropdownItem key={name} value={name} onClick={() => onScrapePoolChange(name)} active={name === selectedPool}>
{name}
</DropdownItem>

Loading…
Cancel
Save