mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 15:45:27 +03:00
ensure we get reindex progress on mount
This commit is contained in:
parent
afc668fe0a
commit
97097556c7
@ -193,6 +193,17 @@ export default function Explore() {
|
|||||||
|
|
||||||
// embeddings reindex progress
|
// embeddings reindex progress
|
||||||
|
|
||||||
|
const { send: sendReindexCommand } = useWs(
|
||||||
|
"embeddings_reindex_progress",
|
||||||
|
"embeddingsReindexProgress",
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
sendReindexCommand("embeddingsReindexProgress");
|
||||||
|
// only run on mount
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, []);
|
||||||
|
|
||||||
const { payload: reindexProgress } = useEmbeddingsReindexProgress();
|
const { payload: reindexProgress } = useEmbeddingsReindexProgress();
|
||||||
|
|
||||||
const embeddingsReindexing = useMemo(() => {
|
const embeddingsReindexing = useMemo(() => {
|
||||||
@ -210,10 +221,10 @@ export default function Explore() {
|
|||||||
|
|
||||||
// model states
|
// model states
|
||||||
|
|
||||||
const { send: sendCommand } = useWs("model_state", "modelState");
|
const { send: sendModelCommand } = useWs("model_state", "modelState");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
sendCommand("modelState");
|
sendModelCommand("modelState");
|
||||||
// only run on mount
|
// only run on mount
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
@ -299,14 +310,18 @@ export default function Explore() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex w-96 flex-col gap-2 py-5">
|
<div className="flex w-96 flex-col gap-2 py-5">
|
||||||
{reindexProgress.time_remaining >= 0 && (
|
{reindexProgress.time_remaining !== null && (
|
||||||
<div className="mb-3 flex flex-col items-center justify-center gap-1">
|
<div className="mb-3 flex flex-col items-center justify-center gap-1">
|
||||||
<div className="text-primary-variant">
|
<div className="text-primary-variant">
|
||||||
Estimated time remaining:
|
{reindexProgress.time_remaining === -1
|
||||||
|
? "Starting up..."
|
||||||
|
: "Estimated time remaining:"}
|
||||||
</div>
|
</div>
|
||||||
{formatSecondsToDuration(
|
{reindexProgress.time_remaining >= 0 &&
|
||||||
|
(formatSecondsToDuration(
|
||||||
reindexProgress.time_remaining,
|
reindexProgress.time_remaining,
|
||||||
) || "Finishing shortly"}
|
) ||
|
||||||
|
"Finishing shortly")}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="flex flex-row items-center justify-center gap-3">
|
<div className="flex flex-row items-center justify-center gap-3">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user