mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-19 01:17:06 +03:00
clean up
This commit is contained in:
parent
3053a33c3d
commit
a782f0137a
@ -52,26 +52,14 @@ export function LogSettingsButton({
|
||||
<div className="text-md">Loading</div>
|
||||
<div className="mt-2.5 flex flex-col gap-2.5">
|
||||
<div className="space-y-1 text-xs text-muted-foreground">
|
||||
By default, logs are loaded in chunks on scroll to save bandwidth,
|
||||
and when the log pane is scrolled to the bottom, new logs
|
||||
When the log pane is scrolled to the bottom, new logs
|
||||
automatically stream as they are added.
|
||||
</div>
|
||||
<FilterSwitch
|
||||
label="Always load full log"
|
||||
isChecked={logSettings?.alwaysLoadFull ?? false}
|
||||
onCheckedChange={(isChecked) => {
|
||||
setLogSettings({
|
||||
alwaysLoadFull: isChecked,
|
||||
disableStreaming: logSettings?.disableStreaming ?? false,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<FilterSwitch
|
||||
label="Disable log streaming"
|
||||
isChecked={logSettings?.disableStreaming ?? false}
|
||||
onCheckedChange={(isChecked) => {
|
||||
setLogSettings({
|
||||
alwaysLoadFull: logSettings?.alwaysLoadFull ?? false,
|
||||
disableStreaming: isChecked,
|
||||
});
|
||||
}}
|
||||
|
||||
@ -31,7 +31,6 @@ import {
|
||||
TooltipTrigger,
|
||||
} from "@/components/ui/tooltip";
|
||||
import { debounce } from "lodash";
|
||||
import { usePersistence } from "@/hooks/use-persistence";
|
||||
|
||||
function Logs() {
|
||||
const [logService, setLogService] = useState<LogType>("frigate");
|
||||
@ -64,13 +63,7 @@ function Logs() {
|
||||
|
||||
// log settings
|
||||
|
||||
// const [logSettings, setLogSettings] = usePersistence<LogSettingsType>(
|
||||
// "logSettings",
|
||||
// { alwaysLoadFull: false, disableStreaming: false },
|
||||
// );
|
||||
|
||||
const [logSettings, setLogSettings] = useState<LogSettingsType>({
|
||||
alwaysLoadFull: false,
|
||||
disableStreaming: false,
|
||||
});
|
||||
|
||||
@ -120,7 +113,7 @@ function Logs() {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const response = await axios.get(`logs/${logService}`, {
|
||||
params: { start: logSettings.alwaysLoadFull ? 0 : -100 },
|
||||
params: { start: filterSeverity ? 0 : -100 },
|
||||
});
|
||||
if (
|
||||
response.status === 200 &&
|
||||
@ -141,7 +134,7 @@ function Logs() {
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
}, [logService, filterLines, logSettings]);
|
||||
}, [logService, filterLines, filterSeverity]);
|
||||
|
||||
const abortControllerRef = useRef<AbortController | null>(null);
|
||||
|
||||
|
||||
@ -16,6 +16,5 @@ export const logTypes = ["frigate", "go2rtc", "nginx"] as const;
|
||||
export type LogType = (typeof logTypes)[number];
|
||||
|
||||
export type LogSettingsType = {
|
||||
alwaysLoadFull: boolean;
|
||||
disableStreaming: boolean;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user