mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-06 21:19:54 +02:00
Fix web build
This commit is contained in:
parent
64ee5ffff5
commit
e8306b0fa5
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
import { TrashIcon, TeamsIcon } from "@/components/icons/icons"; // Make sure you have a Document360 icon
|
import { TrashIcon, TeamsIcon } from "@/components/icons/icons"; // Make sure you have a Document360 icon
|
||||||
import { fetcher } from "@/lib/fetcher";
|
import { errorHandlingFetcher } from "@/lib/fetcher";
|
||||||
import useSWR, { useSWRConfig } from "swr";
|
import useSWR, { useSWRConfig } from "swr";
|
||||||
import { LoadingAnimation } from "@/components/Loading";
|
import { LoadingAnimation } from "@/components/Loading";
|
||||||
import { HealthCheckBanner } from "@/components/health/healthcheck";
|
import { HealthCheckBanner } from "@/components/health/healthcheck";
|
||||||
@ -23,22 +23,23 @@ import { ConnectorForm } from "@/components/admin/connectors/ConnectorForm";
|
|||||||
import { usePublicCredentials } from "@/lib/hooks";
|
import { usePublicCredentials } from "@/lib/hooks";
|
||||||
import { AdminPageTitle } from "@/components/admin/Title";
|
import { AdminPageTitle } from "@/components/admin/Title";
|
||||||
import { Card, Text, Title } from "@tremor/react";
|
import { Card, Text, Title } from "@tremor/react";
|
||||||
|
import { ErrorCallout } from "@/components/ErrorCallout";
|
||||||
|
|
||||||
const MainSection = () => {
|
const MainSection = () => {
|
||||||
const { mutate } = useSWRConfig();
|
const { mutate } = useSWRConfig();
|
||||||
const {
|
const {
|
||||||
data: connectorIndexingStatuses,
|
data: connectorIndexingStatuses,
|
||||||
isLoading: isConnectorIndexingStatusesLoading,
|
isLoading: isConnectorIndexingStatusesLoading,
|
||||||
error: isConnectorIndexingStatusesError,
|
error: connectorIndexingStatusesError,
|
||||||
} = useSWR<ConnectorIndexingStatus<any, any>[]>(
|
} = useSWR<ConnectorIndexingStatus<any, any>[]>(
|
||||||
"/api/manage/admin/connector/indexing-status",
|
"/api/manage/admin/connector/indexing-status",
|
||||||
fetcher
|
errorHandlingFetcher
|
||||||
);
|
);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: credentialsData,
|
data: credentialsData,
|
||||||
isLoading: isCredentialsLoading,
|
isLoading: isCredentialsLoading,
|
||||||
error: isCredentialsError,
|
error: credentialsError,
|
||||||
refreshCredentials,
|
refreshCredentials,
|
||||||
} = usePublicCredentials();
|
} = usePublicCredentials();
|
||||||
|
|
||||||
@ -49,12 +50,22 @@ const MainSection = () => {
|
|||||||
return <LoadingAnimation text="Loading" />;
|
return <LoadingAnimation text="Loading" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isConnectorIndexingStatusesError || !connectorIndexingStatuses) {
|
if (connectorIndexingStatusesError || !connectorIndexingStatuses) {
|
||||||
return <div>Failed to load connectors</div>;
|
return (
|
||||||
|
<ErrorCallout
|
||||||
|
errorTitle="Something went wrong :("
|
||||||
|
errorMsg={connectorIndexingStatusesError?.info?.detail}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isCredentialsError || !credentialsData) {
|
if (credentialsError || !credentialsData) {
|
||||||
return <div>Failed to load credentials</div>;
|
return (
|
||||||
|
<ErrorCallout
|
||||||
|
errorTitle="Something went wrong :("
|
||||||
|
errorMsg={credentialsError?.info?.detail}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const teamsConnectorIndexingStatuses: ConnectorIndexingStatus<
|
const teamsConnectorIndexingStatuses: ConnectorIndexingStatus<
|
||||||
|
Loading…
x
Reference in New Issue
Block a user