mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-01 02:57:41 +03:00
Add back button
This commit is contained in:
parent
79ab6f00df
commit
2ce3d9e87c
@ -282,6 +282,7 @@ export type CameraStreamingSettings = {
|
|||||||
export type CustomClassificationModelConfig = {
|
export type CustomClassificationModelConfig = {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
name: string;
|
name: string;
|
||||||
|
threshold: number;
|
||||||
object_config: null | {
|
object_config: null | {
|
||||||
objects: string[];
|
objects: string[];
|
||||||
};
|
};
|
||||||
@ -289,7 +290,6 @@ export type CustomClassificationModelConfig = {
|
|||||||
cameras: {
|
cameras: {
|
||||||
[cameraName: string]: {
|
[cameraName: string]: {
|
||||||
crop: [number, number, number, number];
|
crop: [number, number, number, number];
|
||||||
threshold: number;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
motion: boolean;
|
motion: boolean;
|
||||||
|
|||||||
@ -48,12 +48,15 @@ import { TbCategoryPlus } from "react-icons/tb";
|
|||||||
import { useModelState } from "@/api/ws";
|
import { useModelState } from "@/api/ws";
|
||||||
import { ModelState } from "@/types/ws";
|
import { ModelState } from "@/types/ws";
|
||||||
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { IoMdArrowRoundBack } from "react-icons/io";
|
||||||
|
|
||||||
type ModelTrainingViewProps = {
|
type ModelTrainingViewProps = {
|
||||||
model: CustomClassificationModelConfig;
|
model: CustomClassificationModelConfig;
|
||||||
};
|
};
|
||||||
export default function ModelTrainingView({ model }: ModelTrainingViewProps) {
|
export default function ModelTrainingView({ model }: ModelTrainingViewProps) {
|
||||||
const { t } = useTranslation(["views/classificationModel"]);
|
const { t } = useTranslation(["views/classificationModel"]);
|
||||||
|
const navigate = useNavigate();
|
||||||
const [page, setPage] = useState<string>("train");
|
const [page, setPage] = useState<string>("train");
|
||||||
const [pageToggle, setPageToggle] = useOptimisticState(page, setPage, 100);
|
const [pageToggle, setPageToggle] = useOptimisticState(page, setPage, 100);
|
||||||
|
|
||||||
@ -294,6 +297,19 @@ export default function ModelTrainingView({ model }: ModelTrainingViewProps) {
|
|||||||
</AlertDialog>
|
</AlertDialog>
|
||||||
|
|
||||||
<div className="flex flex-row justify-between gap-2 p-2 align-middle">
|
<div className="flex flex-row justify-between gap-2 p-2 align-middle">
|
||||||
|
<div className="flex flex-row items-center justify-center gap-2">
|
||||||
|
<Button
|
||||||
|
className="flex items-center gap-2.5 rounded-lg"
|
||||||
|
aria-label={t("label.back", { ns: "common" })}
|
||||||
|
onClick={() => navigate(-1)}
|
||||||
|
>
|
||||||
|
<IoMdArrowRoundBack className="size-5 text-secondary-foreground" />
|
||||||
|
{isDesktop && (
|
||||||
|
<div className="text-primary">
|
||||||
|
{t("button.back", { ns: "common" })}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
<LibrarySelector
|
<LibrarySelector
|
||||||
pageToggle={pageToggle}
|
pageToggle={pageToggle}
|
||||||
dataset={dataset || {}}
|
dataset={dataset || {}}
|
||||||
@ -302,6 +318,7 @@ export default function ModelTrainingView({ model }: ModelTrainingViewProps) {
|
|||||||
onDelete={onDelete}
|
onDelete={onDelete}
|
||||||
onRename={() => {}}
|
onRename={() => {}}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
{selectedImages?.length > 0 ? (
|
{selectedImages?.length > 0 ? (
|
||||||
<div className="flex items-center justify-center gap-2">
|
<div className="flex items-center justify-center gap-2">
|
||||||
<div className="mx-1 flex w-48 items-center justify-center text-sm text-muted-foreground">
|
<div className="mx-1 flex w-48 items-center justify-center text-sm text-muted-foreground">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user