diff --git a/package-lock.json b/package-lock.json index f4d31f6e..aeb6dede 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3598,9 +3598,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "dependencies": { "path-key": "^3.1.0", diff --git a/src/components/Snapshots/SnapshotsTab.jsx b/src/components/Snapshots/SnapshotsTab.jsx index aa3d2a1c..46d171d2 100644 --- a/src/components/Snapshots/SnapshotsTab.jsx +++ b/src/components/Snapshots/SnapshotsTab.jsx @@ -14,6 +14,7 @@ export const SnapshotsTab = ({ collectionName }) => { const { client: qdrantClient } = useClient(); const [snapshots, setSnapshots] = useState([]); const [isLoading, setIsLoading] = useState(false); + const [isSnapshotLoading, setIsSnapshotLoading] = useState(false); const { enqueueSnackbar, closeSnackbar } = useSnackbar(); const errorSnackbarOptions = getSnackbarOptions('error', closeSnackbar); const [localShards, setLocalShards] = useState([]); @@ -50,7 +51,7 @@ export const SnapshotsTab = ({ collectionName }) => { }, [qdrantClient, collectionName]); const createSnapshot = () => { - setIsLoading(true); + setIsSnapshotLoading(true); qdrantClient .createSnapshot(collectionName) .then((res) => { @@ -60,7 +61,7 @@ export const SnapshotsTab = ({ collectionName }) => { enqueueSnackbar(err.message, errorSnackbarOptions); }) .finally(() => { - setIsLoading(false); + setIsSnapshotLoading(false); }); }; @@ -136,7 +137,12 @@ export const SnapshotsTab = ({ collectionName }) => {

Snapshots

- @@ -178,7 +184,7 @@ export const SnapshotsTab = ({ collectionName }) => { )} {isLoading &&
Loading...
} - {!isLoading && snapshots?.length > 0 && ( + {(snapshots?.length > 0 || isSnapshotLoading) && ( @@ -196,12 +202,22 @@ export const SnapshotsTab = ({ collectionName }) => { - {tableRows} + + {tableRows} + + {isSnapshotLoading && ( + + + Loading... + + + )} + )} - {!isLoading && !snapshots?.length && ( + {!isLoading && !snapshots?.length && !isSnapshotLoading && ( No snapshots yet, take one! 📸