mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-30 18:47:40 +03:00
Enable mobile view for classification and optimize for mobile layout
This commit is contained in:
parent
61b3d2fc2d
commit
a289ed1f90
@ -65,6 +65,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { supportedLanguageKeys } from "@/lib/const";
|
import { supportedLanguageKeys } from "@/lib/const";
|
||||||
|
|
||||||
import { useDocDomain } from "@/hooks/use-doc-domain";
|
import { useDocDomain } from "@/hooks/use-doc-domain";
|
||||||
|
import { MdCategory } from "react-icons/md";
|
||||||
|
|
||||||
type GeneralSettingsProps = {
|
type GeneralSettingsProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
@ -315,6 +316,19 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
|
|||||||
</Link>
|
</Link>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
{isAdmin && isMobile && config?.face_recognition.enabled && (
|
||||||
|
<>
|
||||||
|
<Link to="/classification">
|
||||||
|
<MenuItem
|
||||||
|
className="flex w-full items-center p-2 text-sm"
|
||||||
|
aria-label={t("menu.classification")}
|
||||||
|
>
|
||||||
|
<MdCategory className="mr-2 size-4" />
|
||||||
|
<span>{t("menu.classification")}</span>
|
||||||
|
</MenuItem>
|
||||||
|
</Link>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</DropdownMenuGroup>
|
</DropdownMenuGroup>
|
||||||
<DropdownMenuLabel className={isDesktop ? "mt-3" : "mt-1"}>
|
<DropdownMenuLabel className={isDesktop ? "mt-3" : "mt-1"}>
|
||||||
{t("menu.appearance")}
|
{t("menu.appearance")}
|
||||||
|
|||||||
@ -60,7 +60,7 @@ export default function TrainFilterDialog({
|
|||||||
moreFiltersSelected ? "text-white" : "text-secondary-foreground",
|
moreFiltersSelected ? "text-white" : "text-secondary-foreground",
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
{t("more")}
|
{isDesktop && t("more")}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
const content = (
|
const content = (
|
||||||
|
|||||||
@ -79,7 +79,9 @@ function ModelCard({ config, onClick }: ModelCardProps) {
|
|||||||
)}
|
)}
|
||||||
onClick={() => onClick()}
|
onClick={() => onClick()}
|
||||||
>
|
>
|
||||||
<div className="grid size-48 grid-cols-2 gap-2">
|
<div
|
||||||
|
className={cn("grid size-48 grid-cols-2 gap-2", isMobile && "w-full")}
|
||||||
|
>
|
||||||
{Object.entries(coverImages).map(([key, image]) => (
|
{Object.entries(coverImages).map(([key, image]) => (
|
||||||
<img
|
<img
|
||||||
key={key}
|
key={key}
|
||||||
|
|||||||
@ -362,7 +362,7 @@ export default function ModelTrainingView({ model }: ModelTrainingViewProps) {
|
|||||||
) : (
|
) : (
|
||||||
<MdAutoFixHigh className="text-secondary-foreground" />
|
<MdAutoFixHigh className="text-secondary-foreground" />
|
||||||
)}
|
)}
|
||||||
{t("button.trainModel")}
|
{isDesktop && t("button.trainModel")}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -725,7 +725,12 @@ function TrainGrid({
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-wrap gap-2 overflow-y-auto p-2">
|
<div
|
||||||
|
className={cn(
|
||||||
|
"flex flex-wrap gap-2 overflow-y-auto p-2",
|
||||||
|
isMobile && "justify-center",
|
||||||
|
)}
|
||||||
|
>
|
||||||
{trainData?.map((data) => (
|
{trainData?.map((data) => (
|
||||||
<div
|
<div
|
||||||
key={data.timestamp}
|
key={data.timestamp}
|
||||||
@ -734,6 +739,7 @@ function TrainGrid({
|
|||||||
selectedImages.includes(data.raw)
|
selectedImages.includes(data.raw)
|
||||||
? "shadow-selected outline-selected"
|
? "shadow-selected outline-selected"
|
||||||
: "outline-transparent duration-500",
|
: "outline-transparent duration-500",
|
||||||
|
isMobile && "w-[48%]",
|
||||||
)}
|
)}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user