Fix config change lost when reloading page

This commit is contained in:
leccelecce 2025-03-24 10:41:57 +00:00 committed by james
parent ad21061e16
commit 4a52ff30ac

View File

@ -122,7 +122,9 @@ export default function FrigatePlusSettingsView({
setIsLoading(true); setIsLoading(true);
axios axios
.put(`config/set?model.path=plus://${frigatePlusSettings.model.id}`, {}) .put(`config/set?model.path=plus://${frigatePlusSettings.model.id}`, {
requires_restart: 0,
})
.then((res) => { .then((res) => {
if (res.status === 200) { if (res.status === 200) {
toast.success(t("frigatePlus.toast.success"), { toast.success(t("frigatePlus.toast.success"), {
@ -321,15 +323,14 @@ export default function FrigatePlusSettingsView({
} }
> >
<SelectTrigger> <SelectTrigger>
{(() => { {frigatePlusSettings.model.id &&
const modelId = frigatePlusSettings?.model?.id; availableModels?.[frigatePlusSettings.model.id]
return modelId &&
availableModels?.[modelId]?.trainDate
? new Date( ? new Date(
availableModels[modelId].trainDate, availableModels[
frigatePlusSettings.model.id
].trainDate,
).toLocaleString() ).toLocaleString()
: "Retrieving models..."; : "Retrieving models..."}
})()}
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
<SelectGroup> <SelectGroup>