mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-06-27 14:51:52 +03:00
add loading indicator
This commit is contained in:
parent
208b80939b
commit
0de4922d72
@ -474,6 +474,7 @@ export default function FaceLibrary() {
|
|||||||
attemptImages={trainImages}
|
attemptImages={trainImages}
|
||||||
faceNames={faces}
|
faceNames={faces}
|
||||||
selectedFaces={selectedFaces}
|
selectedFaces={selectedFaces}
|
||||||
|
isLoading={faceData === undefined}
|
||||||
onClickFaces={onClickFaces}
|
onClickFaces={onClickFaces}
|
||||||
onAddFace={() => setAddFace(true)}
|
onAddFace={() => setAddFace(true)}
|
||||||
onRefresh={refreshFaces}
|
onRefresh={refreshFaces}
|
||||||
@ -693,6 +694,7 @@ type TrainingGridProps = {
|
|||||||
attemptImages: string[];
|
attemptImages: string[];
|
||||||
faceNames: string[];
|
faceNames: string[];
|
||||||
selectedFaces: string[];
|
selectedFaces: string[];
|
||||||
|
isLoading: boolean;
|
||||||
onClickFaces: (images: string[], ctrl: boolean) => void;
|
onClickFaces: (images: string[], ctrl: boolean) => void;
|
||||||
onAddFace: () => void;
|
onAddFace: () => void;
|
||||||
onRefresh: (
|
onRefresh: (
|
||||||
@ -711,6 +713,7 @@ function TrainingGrid({
|
|||||||
attemptImages,
|
attemptImages,
|
||||||
faceNames,
|
faceNames,
|
||||||
selectedFaces,
|
selectedFaces,
|
||||||
|
isLoading,
|
||||||
onClickFaces,
|
onClickFaces,
|
||||||
onAddFace,
|
onAddFace,
|
||||||
onRefresh,
|
onRefresh,
|
||||||
@ -766,6 +769,12 @@ function TrainingGrid({
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
if (attemptImages.length == 0) {
|
if (attemptImages.length == 0) {
|
||||||
|
if (isLoading) {
|
||||||
|
return (
|
||||||
|
<ActivityIndicator className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 items-center text-center" />
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (faceNames.length == 0) {
|
if (faceNames.length == 0) {
|
||||||
return (
|
return (
|
||||||
<EmptyCard
|
<EmptyCard
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user