mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-09 15:05:26 +03:00
Compare commits
1 Commits
658e17afcc
...
8023c5c385
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8023c5c385 |
@ -812,11 +812,6 @@ limiter = Limiter(key_func=get_remote_addr)
|
|||||||
)
|
)
|
||||||
@limiter.limit(limit_value=rateLimiter.get_limit)
|
@limiter.limit(limit_value=rateLimiter.get_limit)
|
||||||
def login(request: Request, body: AppPostLoginBody):
|
def login(request: Request, body: AppPostLoginBody):
|
||||||
if not request.app.frigate_config.auth.enabled:
|
|
||||||
return JSONResponse(
|
|
||||||
content={"message": "Authentication is disabled"}, status_code=404
|
|
||||||
)
|
|
||||||
|
|
||||||
JWT_COOKIE_NAME = request.app.frigate_config.auth.cookie_name
|
JWT_COOKIE_NAME = request.app.frigate_config.auth.cookie_name
|
||||||
JWT_COOKIE_SECURE = request.app.frigate_config.auth.cookie_secure
|
JWT_COOKIE_SECURE = request.app.frigate_config.auth.cookie_secure
|
||||||
JWT_SESSION_LENGTH = request.app.frigate_config.auth.session_length
|
JWT_SESSION_LENGTH = request.app.frigate_config.auth.session_length
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
import { WidgetProps } from "@rjsf/utils";
|
import { WidgetProps } from "@rjsf/utils";
|
||||||
import { SwitchesWidget } from "./SwitchesWidget";
|
import { SwitchesWidget } from "./SwitchesWidget";
|
||||||
import { FormContext } from "./SwitchesWidget";
|
import { FormContext } from "./SwitchesWidget";
|
||||||
import i18n, { getTranslatedLabel } from "@/utils/i18n";
|
import { getTranslatedLabel } from "@/utils/i18n";
|
||||||
import { FrigateConfig } from "@/types/frigateConfig";
|
import { FrigateConfig } from "@/types/frigateConfig";
|
||||||
import { JsonObject } from "@/types/configForm";
|
import { JsonObject } from "@/types/configForm";
|
||||||
|
|
||||||
@ -76,12 +76,7 @@ function getObjectLabels(context: FormContext): string[] {
|
|||||||
...sourceLabels,
|
...sourceLabels,
|
||||||
...formDataLabels,
|
...formDataLabels,
|
||||||
]);
|
]);
|
||||||
return [...combinedLabels].sort((a, b) =>
|
return [...combinedLabels].sort();
|
||||||
getObjectLabelDisplayName(a).localeCompare(
|
|
||||||
getObjectLabelDisplayName(b),
|
|
||||||
i18n.language,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getObjectLabelDisplayName(label: string): string {
|
function getObjectLabelDisplayName(label: string): string {
|
||||||
@ -99,7 +94,6 @@ export function ObjectLabelSwitchesWidget(props: WidgetProps) {
|
|||||||
i18nKey: "objectLabels",
|
i18nKey: "objectLabels",
|
||||||
listClassName:
|
listClassName:
|
||||||
"relative max-h-none overflow-visible md:max-h-64 md:overflow-y-auto md:overscroll-contain md:scrollbar-container",
|
"relative max-h-none overflow-visible md:max-h-64 md:overflow-y-auto md:overscroll-contain md:scrollbar-container",
|
||||||
enableSearch: true,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -7,20 +7,13 @@ import useSWR from "swr";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import { Pencil, Trash2 } from "lucide-react";
|
import { Pencil, Trash2 } from "lucide-react";
|
||||||
import {
|
import { LuChevronDown, LuChevronRight, LuPlus } from "react-icons/lu";
|
||||||
LuChevronDown,
|
|
||||||
LuChevronRight,
|
|
||||||
LuExternalLink,
|
|
||||||
LuPlus,
|
|
||||||
} from "react-icons/lu";
|
|
||||||
import { Link } from "react-router-dom";
|
|
||||||
import type { FrigateConfig } from "@/types/frigateConfig";
|
import type { FrigateConfig } from "@/types/frigateConfig";
|
||||||
import type { JsonObject } from "@/types/configForm";
|
import type { JsonObject } from "@/types/configForm";
|
||||||
import type { ProfileState, ProfilesApiResponse } from "@/types/profile";
|
import type { ProfileState, ProfilesApiResponse } from "@/types/profile";
|
||||||
import { getProfileColor } from "@/utils/profileColors";
|
import { getProfileColor } from "@/utils/profileColors";
|
||||||
import { PROFILE_ELIGIBLE_SECTIONS } from "@/utils/configUtil";
|
import { PROFILE_ELIGIBLE_SECTIONS } from "@/utils/configUtil";
|
||||||
import { resolveCameraName } from "@/hooks/use-camera-friendly-name";
|
import { resolveCameraName } from "@/hooks/use-camera-friendly-name";
|
||||||
import { useDocDomain } from "@/hooks/use-doc-domain";
|
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import Heading from "@/components/ui/heading";
|
import Heading from "@/components/ui/heading";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
@ -73,7 +66,6 @@ export default function ProfilesView({
|
|||||||
setProfilesUIEnabled,
|
setProfilesUIEnabled,
|
||||||
}: ProfilesViewProps) {
|
}: ProfilesViewProps) {
|
||||||
const { t } = useTranslation(["views/settings", "common"]);
|
const { t } = useTranslation(["views/settings", "common"]);
|
||||||
const { getLocaleDocUrl } = useDocDomain();
|
|
||||||
const { data: config, mutate: updateConfig } =
|
const { data: config, mutate: updateConfig } =
|
||||||
useSWR<FrigateConfig>("config");
|
useSWR<FrigateConfig>("config");
|
||||||
const { data: profilesData, mutate: updateProfiles } =
|
const { data: profilesData, mutate: updateProfiles } =
|
||||||
@ -368,17 +360,6 @@ export default function ProfilesView({
|
|||||||
<div className="my-1 text-sm text-muted-foreground">
|
<div className="my-1 text-sm text-muted-foreground">
|
||||||
{t("profiles.disabledDescription", { ns: "views/settings" })}
|
{t("profiles.disabledDescription", { ns: "views/settings" })}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center text-sm text-primary-variant">
|
|
||||||
<Link
|
|
||||||
to={getLocaleDocUrl("configuration/profiles")}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
className="inline"
|
|
||||||
>
|
|
||||||
{t("readTheDocumentation", { ns: "common" })}
|
|
||||||
<LuExternalLink className="ml-2 inline-flex size-3" />
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Enable Profiles Toggle — shown only when no profiles exist */}
|
{/* Enable Profiles Toggle — shown only when no profiles exist */}
|
||||||
{!hasProfiles && setProfilesUIEnabled && (
|
{!hasProfiles && setProfilesUIEnabled && (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user