Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show transition card if no connectors #2597

Merged
merged 3 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 41 additions & 26 deletions web/src/app/admin/configuration/search/UpgradingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from "../../../../components/embedding/interfaces";
import { Connector } from "@/lib/connectors/connectors";
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({
futureEmbeddingModel,
Expand Down Expand Up @@ -87,10 +87,6 @@ export default function UpgradingPage({
});
}, [ongoingReIndexingStatus]);

if (!failedIndexingStatus) {
return <div>No failed index attempts</div>;
}

return (
<>
{popup}
Expand All @@ -116,7 +112,7 @@ export default function UpgradingPage({
</Modal>
)}

{futureEmbeddingModel && connectors && connectors.length > 0 && (
{futureEmbeddingModel && (
<div>
<Title className="mt-8">Current Upgrade Status</Title>
<div className="mt-4">
Expand All @@ -133,29 +129,48 @@ export default function UpgradingPage({
>
Cancel
</Button>
{failedIndexingStatus.length > 0 && (
<FailedReIndexAttempts
failedIndexingStatuses={failedIndexingStatus}
setPopup={setPopup}
/>
)}

<Text className="my-4">
The table below shows the re-indexing progress of all existing
connectors. Once all connectors have been re-indexed successfully,
the new model will be used for all search queries. Until then, we
will use the old model so that no downtime is necessary during
this transition.
</Text>
{connectors && connectors.length > 0 ? (
<>
{failedIndexingStatus && failedIndexingStatus.length > 0 && (
<FailedReIndexAttempts
failedIndexingStatuses={failedIndexingStatus}
setPopup={setPopup}
/>
)}

<Text className="my-4">
The table below shows the re-indexing progress of all existing
connectors. Once all connectors have been re-indexed
successfully, the new model will be used for all search
queries. Until then, we will use the old model so that no
downtime is necessary during this transition.
</Text>

{isLoadingOngoingReIndexingStatus ? (
<ThreeDotsLoader />
) : sortedReindexingProgress ? (
<ReindexingProgressTable
reindexingProgress={sortedReindexingProgress}
/>
{isLoadingOngoingReIndexingStatus ? (
<ThreeDotsLoader />
) : sortedReindexingProgress ? (
<ReindexingProgressTable
reindexingProgress={sortedReindexingProgress}
/>
) : (
<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>
Expand Down
2 changes: 0 additions & 2 deletions web/src/app/admin/configuration/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ function Main() {
return <ErrorCallout errorTitle="Failed to fetch embedding model status" />;
}

const currentModelName = currentEmeddingModel?.model_name;

return (
<div className="h-screen">
{!futureEmbeddingModel ? (
Expand Down
Loading