mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 06:17:27 -08:00
[WebUI/ScrapePoolList] Case-insensitive search of "Scrape Pools" (#12207)
Signed-off-by: hayk96 <hayko5999@gmail.com>
This commit is contained in:
parent
f55ab22179
commit
408f31f786
|
@ -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,13 +53,11 @@ 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) => (
|
||||
<DropdownItem key={name} value={name} onClick={() => onScrapePoolChange(name)} active={name === selectedPool}>
|
||||
{name}
|
||||
</DropdownItem>
|
||||
))
|
||||
filteredPools.map((name) => (
|
||||
<DropdownItem key={name} value={name} onClick={() => onScrapePoolChange(name)} active={name === selectedPool}>
|
||||
{name}
|
||||
</DropdownItem>
|
||||
))
|
||||
)}
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
|
|
Loading…
Reference in a new issue