mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 07:35:27 +03:00
Handle input with tags
This commit is contained in:
parent
dbbaa2bda6
commit
c0c81ef3f2
@ -183,6 +183,7 @@ export default function InputWithTags({
|
|||||||
if (allSuggestions[type as FilterType]?.includes(value)) {
|
if (allSuggestions[type as FilterType]?.includes(value)) {
|
||||||
const newFilters = { ...filters };
|
const newFilters = { ...filters };
|
||||||
let timestamp = 0;
|
let timestamp = 0;
|
||||||
|
let times = ["", ""];
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "before":
|
case "before":
|
||||||
@ -222,6 +223,25 @@ export default function InputWithTags({
|
|||||||
newFilters[type] = timestamp / 1000;
|
newFilters[type] = timestamp / 1000;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "timeRange":
|
||||||
|
if (!value.includes(",")) {
|
||||||
|
toast.error("The correct format is after,before.", {
|
||||||
|
position: "top-center",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
times = value.split(",");
|
||||||
|
|
||||||
|
if (times[0] < "00" || times[1] > "24") {
|
||||||
|
toast.error("Times not in valid range", {
|
||||||
|
position: "top-center",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
newFilters[type] = value;
|
||||||
|
break;
|
||||||
case "search_type":
|
case "search_type":
|
||||||
if (!newFilters.search_type) newFilters.search_type = [];
|
if (!newFilters.search_type) newFilters.search_type = [];
|
||||||
if (
|
if (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user