Show transition card if no connectors (#2597)

* show transition card if no connectors

* squash

* update apos
This commit is contained in:
pablodanswer
2024-09-29 15:35:41 -07:00
committed by GitHub
parent 5679f0af61
commit a392ef0541
2 changed files with 41 additions and 28 deletions

View File

@ -17,7 +17,7 @@ import {
} from "../../../../components/embedding/interfaces"; } from "../../../../components/embedding/interfaces";
import { Connector } from "@/lib/connectors/connectors"; import { Connector } from "@/lib/connectors/connectors";
import { FailedReIndexAttempts } from "@/components/embedding/FailedReIndexAttempts"; import { FailedReIndexAttempts } from "@/components/embedding/FailedReIndexAttempts";
import { PopupSpec, usePopup } from "@/components/admin/connectors/Popup"; import { usePopup } from "@/components/admin/connectors/Popup";
export default function UpgradingPage({ export default function UpgradingPage({
futureEmbeddingModel, futureEmbeddingModel,
@ -87,10 +87,6 @@ export default function UpgradingPage({
}); });
}, [ongoingReIndexingStatus]); }, [ongoingReIndexingStatus]);
if (!failedIndexingStatus) {
return <div>No failed index attempts</div>;
}
return ( return (
<> <>
{popup} {popup}
@ -116,7 +112,7 @@ export default function UpgradingPage({
</Modal> </Modal>
)} )}
{futureEmbeddingModel && connectors && connectors.length > 0 && ( {futureEmbeddingModel && (
<div> <div>
<Title className="mt-8">Current Upgrade Status</Title> <Title className="mt-8">Current Upgrade Status</Title>
<div className="mt-4"> <div className="mt-4">
@ -133,7 +129,10 @@ export default function UpgradingPage({
> >
Cancel Cancel
</Button> </Button>
{failedIndexingStatus.length > 0 && (
{connectors && connectors.length > 0 ? (
<>
{failedIndexingStatus && failedIndexingStatus.length > 0 && (
<FailedReIndexAttempts <FailedReIndexAttempts
failedIndexingStatuses={failedIndexingStatus} failedIndexingStatuses={failedIndexingStatus}
setPopup={setPopup} setPopup={setPopup}
@ -142,10 +141,10 @@ export default function UpgradingPage({
<Text className="my-4"> <Text className="my-4">
The table below shows the re-indexing progress of all existing The table below shows the re-indexing progress of all existing
connectors. Once all connectors have been re-indexed successfully, connectors. Once all connectors have been re-indexed
the new model will be used for all search queries. Until then, we successfully, the new model will be used for all search
will use the old model so that no downtime is necessary during queries. Until then, we will use the old model so that no
this transition. downtime is necessary during this transition.
</Text> </Text>
{isLoadingOngoingReIndexingStatus ? ( {isLoadingOngoingReIndexingStatus ? (
@ -157,6 +156,22 @@ export default function UpgradingPage({
) : ( ) : (
<ErrorCallout errorTitle="Failed to fetch re-indexing progress" /> <ErrorCallout errorTitle="Failed to fetch re-indexing progress" />
)} )}
</>
) : (
<div className="mt-8 p-6 bg-background-100 border border-border-strong rounded-lg max-w-2xl">
<h3 className="text-lg font-semibold mb-2">
Switching Embedding Models
</h3>
<p className="mb-4 text-text-800">
You&apos;re currently switching embedding models, but there
are no connectors to re-index. This means the transition will
be quick and seamless!
</p>
<p className="text-text-600">
The new model will be active soon.
</p>
</div>
)}
</div> </div>
</div> </div>
)} )}

View File

@ -72,8 +72,6 @@ function Main() {
return <ErrorCallout errorTitle="Failed to fetch embedding model status" />; return <ErrorCallout errorTitle="Failed to fetch embedding model status" />;
} }
const currentModelName = currentEmeddingModel?.model_name;
return ( return (
<div className="h-screen"> <div className="h-screen">
{!futureEmbeddingModel ? ( {!futureEmbeddingModel ? (