mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-06-27 14:51:52 +03:00
- allow users to select a plus model from the select even when one was not previously loaded - always show model summary card - add model filter popover - add restart button totast
59 lines
1.8 KiB
TypeScript
59 lines
1.8 KiB
TypeScript
import {
|
|
SettingsGroupCard,
|
|
SplitCardRow,
|
|
} from "@/components/card/SettingsGroupCard";
|
|
import type { FrigateConfig } from "@/types/frigateConfig";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
type FrigatePlusCurrentModelSummaryProps = {
|
|
plusModel: FrigateConfig["model"]["plus"];
|
|
};
|
|
|
|
export default function FrigatePlusCurrentModelSummary({
|
|
plusModel,
|
|
}: FrigatePlusCurrentModelSummaryProps) {
|
|
const { t } = useTranslation("views/settings");
|
|
|
|
return (
|
|
<SettingsGroupCard title={t("frigatePlus.cardTitles.currentModel")}>
|
|
{!plusModel && (
|
|
<p className="text-muted-foreground">
|
|
{t("frigatePlus.modelInfo.noModelLoaded")}
|
|
</p>
|
|
)}
|
|
{plusModel && (
|
|
<div className="space-y-6">
|
|
<SplitCardRow
|
|
label={t("frigatePlus.modelInfo.baseModel")}
|
|
content={
|
|
<p>
|
|
{plusModel.baseModel} (
|
|
{plusModel.isBaseModel
|
|
? t("frigatePlus.modelInfo.plusModelType.baseModel")
|
|
: t("frigatePlus.modelInfo.plusModelType.userModel")}
|
|
)
|
|
</p>
|
|
}
|
|
/>
|
|
<SplitCardRow
|
|
label={t("frigatePlus.modelInfo.trainDate")}
|
|
content={<p>{new Date(plusModel.trainDate).toLocaleString()}</p>}
|
|
/>
|
|
<SplitCardRow
|
|
label={t("frigatePlus.modelInfo.modelType")}
|
|
content={
|
|
<p>
|
|
{plusModel.name} ({plusModel.width + "x" + plusModel.height})
|
|
</p>
|
|
}
|
|
/>
|
|
<SplitCardRow
|
|
label={t("frigatePlus.modelInfo.supportedDetectors")}
|
|
content={<p>{plusModel.supportedDetectors.join(", ")}</p>}
|
|
/>
|
|
</div>
|
|
)}
|
|
</SettingsGroupCard>
|
|
);
|
|
}
|