mirror of
https://github.com/prometheus/prometheus.git
synced 2025-11-28 22:21:21 +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 [debouncedSearch] = useDebouncedValue<string>(searchFilter.trim(), 250);
|
||||||
const [showEmptyGroups, setShowEmptyGroups] = useLocalStorage<boolean>({
|
const [showEmptyGroups, setShowEmptyGroups] = useLocalStorage<boolean>({
|
||||||
key: "alertsPage.showEmptyGroups",
|
key: "alertsPage.showEmptyGroups",
|
||||||
defaultValue: true,
|
defaultValue: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { alertGroupsPerPage } = useSettings();
|
const { alertGroupsPerPage } = useSettings();
|
||||||
|
|||||||
@ -25,9 +25,8 @@ import {
|
|||||||
} from "../../state/serviceDiscoveryPageSlice";
|
} from "../../state/serviceDiscoveryPageSlice";
|
||||||
import CustomInfiniteScroll from "../../components/CustomInfiniteScroll";
|
import CustomInfiniteScroll from "../../components/CustomInfiniteScroll";
|
||||||
|
|
||||||
import { useDebouncedValue } from "@mantine/hooks";
|
import { useDebouncedValue, useLocalStorage } from "@mantine/hooks";
|
||||||
import { targetPoolDisplayLimit } from "./ServiceDiscoveryPage";
|
import { targetPoolDisplayLimit } from "./ServiceDiscoveryPage";
|
||||||
import { BooleanParam, useQueryParam, withDefault } from "use-query-params";
|
|
||||||
import { LabelBadges } from "../../components/LabelBadges";
|
import { LabelBadges } from "../../components/LabelBadges";
|
||||||
|
|
||||||
type TargetLabels = {
|
type TargetLabels = {
|
||||||
@ -154,10 +153,10 @@ const ScrapePoolList: FC<ScrapePoolListProp> = ({
|
|||||||
searchFilter,
|
searchFilter,
|
||||||
}) => {
|
}) => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const [showEmptyPools, setShowEmptyPools] = useQueryParam(
|
const [showEmptyPools, setShowEmptyPools] = useLocalStorage<boolean>({
|
||||||
"showEmptyPools",
|
key: "serviceDiscoveryPage.showEmptyPools",
|
||||||
withDefault(BooleanParam, true)
|
defaultValue: false,
|
||||||
);
|
});
|
||||||
|
|
||||||
// Based on the selected pool (if any), load the list of targets.
|
// Based on the selected pool (if any), load the list of targets.
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -167,7 +167,7 @@ const ScrapePoolList: FC<ScrapePoolListProp> = ({
|
|||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const [showEmptyPools, setShowEmptyPools] = useLocalStorage<boolean>({
|
const [showEmptyPools, setShowEmptyPools] = useLocalStorage<boolean>({
|
||||||
key: "targetsPage.showEmptyPools",
|
key: "targetsPage.showEmptyPools",
|
||||||
defaultValue: true,
|
defaultValue: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { collapsedPools, showLimitAlert } = useAppSelector(
|
const { collapsedPools, showLimitAlert } = useAppSelector(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user