mirror of
https://github.com/prometheus/prometheus.git
synced 2025-11-28 14:11:02 +01:00
Hide empty target pools and alert groups by default (#16341)
Also change the SD page setting for this to be in localStorage, as on the other pages. Should help a tiny bit with https://github.com/prometheus/prometheus/issues/16308 Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
parent
e7b1584b6a
commit
a4728fd030
@ -164,7 +164,7 @@ export default function AlertsPage() {
|
||||
const [debouncedSearch] = useDebouncedValue<string>(searchFilter.trim(), 250);
|
||||
const [showEmptyGroups, setShowEmptyGroups] = useLocalStorage<boolean>({
|
||||
key: "alertsPage.showEmptyGroups",
|
||||
defaultValue: true,
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
const { alertGroupsPerPage } = useSettings();
|
||||
|
||||
@ -25,9 +25,8 @@ import {
|
||||
} from "../../state/serviceDiscoveryPageSlice";
|
||||
import CustomInfiniteScroll from "../../components/CustomInfiniteScroll";
|
||||
|
||||
import { useDebouncedValue } from "@mantine/hooks";
|
||||
import { useDebouncedValue, useLocalStorage } from "@mantine/hooks";
|
||||
import { targetPoolDisplayLimit } from "./ServiceDiscoveryPage";
|
||||
import { BooleanParam, useQueryParam, withDefault } from "use-query-params";
|
||||
import { LabelBadges } from "../../components/LabelBadges";
|
||||
|
||||
type TargetLabels = {
|
||||
@ -154,10 +153,10 @@ const ScrapePoolList: FC<ScrapePoolListProp> = ({
|
||||
searchFilter,
|
||||
}) => {
|
||||
const dispatch = useAppDispatch();
|
||||
const [showEmptyPools, setShowEmptyPools] = useQueryParam(
|
||||
"showEmptyPools",
|
||||
withDefault(BooleanParam, true)
|
||||
);
|
||||
const [showEmptyPools, setShowEmptyPools] = useLocalStorage<boolean>({
|
||||
key: "serviceDiscoveryPage.showEmptyPools",
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
// Based on the selected pool (if any), load the list of targets.
|
||||
const {
|
||||
|
||||
@ -167,7 +167,7 @@ const ScrapePoolList: FC<ScrapePoolListProp> = ({
|
||||
const dispatch = useAppDispatch();
|
||||
const [showEmptyPools, setShowEmptyPools] = useLocalStorage<boolean>({
|
||||
key: "targetsPage.showEmptyPools",
|
||||
defaultValue: true,
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
const { collapsedPools, showLimitAlert } = useAppSelector(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user