feat(logs): add log level selection to tools ui (#3565)

This commit is contained in:
Meier Lukas
2025-07-17 10:43:13 +02:00
committed by GitHub
parent c00110e426
commit c4e5c3002b
12 changed files with 150 additions and 31 deletions

View File

@@ -0,0 +1,26 @@
"use client";
import { Select } from "@mantine/core";
import type { LogLevel } from "@homarr/log/constants";
import { logLevelConfiguration, logLevels } from "@homarr/log/constants";
import { useI18n } from "@homarr/translation/client";
import { useLogContext } from "./log-context";
export const LogLevelSelection = () => {
const { level, setLevel } = useLogContext();
const t = useI18n();
return (
<Select
data={logLevels.map((level) => ({
value: level,
label: `${logLevelConfiguration[level].prefix} ${t(`log.level.option.${level}`)}`,
}))}
value={level}
onChange={(value) => setLevel(value as LogLevel)}
checkIconPosition="right"
/>
);
};